Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to be able to display the X/Y coordinates of the user's current mouse cursor location such as with this web map.

I'm using the .NET Web ADF, C# and ArcGIS Server.

Can anyone suggest any code samples for this?

share|improve this question
Which web client/API are you using? – blah238 Oct 20 '12 at 14:34
i'm using .net ADF – wetland Oct 20 '12 at 14:57
(-) At least read the docs on Please help yourself. Otherwise, why should we help you? – R.K. Oct 20 '12 at 17:37
up vote 2 down vote accepted

The Common Custom JavaScript sample in the Web ADF 10 SDK Help has an example of updating the browser status bar with the current mouse cursor coordinates. See Default.aspx for the JavaScript implementation.

In the initialize() function:

// Show map coordinates in status bar based on cursor location

A bit further down:

// Show map coordinates in status bar associated with cursor location
function mouseMove(sender,eventArgs) {
    window.status = sender.get_id() + ': ' + 
      eventArgs.coordinate.get_x().toFixed(3) + ', ' + 
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.