I want to highlight equipment on map as soon as it loads. I tried following approach and it works but I am looking for better apprach:
1) Load map
2) Add ArcGISDynamicLayer
3) As soon as ArcGISDynamicLayer is added, I use FeatureLayer.selectFeatures() to highlight the equipment.
The problem with this approach is it loads map twice. I am looking something where I can fire selectFeatures first and then supply required information to map so, in one call map can be loaded with the appropriate extent. Any example for this approach?
Solved! Go to Solution.
Hi Bhavin,
I have updated the fiddle to do add selection graphics instead of definition query.
Hi Bhavin,
Checkout this fiddle. Edit fiddle - JSFiddle
Hi Riyas,
setLayerDefinitions will filter out the features of particular layer and show only features which satisfies the filter criteria. It won't show other features on the same layer. I am looking for that.
I am looking to show all features of particular layer but highlight features which satisfies the criteria. e.g. Map needs to show all point features of Manhole layer but I want to highlight one Manhole feature with green color because it is matching the filter criteria. Is there any way to achieve this by requesting map only once with filter criteria + symbol definitions to highlight? To highlight features, I use selectFeatures() of FeatureLayer.
Can you simply apply a definition expression to the feature layer? Ex: Edit fiddle - JSFiddle
Hi Bhavin,
I have updated the fiddle to do add selection graphics instead of definition query.
Jake/Riyas - thanks both of you for putting efforts to build the examples.
Loading feature layer before loading map looks good. I need to implement few more things on this scenario. I need to show acetates (e.g. measurements, lines, labels etc) as well when the map is loaded. I allow my customers to store acetates in the database. When user tries to open the map, I retrieve all stored acetates. Now, when they can be added on the map? Should I add them in map load event? Or there is a different approach?
Hi Bhavin,
By acetates if you are referring to adding graphics to map. Map load event would be the place when you start placing your graphics.
However, if you expect the number of graphics to be lot (say over 1000 odd points) it'll pull down your application performance.