<map initialExtent="-122.2 24.89 -70.59 46.92" fullExtent="-150 -50 150 50"> <basemaps menu="menuMap"> <mapservice label="Street Map" type="tiled" visible="true" alpha="1" icon="com/esri/solutions/flexviewer/assets/images/icons/i_highway.png">http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer</mapservice> <mapservice label="Satellite Map" type="tiled" visible="false" alpha="1" icon="com/esri/solutions/flexviewer/assets/images/icons/i_shuttle.png">http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer</mapservice> </basemaps> <livemaps> <mapservice label="CST Team Information" type="dynamic" visible="true" alpha="1.0">http://214.3.33.103/ArcGIS/rest/services/cstsec_loc/MapServer</mapservice> </livemaps> </map>
private function locateCoordinates():void { graphicsLayer.clear(); WidgetEffects.flipWidget(this, viewStack, "selectedIndex", 2, 400); try { var long:String = txtLong.text; var lat:String = txtLat.text; if ((long) && (lat)) { var point:MapPoint = new MapPoint(Number(long), Number(lat)); var wmPnt:MapPoint = WebMercatorUtil.geographicToWebMercator(point,true) as MapPoint; var icon:String = widgetIcon; var title:String = coordinatesLabel; var content:String = long.toString() + ", " + lat.toString(); var link:String = ""; var infoData:Object = { icon: icon, title: title, content: content, link: link, point: wmPnt, geometry: wmPnt }; var recAC:ArrayCollection = new ArrayCollection([infoData]); wRepeater.dataProvider = recAC; this.addSharedData(widgetTitle, recAC); showLocation(infoData); showMessage(locationsLabel, false); } } catch (error:Error) { showMessage(error.message, false); } }
import com.esri.ags.utils.WebMercatorUtil;
const nMPnt:MapPoint = WebMercatorUtil.webMercatorToGeographic(mapPoint,false) as MapPoint;
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.