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

The title says it all. I'm using GeoExt as part of OpenGeo Suite. I would like to display the current mouse coordinates.

Update: I was getting confused as to what parts of the code are GeoExt and which parts are OpenLayers.

Here's some code. mapPanel is a GeoExt object. mapPanel.map is an OpenLayers object.

var mapPanel = new GeoExt.MapPanel({ 
    // etc.
});

mapPanel.map.addControl(new OpenLayers.Control.MousePosition());
share|improve this question

1 Answer

up vote 6 down vote accepted

As GeoExt is using OpenLayers for the map interface, you could use its MousePosition contol :

http://openlayers.org/dev/examples/mouse-position.html

share|improve this answer

Your Answer

 
discard

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.