I receive a polygon layer in Leaflet via ESRI REST. (similar to here )
I want to have a menu where I can zoom to specific polygons. (one button per polygon)
How can I do that?
esri-leafletjavascriptleaflet
I receive a polygon layer in Leaflet via ESRI REST. (similar to here )
I want to have a menu where I can zoom to specific polygons. (one button per polygon)
How can I do that?
Best Answer
It should be quite easy by using the
onEachFeature
option of theL.esri.featureLayer
, combined with shapesgetBounds()
and mapfitBounds()
.HTML:
JavaScript:
Demo: http://jsfiddle.net/ve2huzxw/47/