I am using a third-party application which allows the user to add custom map layers to a Leaflet map. All I am able to input is a url to the map layer. I’ve taken a look at the source code and they are using this method:
https://developers.arcgis.com/esri-leaflet/api-reference/layers/feature-layer/
My GIS files are not hosted through an arcGIS system. Is there a way I can serve my own files so that this method will load them onto the map properly?
I tried a couple urls, but I see inconsistent behaviour:
- geoJson url
Enter this:
https://foo.blob.core.windows.net/gis/roads.geojson
Site fetches this:
https://foo.blob.core.windows.net/gis/roads.geojson/query?returnGeometry=true&where=*&outFields=*&in*&geometry=*&geometryType=*&spatialRel=*&geometryPrecision=*&f=geojson
This is also what it does with the typical arcgis urls, which works well for them, but not for plain static files.
- Miscellaneous url
Enter this:
https://foo.blob.core.windows.net/gis
Site fetches this:
https://foo.blob.core.windows.net/gis/?f=json
The miscellaneous url is the one that really gets me, because https://foo.blob.core.windows.net/gis/query is geoJson, so I thought maybe this would be a successful workaround.
That said, I’m not sure if this method will even load geoJSON or if it has to be one of the esri formats.