MGRS Widget for Flex Viewer

5993
47
Jump to solution
02-15-2012 08:37 PM
MarcGraham
Occasional Contributor
Hi,

Has anyone got a compiled widget for the Flex Viewer that returns the current cursor location as an MGRS grid?

It would be great if it worked with multiple coordinate systems.

regards,

Marc
Tags (2)
0 Kudos
47 Replies
MarcGraham
Occasional Contributor
Marc,

Sorry for the delay in responding been a bit tied up in work, hopefully the attached zip will answer your questions

Regards

Anthony

PS. Please don't forget to mark post as answered

[ATTACH=CONFIG]12348[/ATTACH]


Thanks so much Tony.  I really appreciate you taking your time to help myself, and everybody else who uses USNG/MGRS.  I think that this will prove to be very popular.

However, there appears to be a small bug in the Coordinate Widget, it seems to return an incorrect grid.  The MGRS Widget works correctly. 

Also, do you know if there is a way to clear the red square once you have entered a grid using the MGRS Widget?

Thanks again,

Marc
0 Kudos
AnthonyGiles
Frequent Contributor
Marc,

Sorry didnt realise that the clear button was not in the MGRS tool, new .swf file with it included.

I'm not sure what is happening with the coordinate tool not showing the right grid in your application, as I have checked my side and it appears ok. The grid given in the coordinate widget matches that in the MGRS widget and they are both the same as the base mapping in ArcMap.

Just to be sure are you using WGS 1984 Web Mercator as your projection in ArcMap, it should read as srs 102113 in the rest end point. Other than that I'm lost,

Regards

Anthony
0 Kudos
MarcGraham
Occasional Contributor
Thanks for adding that clear button, that's brilliant.

I think that I wasn't clear in my last message.  The MGRS Grid readout in the coordinate bar is correct, as are the lat/long, map x,y etc.  It is the Go To MGRS box in the bottom right that is giving me issues.  No matter what grid I enter it sends me to lat/long 0,0.

My map is in WKID 102100 (3857) which as far as I can tell is equivalent to 10213 as discussed here:

http://forums.arcgis.com/threads/8762-WGS-1984-Web-Mercator-(Auxiliary-Sphere)-WKID-102100

I don't s'pose there is any chance you could adapt that right click/copy widget to this format as well.

Thanks heaps.

Marc
0 Kudos
AnthonyGiles
Frequent Contributor
Marc,

Just checked the code and realised that I had an error, attached is new zip file for the coordinate widget.

Not sure what you mean by 'adapt the right click/copy widget to this format as well' this should be included in the zip file posted 03-01-2012, 01:28 AM. The config file allows you to set any coordinate system.

Regards

Anthony
0 Kudos
MarcGraham
Occasional Contributor
Thanks heaps for that fix.

Not sure what you mean by 'adapt the right click/copy widget to this format as well' this should be included in the zip file posted 03-01-2012, 01:28 AM. The config file allows you to set any coordinate system.


What I meant was, the right click - copy coordinate menu tool only works for MGRS when the map is in WGS84, not Web Mercator, the same as the other tools before you modified them.

Currently, you can set output coordinate systems in the xml file and right click, copy these to the clipboard, this works great.  But if you try and right click, copy the MGRS option you added nothing gets copied.  The tool works great in WGS84 maps though.

Thanks again.

Marc
0 Kudos
AnthonyGiles
Frequent Contributor
Marc,

I have looked at it on my system and the right click copy MGRS is working as it should. Just in case we have had a mix up of files along the way somewhere I have attached a zip file containing the 3 widgets (coordinate, coordinatemenu & MGRS) that are all working on my system.

Regards

Anthony
0 Kudos
MarcGraham
Occasional Contributor
Excellent.  I don't know if I missed a download, or what happened, but I have implemented the coordinate menu widget from that last upload you provided and the copy MGRS to clipboard now works a treat.

Thank you so much for your help. 

Are you interested in developing these tools further?  I am sure that there is more functionality people could use, or tweaks to the config files to make them more user friendly to set up.

Cheers,

Marc
0 Kudos
WillHughes1
Occasional Contributor II
Anthony,

I am getting an Error Code #2036 in the MapManager popup. I am using FV2.5. BTW - The Coordinate Widget and CoordinateMenu Widgets are awesome. I don't fully understand how they can be configured but I've been looking for this functionality for a while so great work.

I did notice that the MGRS longitudinal labels are cut off at the bottom of my map. Can the placement be configured?[ATTACH=CONFIG]12505[/ATTACH] It appears that the grey footer banner is covering up the labels.

How can I make the MGRS grid be turned on by default?

Thanks.

-Will


Marc,

I have looked at it on my system and the right click copy MGRS is working as it should. Just in case we have had a mix up of files along the way somewhere I have attached a zip file containing the 3 widgets (coordinate, coordinatemenu & MGRS) that are all working on my system.

Regards

Anthony
0 Kudos
AnthonyGiles
Frequent Contributor
Will,

Error Code #2036 usually means that a path to one of your widgets is incorrect in your config file, i think flex is case sensitive so just check to make sure everything is alright. Also the two coordinate widgets are added in the UI area of your config file not the normal widget area.

As for the labels being cut off by the banner set an attribute of bottom="25" in the map element.

I will look into setting an option of have the grid enabled or disabled in the config file.

Regards

Anthony
0 Kudos
AnthonyGiles
Frequent Contributor
Will,

Find attached zip file containing coordinate widget with two extra values in the config xml that allow the Grids (MGRS and Graticule) to be set to true or false.

Will,

Error Code #2036 usually means that a path to one of your widgets is incorrect in your config file, i think flex is case sensitive so just check to make sure everything is alright. Also the two coordinate widgets are added in the UI area of your config file not the normal widget area.

As for the labels being cut off by the banner set an attribute of bottom="25" in the map element.

I will look into setting an option of have the grid enabled or disabled in the config file.



Regards

Anthony
0 Kudos