Search code examples
arcgismarkerarcgis-js-api

Hide overlaped marker on ArcGIS map with JS API


I am using JS API for ArcGIS 4.14 (Webmap), I have two sets of markers(Pointers on layers). One is a priority one than the other. How can I hide the low priority marker that appears over the high priority one? Thanks in advance.


Solution

  • The problem you have is the render order of the features.

    One simple way of solving this, is to use two feature layers instead of one. In the first one you keep the features with low priority markers, and the features with high priority markers in the second one. You can do this by using definitionExpression property.

    Finally, you add to the map the second layer (features with high priority markers) last.

    ArcGIS API - Feature Layer definitionExpression