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

2 Answers

up vote 5 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

I have same problem of above que. i have use geoexplorer application. within that the gxp.js is main javascript but i dont know that how to customize the dispaly latlong control on mappanel. In geoexplorer, the scalcombo is their. Now i want to show latlong control on to it. how ?

Pl. suggest me with code.

Thanks

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.