import com.esri.ags.tools.DrawTool; import com.esri.ags.events.DrawEvent; import com.esri.ags.geometry.MapPoint; private function activateDrawTool(event:MouseEvent):void { addSharedData("Deactivate_DrawTool", null); // to be able to deactivate drawTool on other widgets setMapAction(DrawTool.MAPPOINT, "My tool that does something", new SimpleMarkerSymbol("circle",12,0x0000ff,0.8), DrawEnd); } private function DrawEnd(event:DrawEvent):void { //deactivates the drawTool event.target.deactivate(); var geom:Geometry = event.graphic.geometry; //If you want to persist the point on the map var gra:Graphic = new Graphic(geom, new SimpleMarkerSymbol("circle",12,0x0000ff,0.8)); graphicsLayer.add(gra); //snippet of code from the smaple query.geometry = geom; queryTask.execute(query); }
Is there a way to programmatically mimic the action of a user clicking a search result so the map is zoomed to the result?
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.