[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 565
  • Last Modified:

Retrive Latitude and Longitude using Mouse Click

Hello All-

I'm using a ArcGIS Server Web ADF application and would like to know how to get Latitude/Longitude values using a mouse click on the map.  Is there a tool or some code I could incorporate to get a popup box showing those values using Javascript?

Please let me know.
0
JoshinHtown
Asked:
JoshinHtown
1 Solution
 
Mohamed_allabakashCommented:
0
 
JoshinHtownAuthor Commented:
This did'nt really help me any.  For one, I'm not using a DEM and I don't see where there are referencing a web application.  I simply have a web application that consumes a map service.  The map service is in UTM coordinates and I have figured out to get the UTM XY values returned by hovering the mouse over the map.  I then have a seperate Javascript function that will convert the UTM coordinates to Lat/Long.  My solution will work for the time being.   But thank you though..



<script language="javascript" type="text/javascript">
	

        // must occur immediatly, not after load
        ESRI.ADF.WebMappingApplication.WebPage.registerClass('ESRI.ADF.WebMappingApplication.WebPage');
        arcgisWebApp = new ESRI.ADF.WebMappingApplication.WebPage();
        arcgisWebApp.setPageElementSizes();

        Sys.Application.add_init(startUp);
        
        Sys.Application.add_init(initialize);
        
        

        function initialize() { 
          var map = $find('Map1');            
          map.add_mouseMove(btnToGeographic_OnClick);    //This is the function that has a series of math formulas that converts UTM to Lat/Long and displays results using Windows Status bar
          }

Open in new window

0
 
Molnar IstvánHelpDesk / ProgrammerCommented:
some example and documentation:
http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm->Reverse geocode
http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/demos/locator/locator_reverse.html[reverse geocoding-with a little modification you could get not only the address, but  the Latitude/Longitude ]

hope it helps
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now