Original User: rscheitlinThomas, OK, pretty simple. I did not expect people to enter a coordinate that was in a different projection than the map was in so when you entered a 4326 coordinate it stayed just that and was not converted. Here is the code to change in the Locate Widget to handle the projecting of the coordinate to web mercator.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);
}
}of course don't forget to import the webmercatorutil.import com.esri.ags.utils.WebMercatorUtil;