Coordinate Menu Widget - New !

13922
95
02-17-2011 07:51 PM
Drew
by
Occasional Contributor III
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 XY

ReadMe.txt included

Hope you find it useful!

Click Here to demo and download the Coordinate Menu Widget

Drew
Tags (2)
0 Kudos
95 Replies
Drew
by
Occasional Contributor III
An invaluable tool!!  I would like to tweak this to be able to launch it from the header bar like all other widgets - would this require more work than it's worth or is this an easy task?  Thanks!


philipp,
I hope to update it soon..

Thanks for your interest
0 Kudos
TristanForward2
New Contributor
I get the following "NaN" in all boxes. Yet I still have Lat / Long being displayed in the bottom left corner of the map. I am using the geometry service that comes default with this widget, if I use my own service or another esri geometry service it says cannot find projection.... Any ideas on what is wrong.

I am using the correct WKID's for my Coordinate systems drop down. And my .mxd was projected to WGS 1984 Web Mercator (Auxiliary Sphere). 

[ATTACH=CONFIG]11603[/ATTACH]

UPDATE:

I turned off all basemaps and left only my operational layer, the tool now somewhat works. I think it has to do with my projection of my .mxd and that of ESRI basemaps. Does it Matter that I am using WGS 1984 Web Mercator (Auxiliary Sphere) instead of just WGS 1984 Web Mercator?

One other thing to note is that the Lat/Long still does not show up

[ATTACH=CONFIG]11604[/ATTACH]
0 Kudos
Drew
by
Occasional Contributor III
I get the following "NaN" in all boxes. Yet I still have Lat / Long being displayed in the bottom left corner of the map. I am using the geometry service that comes default with this widget, if I use my own service or another esri geometry service it says cannot find projection.... Any ideas on what is wrong.

I am using the correct WKID's for my Coordinate systems drop down. And my .mxd was projected to WGS 1984 Web Mercator (Auxiliary Sphere). 



[ATTACH=CONFIG]11603[/ATTACH]


Tristan,
Can you post your <coordinateSystems> XML and try the default.

   <coordinateSystems>
  <coordinateSystem name="NAD 1983 UTM Zone 17" wkid="26917" decimals="4"/>
  <coordinateSystem name="NAD 1927 UTM Zone 17" wkid="26717" decimals="4"/>
  <coordinateSystem name="World Mercator" wkid="54004" decimals="4"/>
  <coordinateSystem name="GCS WGS 1984 (Decimal Degrees)" wkid="4326" decimals=""/>
 <!-- <coordinateSystem name="GCS WGS 1984 (Decimal Degrees)" wkid="4326" decimals="2"/> -->
   </coordinateSystems>
0 Kudos
TristanForward2
New Contributor
Here is my code.
Geographic Coordinate Systems 
 http://help.arcgis.com/en/arcgisserver/10.0/apis/rest/index.html?gcs.html
    -->
   <coordinateSystems>
  <coordinateSystem name="NAD 1983 UTM Zone 10" wkid="26910" decimals="4"/>
  <coordinateSystem name="NAD 1927 UTM Zone 10" wkid="26710" decimals="4"/>
  <coordinateSystem name="Web Mercator" wkid="102101" decimals="4"/>
  <coordinateSystem name="GCS WGS 1984 (Decimal Degrees)" wkid="4326" decimals=""/>
  <coordinateSystem name="World Mercator" wkid="54004" decimals="4"/>
 <!-- <coordinateSystem name="GCS WGS 1984 (Decimal Degrees)" wkid="4326" decimals="2"/> -->
   </coordinateSystems>
   
 <!-- Zoom To Coordinate Scale -->
 <zoomScale>5000</zoomScale>

   
</configuration>


I tried the default code and still get the same problem, shows up as NaN for Lat / Long. If I turn off my operational layers, and only run the base maps, I still run into the same problem.
0 Kudos
Drew
by
Occasional Contributor III
Tristan
Is your map service(s) public for me to look at?
0 Kudos
TristanForward2
New Contributor
UPDATE:

Did a little test, maybe this will help narrow things down.

Copy Map X Y Coordinates to clipboard

Vancouver My Map
X: -53780981.811385006 Y: 6318025.736052506

Vancouver Coordinate Menu Widget
X: -13707478.753861206 Y: 6320901.449768862

Vancouver: MyMap with Operational Layer Projected in WGS 1984 Web Mercator
X: -53781471.008366026 Y: 6318514.933033532


