I have a feature layer that is dynamic and could pull a

geometryType: esriGeometryPoint


geometryType: esriGeomertyPolygon

I was wondering how would I know when to set the selection symbol to

new esri.symbol.SimpleMarkerSymbol(...)


new esri.symbol.SimpleFillSymbol(...)

Before I was able to just set the selection symbol to new esri.symbol.SimpleMarkerSymbol(...) and it would fill the polygon symbol. But now something seems to have changed where it now just places a circle or marker symbol in its place.

I've tried to set the selection symbol on featureLayer.on("load", function (evt) { ... }), but it just seems to use the default color of the layer.

Thanks in advance.


After doing some digging I found the answer to my question.

When the featureLayer is loaded featureLayer.on("load", function (evt) { ... }) follow these steps:

  1. Suspend drawing on the layer featuerLayer.suspend()
  2. Set your selection symbol featureLayer.setSelectionSymbol(...)
  3. Resume drawing on the layer featureLayer.resume()

Hope this helps someone out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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