0

Similar to the question asked here - Get features onclick ArcGIS JavaScript API.

I want to get attributes of a feature clicked using ArgGIS Js v4 API. MabBox / Maplibre allows for this - https://docs.mapbox.com/mapbox-gl-js/style-spec/sources/#vector-promoteId.

Is there a way to get an ID of a feature from a vector tile layer via an onclick event using ArcGIS JS? Specifically.

Looking at this ESRI thread, it seems this is not possible as of 2016. But that was 6 years ago, and one would hope that the ESRI JS library development is keeping pace with free alternatives such as maplibre-gl, openlayers, etc.

1
  • very surprised they have not enabled accessing the attributes yet
    – ziggy
    Commented Nov 8, 2023 at 15:13

1 Answer 1

2

ESRI currently doesn't support attributes included in vector tiles as per the mapbox vector tile spec. https://community.esri.com/t5/arcgis-online-ideas/query-vector-tile-layers-for-feature-attributes/idi-p/1004761

So this is currently impossible without querying for features separately.

I imagine this applies to both server and client APIs - you can't get feature information from a tile layer published via Martin or pg_tileserv and you probably won't receive feature information from an esri tile layer in Maplibre-gl or similar.

1
  • While it's true that you need to query the features separately - what that means in practice does not have to mean querying the feature service. Information can be obtained from Esri-generated vector tiles assuming you marked the highlight field (I think that's the name of it) and then using something like my tilequery tool to query the tiles themselves. See this example (tiles rendered in Esri JS but created using third party tools). reyemtm.github.io/map-compare//?map=esri-v4
    – Malcolm
    Commented Mar 18, 2023 at 18:03

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.