Map Service is not public but I think you looking for this information. I noticed that the Spatial Reference is 3857 and not 102101 or 4326, issue?

VWeb (MapServer)
View In:   ArcMap   ArcGIS Explorer   ArcGIS JavaScript   Google Earth   ArcGIS.com Map

View Footprint In:   Google Earth

Service Description:

Map Name: Layers

All Layers and Tables

Layers:

    Base (0)
        Surface_Features (1)
        Seismic Line (2)
        Urban (3)
            Urban Center (4)
            Community (5)
            Towns (6)
        Water (7)
            Annotation_Water_20K (8)
                Annotation Class 1 (9)
            Annotation_Water_50K (10)
                Annotation Class 1 (11)
            Water_Line_20k (12)
            Water_Line_50k (13)
            Water_Polygon_20k (14)
            Water_Polygon_50k (15)
            Water_Line_250K (16)
            Water_Polygon_Islands_250K (17)
            Water_Polygon_2mil (18)
            Water_Line_2mil (19)
            Water_Pacfic_oc_Provincial_Shoreline (20)
        Roads (21)
            Roads x1 (22)
            Roads x2 (23)
            Roads x3 (24)
    Oil & Gas (25)
        Wellsites (26)
        Pipeline_R/W (27)
    Grids (28)
        UTM_TARGET (29)
        BCGS_Index (30)
        PNG (31)
            P&NG Group (32)
            Letter Block (33)
            Unit (34)
        Number Block (35)
        Mapsheet (36)
        District_Lots (37)
    Administrative Boundaries (38)
        Land_Use_Background (39)
        Tenure (40)
    Forestry (41)
        Cutblocks (42)

Tables:

Description:

Copyright Text:

Spatial Reference: 3857

Single Fused Map Cache: false

Intial Extent:

    XMin: -13458714.8258235
    YMin: 7595516.94052755
    XMax: -13431961.8659237
    YMax: 7606370.99854403
    Spatial Reference: 3857

Full Extent:

    XMin: -18305842.9979
    YMin: 5552185.1391
    XMax: 840681.6802
    YMax: 14793217.5532
    Spatial Reference: 3857

Units: esriMeters

Supported Image Format Types: PNG32,PNG24,PNG,JPG,DIB,TIFF,EMF,PS,PDF,GIF,SVG,SVGZ,BMP

Document Info:

    Title:
    Author:
    Comments:
    Subject:
    Category:
    Keywords:
    AntialiasingMode: None
    TextAntialiasingMode: Force

Supported Interfaces:   REST   SOAP

Supported Operations:   Export Map   Identify   Find   Generate KML
0 Kudos
TristanForward2
New Contributor
UPDATE:

I created a new flex viewer with the coordinate menu widget,

Vancouver now shows up correctly.
X: -13706323.186011488 Y: 6320134.462034756

So something is wrong with my original flex viewer, if you have any ideas of what to fix that would be great.
0 Kudos
TristanForward2
New Contributor
UPDATE:

Figured out what was effecting the coordinates...

My Extents!

<map wraparound180="true" initialextent="-57193000 5667000 -50956000 8828000" fullextent="-20000000 -20000000 20000000 20000000" top="40">

If I use the default extents that come with the flex viewer
<map wraparound180="true" initialextent="-14083000 3139000 -10879000 5458000" fullextent="-20000000 -20000000 20000000 20000000" top="40">

It works fine, use this tool to determine your extents, whatever way I did before messed it up.

http://help.arcgis.com/en/webapi/flex/samples/index.html#/Map_Extent_and_Mouse_Coordinates/01nq00000...
0 Kudos
TristanForward2
New Contributor
Ok, so some of the widget is working however still get NaN (not a number) as shown here.

Any ideas to why?

[ATTACH=CONFIG]11615[/ATTACH]
0 Kudos
Drew
by
Occasional Contributor III
UPDATE: Viewer 2.5 version now available for download.

Whats new in 2.5

  • Can be run as a traditional widget (CoordinateMenuWidget_GUI.swf) - As requested by many users. - see ReadMe.txt

  • Now includes DMS

  • Extent Grabber - Gets the map extent in a variety of formats.


- Some of you might like the new Extent Grabber (2.5 ONLY)
- Version 2.5 Demo currently not yet online

Download URL:
http://www.arcgis.com/home/item.html?id=edd4a2b7c722493a8b08f53eaa131e1e


Feedback is always welcome!

Drew
0 Kudos