Permalink
Browse files

Removing latlngtooltip from wax

  • Loading branch information...
1 parent c6e2bfb commit 35d77578a277388a8ed64c53c305b6ef2a8b6294 @tristen tristen committed Jul 10, 2012
@@ -1,69 +0,0 @@
-wax = wax || {};
-wax.mm = wax.mm || {};
-
-wax.mm.latlngtooltip = function(map) {
- var tt, // tooltip
- _down = false,
- latlng = {};
-
- function getMousePoint(e) {
- // start with just the mouse (x, y)
- var point = new MM.Point(e.clientX, e.clientY);
- // correct for scrolled document
- point.x += document.body.scrollLeft + document.documentElement.scrollLeft;
- point.y += document.body.scrollTop + document.documentElement.scrollTop;
-
- // correct for nested offsets in DOM
- for (var node = map.parent; node; node = node.offsetParent) {
- point.x -= node.offsetLeft;
- point.y -= node.offsetTop;
- }
- return point;
- }
-
- function onDown(e) {
- console.log('here');
- _down = true;
- }
-
- function onUp(e) {
- _down = false;
- }
-
- function onMove(e) {
- if (!e.shiftKey || _down) {
- if (tt.parentNode === map.parent) {
- map.parent.removeChild(tt);
- }
- return;
- }
-
- var pt = getMousePoint(e),
- ll = map.pointLocation(pt),
- fmt = ll.lat.toFixed(2) + ', ' + ll.lon.toFixed(2);
-
- tt.innerHTML = fmt;
- pt.scale = pt.width = pt.height = 1;
- pt.x += 10;
- MM.moveElement(tt, pt);
- map.parent.appendChild(tt);
- }
-
- latlng.add = function() {
- MM.addEvent(map.parent, 'mousemove', onMove);
- MM.addEvent(map.parent, 'mousedown', onDown);
- MM.addEvent(map.parent, 'mouseup', onUp);
- tt = document.createElement('div');
- tt.className = 'map-latlngtooltip';
- return this;
- };
-
- latlng.remove = function() {
- MM.removeEvent(map.parent, 'mousemove', onMove);
- MM.removeEvent(map.parent, 'mousedown', onDown);
- MM.removeEvent(map.parent, 'mouseup', onUp);
- return this;
- };
-
- return latlng.add();
-};
View
@@ -1,4 +1,4 @@
-/* wax - 7.0.0dev - v6.0.4-37-gbaf9ab1 */
+/* wax - 7.0.0dev - v6.0.4-38-gc6e2bfb */
!function (name, context, definition) {
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,4 +1,4 @@
-/* wax - 7.0.0dev - v6.0.4-37-gbaf9ab1 */
+/* wax - 7.0.0dev - v6.0.4-38-gc6e2bfb */
!function (name, context, definition) {
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,4 +1,4 @@
-/* wax - 7.0.0dev - v6.0.4-37-gbaf9ab1 */
+/* wax - 7.0.0dev - v6.0.4-38-gc6e2bfb */
!function (name, context, definition) {
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,4 +1,4 @@
-/* wax - 7.0.0dev - v6.0.4-37-gbaf9ab1 */
+/* wax - 7.0.0dev - v6.0.4-38-gc6e2bfb */
!function (name, context, definition) {
@@ -3577,75 +3577,6 @@ wax.mm.interaction = function() {
wax = wax || {};
wax.mm = wax.mm || {};
-wax.mm.latlngtooltip = function(map) {
- var tt, // tooltip
- _down = false,
- latlng = {};
-
- function getMousePoint(e) {
- // start with just the mouse (x, y)
- var point = new MM.Point(e.clientX, e.clientY);
- // correct for scrolled document
- point.x += document.body.scrollLeft + document.documentElement.scrollLeft;
- point.y += document.body.scrollTop + document.documentElement.scrollTop;
-
- // correct for nested offsets in DOM
- for (var node = map.parent; node; node = node.offsetParent) {
- point.x -= node.offsetLeft;
- point.y -= node.offsetTop;
- }
- return point;
- }
-
- function onDown(e) {
- console.log('here');
- _down = true;
- }
-
- function onUp(e) {
- _down = false;
- }
-
- function onMove(e) {
- if (!e.shiftKey || _down) {
- if (tt.parentNode === map.parent) {
- map.parent.removeChild(tt);
- }
- return;
- }
-
- var pt = getMousePoint(e),
- ll = map.pointLocation(pt),
- fmt = ll.lat.toFixed(2) + ', ' + ll.lon.toFixed(2);
-
- tt.innerHTML = fmt;
- pt.scale = pt.width = pt.height = 1;
- pt.x += 10;
- MM.moveElement(tt, pt);
- map.parent.appendChild(tt);
- }
-
- latlng.add = function() {
- MM.addEvent(map.parent, 'mousemove', onMove);
- MM.addEvent(map.parent, 'mousedown', onDown);
- MM.addEvent(map.parent, 'mouseup', onUp);
- tt = document.createElement('div');
- tt.className = 'map-latlngtooltip';
- return this;
- };
-
- latlng.remove = function() {
- MM.removeEvent(map.parent, 'mousemove', onMove);
- MM.removeEvent(map.parent, 'mousedown', onDown);
- MM.removeEvent(map.parent, 'mouseup', onUp);
- return this;
- };
-
- return latlng.add();
-};
-wax = wax || {};
-wax.mm = wax.mm || {};
-
wax.mm.legend = function(map, tilejson) {
tilejson = tilejson || {};
var l, // parent legend
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,4 +1,4 @@
-/* wax - 7.0.0dev - v6.0.4-37-gbaf9ab1 */
+/* wax - 7.0.0dev - v6.0.4-38-gc6e2bfb */
!function (name, context, definition) {
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -1,4 +1,4 @@
-/* wax - 7.0.0dev - v6.0.4-37-gbaf9ab1 */
+/* wax - 7.0.0dev - v6.0.4-38-gc6e2bfb */
!function (name, context, definition) {
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -186,11 +186,3 @@
bottom:4px;
background:transparent;
}
-
-.map-latlngtooltip {
- position:absolute;
- background:#caedf4;
- padding:3px;
- border:1px solid #75c1d0;
- border-radius:3px;
- }

0 comments on commit 35d7757

Please sign in to comment.