Frequently asked question

Does the IMSMap.zoomToSelection method highlight the selected feature?

Last Published: April 25, 2020

Answer

No, it doesn't highlight the selected feature. Page 161 of the Customizing Java Viewer document is incorrect. To highlight the selected feature, follow the code examples given below:

Code:
var selSymbol = parent.mapFrame.IMSMap.createSymbol("POLYGON_SYMBOL");
var selColor = parent.mapFrame.IMSMap.createColor(255,255,0);
selSymbol.setFillColor(selColor);

Code:
var theLayer = parent.mapFrame.document.IMSMap.getLayer("States");
parent.mapFrame.document.IMSMap.setSelectedLayer(theLayer);
theLayer.setSelectionSymbol(selSymbol);

Code:
var theQuery = "STATE_NAME = 'Florida'";
parent.mapFrame.document.IMSMap.zoomToSelection(theLayer.getName(), theQuery);
theLayer.select(theQuery);

Article ID:000004376

Software:
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic