Esri / esri-leaflet

A lightweight set of tools for working with ArcGIS services in Leaflet. :rocket:
https://developers.arcgis.com/esri-leaflet/
Apache License 2.0
1.61k stars 799 forks source link

Identify() procedure for L.esri.tiledMapLayer and L.esri.featureLayer layers #1209

Closed Mak-NOAA closed 4 years ago

Mak-NOAA commented 4 years ago

Uncaught TypeError: Cannot read property 'identify' of undefined error is being thrown at:

https://github.com/nwfsc-fram/warehouse/blob/c8e7f820d83bf879993eca8386e968e8c158c4d1/server/app/view2/view2.js#L1167

for L.esri.tiledMapLayer and L.esri.featureLayer layers.

I understand that the identify() procedure was meant for L.esri.dynamicMapLayer layers only https://esri.github.io/esri-leaflet/examples/identifying-features.html

Is there an equivalent procedure for L.esri.tiledMapLayer and L.esri.featureLayer layers?

gavinr commented 4 years ago

According to the doc, L.esri.tiledMapLayer does have an identify method: https://esri.github.io/esri-leaflet/api-reference/layers/tiled-map-layer.html#methods

L.esri.FeatureLayer does not have an identify method: https://esri.github.io/esri-leaflet/api-reference/layers/feature-layer.html#methods ... I think you might want to do a query in this case.

Mak-NOAA commented 4 years ago

Thanks @gavinr let me try a query in case of featureLayer....good to hear about tiledMapLayer

jwasilgeo commented 4 years ago

@Mak-NOAA I'll close this with the assumption you were able to accomplish what you wanted to do. If not, of course feel free to reopen and let us know.