From f219393149c511cccc9886c4c98e549f72cc058f Mon Sep 17 00:00:00 2001 From: Thomas Date: Sun, 5 May 2013 15:58:46 +0200 Subject: [PATCH] Add default CSS style for mouse position Missing CSS was confirmed with issue #680, this commit is to fix it and change ol-mouse-position class to ol-mouseposition. I choose for the moment the top right corner to display the coordinates from mouse position control because of potential conflict with the scaleline control. --- css/ol.css | 7 +++++++ examples/mouse-position.html | 6 ++++++ examples/mouse-position.js | 2 ++ src/ol/control/mousepositioncontrol.js | 2 +- 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/css/ol.css b/css/ol.css index 8763dbc6e7..4e73a667ef 100644 --- a/css/ol.css +++ b/css/ol.css @@ -81,6 +81,13 @@ a.ol-full-screen-true:after { display: inline; list-style: none; } + +.ol-mouseposition { + top: 8px; + right: 8px; + position: absolute; +} + .ol-scale-line { background: rgba(0,60,136,0.3); border-radius: 4px; diff --git a/examples/mouse-position.html b/examples/mouse-position.html index 74f85c76f1..5cdf3e36b1 100644 --- a/examples/mouse-position.html +++ b/examples/mouse-position.html @@ -8,6 +8,12 @@ Mouse position example + diff --git a/examples/mouse-position.js b/examples/mouse-position.js index 7101c327ca..dc3a2163f7 100644 --- a/examples/mouse-position.js +++ b/examples/mouse-position.js @@ -13,6 +13,8 @@ var map = new ol.Map({ new ol.control.MousePosition({ coordinateFormat: ol.coordinate.toStringHDMS, projection: 'EPSG:4326', + // comment the following line to have the mouse position + // be placed within the map. target: document.getElementById('mouse-position'), undefinedHTML: ' ' }) diff --git a/src/ol/control/mousepositioncontrol.js b/src/ol/control/mousepositioncontrol.js index 3b54a155e4..b4ce9361b9 100644 --- a/src/ol/control/mousepositioncontrol.js +++ b/src/ol/control/mousepositioncontrol.js @@ -28,7 +28,7 @@ ol.control.MousePosition = function(opt_options) { var options = goog.isDef(opt_options) ? opt_options : {}; var element = goog.dom.createDom(goog.dom.TagName.DIV, { - 'class': 'ol-mouse-position' + 'class': 'ol-mouseposition' }); goog.base(this, {