1

We are using Dojo framework to develop our portal. We have bound the ArcGIS map in our web portal. Is there any ArcGIS JavaScript API which will accept the path of the shapefile and plot that shapefile directly on map. If it is free API then that will be great and if it is paid API then how can we purchase that?

nmtoken
13.6k5 gold badges39 silver badges91 bronze badges
asked Jun 5, 2015 at 18:24

1 Answer 1

1

Simplest solution is to use ArcGIS Online, they allow you to upload and plot your shapefiles.

Though I'm guessing by the way you phrased your question, you want to build the map and interface around it yourself and you don't have ArcGIS for Server. In that case, one way to do it would be to build an intermediate service that takes the uploaded shapefile and converts it to a csv lat/lon. You could easily build something that uses ogr2ogr in gdal... and even build off of what has already been done by the community such as this for example: https://gis.stackexchange.com/a/19178. Once they are in csv, you can create a FeatureLayer in javascript with the data and it will plot on the map. Esri has a nice demo with drag and drop functionality of csv files: https://developers.arcgis.com/javascript/jssamples/exp_dragdrop.html

The other route you could go is use an intermediate service (with ogr2ogr) to convert from your shapefile to GeoJSON. Something like:

ogr2ogr -f GeoJSON data.json data.shp

Once you have GeoJSON, you can plot that on the map... though Esri needs ArcGIS JSON instead of GeoJSON. Esri has already taken care of this for you with the geojson-layer component in their github repo.

answered Jun 8, 2015 at 6:48

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.