Hi Dilson,
Thanks for the reply. We never had good luck with 10.6 on our developer site, so we kept AGS 10.4 on the production server. Also, many Flex tools didn’t work with Flex 3.7, so we have stuck with 3.6.
I’m thinking I have an outdated version of the widget and am trying to secure another copy from Drew.
Thanks.
DB
I’m sorry, but I cannot give you a link to our site.
I’m beginning to think I am not using the latest version. Can you send me a link to the latest compiled version?
Did I read somewhere that the Projector.as file was updated along the way?
Thanks,
Diane
I'm using FlexViewer 3.7 with 10.6.1. The compiled version is still working fine for me, at least for these CS's:
<SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>coordinateSystems</SPAN><SPAN class="punctuation token">></SPAN></SPAN> <SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>coordinateSystem</SPAN> <SPAN class="attr-name token">name</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>NAD 1983 UTM Zone 17<SPAN class="punctuation token">"</SPAN></SPAN> <SPAN class="attr-name token">wkid</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>26917<SPAN class="punctuation token">"</SPAN></SPAN> <SPAN class="attr-name token">decimals</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>4<SPAN class="punctuation token">"</SPAN></SPAN><SPAN class="punctuation token">/></SPAN></SPAN> <SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>coordinateSystem</SPAN> <SPAN class="attr-name token">name</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>NAD 1927 UTM Zone 17<SPAN class="punctuation token">"</SPAN></SPAN> <SPAN class="attr-name token">wkid</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>26717<SPAN class="punctuation token">"</SPAN></SPAN> <SPAN class="attr-name token">decimals</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>4<SPAN class="punctuation token">"</SPAN></SPAN><SPAN class="punctuation token">/></SPAN></SPAN> <SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>coordinateSystem</SPAN> <SPAN class="attr-name token">name</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>World Mercator<SPAN class="punctuation token">"</SPAN></SPAN> <SPAN class="attr-name token">wkid</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>54004<SPAN class="punctuation token">"</SPAN></SPAN> <SPAN class="attr-name token">decimals</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>4<SPAN class="punctuation token">"</SPAN></SPAN><SPAN class="punctuation token">/></SPAN></SPAN> <SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"><</SPAN>coordinateSystem</SPAN> <SPAN class="attr-name token">name</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>GCS WGS 1984 (Decimal Degrees)<SPAN class="punctuation token">"</SPAN></SPAN> <SPAN class="attr-name token">wkid</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN>4326<SPAN class="punctuation token">"</SPAN></SPAN> <SPAN class="attr-name token">decimals</SPAN><SPAN class="attr-value token"><SPAN class="punctuation token">=</SPAN><SPAN class="punctuation token">"</SPAN><SPAN class="punctuation token">"</SPAN></SPAN><SPAN class="punctuation token">/></SPAN></SPAN> <SPAN class="token tag"><SPAN class="token tag"><SPAN class="punctuation token"></</SPAN>coordinateSystems</SPAN><SPAN class="punctuation token">></SPAN></SPAN> <SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
R_
Hello @Diane,
My widget was working fine with Flex 3.6 and AGS 10.2 for a long time. But then, when we updated to AGS 10.6 I started to have this error messagem. My guessing is that something in the ESRI library must had changed.
Good Luck,
DK
Hello,
Sorry, i don't even have Flash Building installed on my computer anymore to support this. The tech is just too old.
The only way I can help is if you can provide me a public link to the site and I can try and see what is going on.
Drew
This is a great tool, when it works! I am running Flex 3.6 on my server. Every time I try to deploy this widget, I get "Error projecting coordinates" when I try to project to another coordinate system. The rest of the XY tools in the widget work fine. It works in the Flash Builder app, but will not activate properly in a production viewer. I have also attempted using the compiled version directly into my viewer without success. What am I missing?
So what is the end result... Is is functioning as expected now?
See step 1 in my post above....
'import com.esri.ags.tasks.supportClasses.DatumTransform;'
Hi Andrew, thanks for your prompt reply. I've read that, but when i try to add the following:
public var datumTransform:DatumTransform;
A got the error message "1046: Type was not found or was not a compile-time constant:". Maybe I'm missing to import some library.
Dilson
Some general steps..
Import the class at the top of the file
STEP 1
import com.esri.ags.tasks.supportClasses.DatumTransform;
STEP 2
Locate the following line
var projectParamaters:ProjectParameters = new ProjectParameters();
STEP 3
Add the new code below the line above
var datumTransform:DatumTransform = new DatumTransform(); datumTransform.wkid=1327; projectParamaters.datumTransform = datumTransform;
STEP 4
Test.
Like i said, I don't even have Flex installed. Play around and see what you can do.
Dilson... Lets try a few things.
I think it can be done... But I don't even have Flex Builder installed anymore to help much.
If we look at the "ProjectParameters" object I see it accepts a datumTransformation
Try adding that ..
I would like to hardcode the cod below to use the Datum transformation with WKID 1327. But I don't know exactly how do to it. This code is part of Coord Menu Widget
It's not getting the transformation parameters from geometry service.
#
package widgets.CoordinateMenu
{
import com.esri.ags.SpatialReference;
import com.esri.ags.events.GeometryServiceEvent;
import com.esri.ags.geometry.MapPoint;
import com.esri.ags.tasks.GeometryService;
import com.esri.ags.tasks.supportClasses.ProjectParameters;
import mx.controls.Alert;
import mx.rpc.events.FaultEvent;
public class Projector
public var geometryServiceURL:String;
public var geometryService:GeometryService;
public function Projector(geomServiceURL:String)
this.geometryServiceURL = geomServiceURL;
}
public function projectPoint(mapPoint:MapPoint, toWKID:Number, callbackFunction:Function, errorFunction:Function = null😞void
this.geometryService = new GeometryService(this.geometryServiceURL);
this.geometryService.addEventListener(GeometryServiceEvent.PROJECT_COMPLETE, callbackFunction);
if (errorFunction != null)
this.geometryService.addEventListener(FaultEvent.FAULT, errorFunction);
else
this.geometryService.addEventListener(FaultEvent.FAULT, function():void
Alert.show("Error projecting coordinates.","Error");
});
projectParamaters.outSpatialReference =new SpatialReference(toWKID);
projectParamaters.geometries = [mapPoint];
this.geometryService.project(projectParamaters);
//var outSpatialReference:SpatialReference = new SpatialReference(toWKID);
//this.geometryService.project([mapPoint],outSpatialReference);
Hello All,
I know that this topic it's a bit old, but i found this widget very useful. I'm working with compiled and uncompiled version and I have an issue. My application based on Flex 3.6 is in the projected CRS 22033 (Camacupa projected). I'm trying to display coordinates in WGS84 (4326). But when you see the results I figure it out that the coordinates are being converted to another CRS which is 4220 (Camacupa Geographic). There is anyway to set the transformation parameters in the source code? with a specific wkid transformation?
Thanks in advance,
Is this widget available for Flex Viewer 3.2? If not then will the 3.1 version work with it?Thanks!
hi can you teach me how to add RSO Kertau projection into this widget.....
Hello Everyone,I created a new widget that you might find useful.Tucked away in the map context menu are three XY operations 1. Copy XY 2. Project XY (configurable) 3. Go To XYReadMe.txt includedHope you find it useful!Click Here to demo and download the Coordinate Menu WidgetDrew
Does no one have a solution for this issue? Help!
Hi Drew,I've got a bit of a predicament. I'm using a base map of the Antarctic in the Universal Polar Stereographic South projection (wkid="32761"), is there a way to show the "Selected Coordinates" box in decimal degrees (lat/long) instead of meters? I don't mind the "Live Coordinates" being in meters.Thanks!Cheer,Hakim
I finally figured out to just give up on wanting any Bing imagery in there if you want things to work correctly. OR, convert you map to mercator and live with it.As far as I have found, you can't load a Bing layer (VETiledlayer) as type dynamic, so will NEVER re-project on the fly to "my" data coordinate system. I have tested with loading the Bing service into ArcMap document, and publish as a service on my server with my coodinate system. It "works", but not very fast (reprojecting a service of a service), and probably violates one or more of the useage agreements.Anyway, I gave up on Bing maps becase of this. In fact, by looking at your attachment, it appears as if you have it working correctly if you drop the Bing layers.Your "chart" says you have loaded Bing maps as dynamic. Did you actually find a way to do this, or are you just putting type="dynamic" in the layer tag and hoping/thinking it is actually being loaded this way. Last I knew this was not possible.So, if you load your layer first, it will set the wkid to the wkid of that layer. All other layers in the SAME coordinate system can be loaded as tiled(or dynamic) (as long as the tiling scheme is identical), any other services in "another" wkid will have to be loaded as dynamic. So, that does not leave an option to utilize Bing (tiled only AFAIK) unless you switch your map to mercator, then that is the live coordinates you will get.R_
Hi there - My maps are also in StatePlane and the widget works using WGS84 decimal degrees wkid = 4326. Are you using 10.1. I remember seeing something about updating the geometry service referenced in the .xml to a 10.1 service, if so. Don't know if that has anything to do with it.... ;-/R - thanks for the input! Will try out your suggestions. Glad I'm not the only one chicken pecking through this. Thanks!
The widget seems to work fine with map in State Plane Wa South, NAD83 meters.R_
It's weird... If someone can give any idea...This widget (GoTo) only work if the map is in webmercator? Any ideas? Thanks!
Hi Rhett - I've been plugging along to get the 'Go to XY' widget working as a standalone. I'm slowly learning as I go, but running into a small issue. Once I launch the "widget" and then close it, the widget 1. doesn't lose focus in the widget panel (ie: the white underline is still below the icon), and 2. it won't re-open. See the on close attachment. Do you know of a quick function/command/something-er-rather to add to the s:TitleWindow to get it to reset? It only resets if I re-launch the applicaiton. Many thanks, Meg
protected function widgetConfigLoadedHandler(event:Event):void { if (configXML) { //Set Helper this.helper = new CoordinateMenuWidgetHelper(configXML,map); // Map mouse move event handler - captures XY this.map.addEventListener(MouseEvent.MOUSE_MOVE, onMapMouseMove); //Hide ESRI About Menu Items hideESRIMenuItems(); // Load context Menu items. createContextMenu(); } else { //Show error if XML fails. Alert.show("There was an error loading the widget configuration XML file ( CopyXY Widget )"); return; } \\My Add this.goToCoordinates.show(configXML,this.map); }
Brilliant! Drew thank you so much. Two quick questions (hopefully): 1. Is there a way to have the "Go to Coordinates" window preload when the application starts instead of 'Live Coordinates'? Can I just copy the widget and comment out everything but the 'Go to Coordinates' functionality? Many thanks, again!
<viewer:WidgetTemplate open="{this.graphicsLayer.visible = true; }" closed="{this.graphicsLayer.visible = false; }" id="wTemplate" width="400" height="235" visible="false">
private function init():void { //Set Helper this.helper = new CoordinateMenuWidgetHelper(configXML,map); //SET Mouse Event Handlers this.map.addEventListener(MouseEvent.MOUSE_MOVE, onMapMouseMove); this.map.addEventListener(MouseEvent.CLICK, onMapMouseClick); //Add GraphicsLayer to map this.graphicsLayer.symbol = new SimpleMarkerSymbol("circle",10,0xFF0000);; this.map.addLayer(this.graphicsLayer); // add additional contex menu for projected coords. if (this.helper.coordinateSystems.length == 0) { btnProject.visible = false; btnProject.includeInLayout = false; } goToCoordinate.show(configXML,map); }
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.