Permalink
Browse files

Added MousePosition to mapview

  • Loading branch information...
1 parent 6c21c06 commit 53368be53268b001223baf5ac477e3080578078a @sylvainbeo sylvainbeo committed Apr 13, 2012
Showing with 25 additions and 1 deletion.
  1. +18 −1 app/static/script/app/GeoExplorer.js
  2. +6 −0 app/static/theme/app/geoexplorer.css
  3. +1 −0 buildjs.cfg
@@ -668,6 +668,22 @@ var GeoExplorer = Ext.extend(gxp.Viewer, {
border: false
});
+ var mousePositionWrapper = new Ext.Panel({
+ cls: 'overlay-element overlay-mouseposition',
+ border: false
+ });
+ mousePositionWrapper.on('render', function(){
+ var mousePosition = new OpenLayers.Control.MousePosition({
+ "numDigits": 3,
+ displayProjection: new OpenLayers.Projection("EPSG:4326"),
+ div: mousePositionWrapper.getEl().dom
+ });
+
+ this.mapPanel.map.addControl(mousePosition);
+ }, this);
+
+
+
this.on("ready", function() {
var zoomStore = new GeoExt.data.ScaleStore({
map: this.mapPanel.map
@@ -723,7 +739,8 @@ var GeoExplorer = Ext.extend(gxp.Viewer, {
cls: 'map-overlay',
items: [
scaleLinePanel,
- zoomSelectorWrapper
+ zoomSelectorWrapper,
+ mousePositionWrapper
]
});
@@ -381,3 +381,9 @@ float:right;
.olLayerGoogleV3.olLayerGooglePoweredBy {
bottom: 2em !important;
}
+
+/* Mouse position */
+.overlay-mouseposition {
+ font-size: 10px;
+ line-height: 20px;
+}
View
@@ -79,6 +79,7 @@ include =
OpenLayers/Control/NavigationHistory.js
OpenLayers/Control/WMSGetFeatureInfo.js
OpenLayers/Control/DrawFeature.js
+ OpenLayers/Control/MousePosition.js
OpenLayers/Layer/WMS.js
OpenLayers/Format/OSM.js
OpenLayers/Layer/Bing.js

0 comments on commit 53368be

Please sign in to comment.