Add shapefile to map?

4384
5
04-20-2015 07:28 AM
JerryGarcia
Occasional Contributor II

How would you add a shapefile to the map using the JS API?  Thanks!

0 Kudos
5 Replies
SamuelTompsett
Occasional Contributor II

Hello Jerry,

Here is the documentation and sample.

Add shapefile | ArcGIS API for JavaScript

Thanks,

Sam

JerryGarcia
Occasional Contributor II

I am not using the Portal.  Is there another way?  Thanks!

0 Kudos
KellyHutchins
Esri Frequent Contributor

You don't need to be using portal to use the sample that Samuel linked to above - it just uses esriRequest to add the shapefile using the Portal REST API.

AlicePence
Occasional Contributor II

This way uses Leaflet calvinmetcalf/leaflet.shapefile · GitHub 

Or you can try using Simple DynamicMapLayer | Esri Leaflet

--> with the last one, you don't need Portal.

SteveCole
Frequent Contributor

I think this question comes up periodically. Here's a discussion from back in January which might help you:

How to add a shapefile without ArcGIS Online