Hiding coordinates in ArcGIS Server

Another question I was asked lately is how one can hide the coordinates in the ArcGIS Server web mapping application. These coordinates are seen in the lower left part of the web browser window. These values are drawn by using standard client side JavaScript code and their appearance can be easily managed by the end user.

Navigate to the web application (for example, C:\Inetpub\wwwroot\GISApp\) folder and then open JavaScript folder. There are several files out there, but we are only going to need WebMapApp.js. Here one can define the properties of the web page events, handle sessions, and do many other things. In order to make the coordinate values hidden when moving the mouse cursor over the map, open this JavaScript file by using any text editor and find the MapCoordsMouseMove function. Then comment or delete the rows related to this function. The same thing you will have to do for the method which is called in the code row “map.add_mouseMove(MapCoordsMouseMove)”. After commenting those rows, the code should look like this.

// map.add_mouseMove(MapCoordsMouseMove);
//function MapCoordsMouseMove(sender, args) {
//    var coords = args.coordinate;
//  var coordsSeparator = (webMapAppDecimalDelimiter == ",") ? "  " : ", ";
// var roundFactor = Math.pow(10, arcgisWebApp.CoordsDecimals);
//    var xstring = (Math.round(coords.get_x() * roundFactor) / roundFactor).toString();
//    var ystring = (Math.round(coords.get_y() * roundFactor) / roundFactor).toString();
//    if (webMapAppDecimalDelimiter == ",") {
//       xstring = xstring.replace(/\./g, webMapAppDecimalDelimiter);
//      ystring = ystring.replace(/\./g, webMapAppDecimalDelimiter);
//    }
//  window.status = xstring + coordsSeparator + ystring;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s