English

FAQ: Does the IMSMap.zoomToSelection method highlight the selected feature?

Question

Does the IMSMap.zoomToSelection method highlight the selected feature?

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);