Select to view content in your preferred language

Advice on using ArcGIS API for JavaScript or ArcGIS Extension for Google Maps API

1444
12
02-07-2012 12:45 PM
JessicaRichardson
Emerging Contributor
Hello,

I'm working on a project with the desired end result of an interactive web map that can query my data and map out the results.  My data is simply point locations of animal sightings with attributes, including lat/long in decimal degrees.  I have the data in many formats (MS Access database, shapefile, MS Excel spreadsheet, etc.) and can easily transform it into other formats as necessary.  Right now I'm getting bogged down in which technology would be most efficient and work best to get the desired end result.  I want to have a simple Google Maps satellite basemap (or something similar) and a panel or option to select a species and a time range of points to map out.

I realize this may be an exceedingly simple question/task, but instead of continuing to run around in circles I raise my question to the experts.

Any advice/guidance would be much appreciated!!


Thanks 🙂
0 Kudos
12 Replies
JessicaRichardson
Emerging Contributor
betsyjsg,

Your website is basically EXACTLY what I'm trying to get, maybe with a few extras I don't need.  I think the place I keep hitting a wall is adding my points to my map using the JS API.  I don't have ArcGIS Server, my file is on my ArcGIS Online account but is not a service.  From looking at the code from the URL you sent me, it looks like your data comes from a map server.  Do you know a way to use similar coding without actually having a map server?


Thanks!
0 Kudos
BetsySchenck-Gardner
Deactivated User
Yes.  The data is being served out on an ArcGIS Server here and I access it through its REST url.  You said earlier that you could output your data as a csv.  You could use the dojo's CsvStore function to load your csv file and within the CsvStore function there is a query option to retrieve only those points you want to be displayed.  Here's a snippet that might start you in the right direction:

  var species_name = "Karenia brevis";

  var dataStore = new dojox.data.CsvStore({url:"data.csv"});
  dataStore.fetch({
    query:{species: species_name},
    onComplete: function(items, request)  {
      dojo.forEach(items, function(item, index)  {
        var lat = dataStore.getValue(item, "Latitude");
        var lon = dataStore.getValue(item, "Longitude");
        var symbol = new esri.symbol.SimpleMarkerSymbol();
        var latitude = parseFloat(lat);
        var longitude = parseFloat(lon);
        var geometry = new esri.geometry.Point(longitude,latitude);     
        geometry = esri.geometry.geographicToWebMercator(geometry);
        dataLayer.add(new esri.Graphic(geometry, symbol));
      });
    },
    onError: function(error)  {
      alert("Unable to read data file");
    }
  });

It's a bit more complicated just because you are having to read your points in via a data store vs a map service.  As long as your csv file is on the same server as your JS API, you don't have to use a proxy service. 

I don't know how you can retrieve the data you have posted out on ArcGIS Online so you will need to get some help from ESRI about doing that.  I've never done that before.
0 Kudos
derekswingley1
Deactivated User
You could also take your CSV file, drag-and-drop it on to the ArcGIS.com map and save it.
0 Kudos