When we apply smart mapping style - Counts and Amounts (By Size) to a point layer (without any classes defined), we are not able to interrogate the size of the graphic symbol. We were expecting the layer's renderer info to have this information. However, the closest thing we could find are only the parameters used by the style i.e., minDatavalue, maxDatavalue, minSize and maxSize in renderer -> visualVariables. The actual size that is used to display the graphic is not listed in the rendererInfo anywhere.
We need to identify the size of a graphic symbol in order to show a cyan colored square selection symbol that is slightly larger than the graphic's symbol, the way it is displayed in ArcGIS Map Viewer.
The cyan colored square selection graphic is added to separate graphic layer on top of the feature layer.
Is there another way to find out the feature's graphic symbol size? or maybe calculate the size based on parameters defined in rendererInfo?
Here is a sample webmap that uses this style.
http://www.arcgis.com/home/webmap/viewer.html?webmap=3f9fc16b8ab94b0698c738a0c9a71c72
Solved! Go to Solution.
You can get details about the graphic's shape using the graphic's getDojoShape() method. However in your situation I'd just let the feature layer handle this behavior. You can specify that you do not want popups to display when you click on a feature but still allow the events associated with the popup, like selecting and highlighting the feature, to occur. We have a sample in the help called Popup content in side panel that shows this behavior.
If you'd like to change the popup's highlight symbol you can do that too. Here's a simple sample that shows this:
You can get details about the graphic's shape using the graphic's getDojoShape() method. However in your situation I'd just let the feature layer handle this behavior. You can specify that you do not want popups to display when you click on a feature but still allow the events associated with the popup, like selecting and highlighting the feature, to occur. We have a sample in the help called Popup content in side panel that shows this behavior.
If you'd like to change the popup's highlight symbol you can do that too. Here's a simple sample that shows this:
Thanks Kelly Hutchins
Using graphic.getShape() method [Graphic | API Reference | ArcGIS API for JavaScript ] we are now able to get the size of symbol, and draw desired highlight graphic on graphicsLayer.