Skip to content

Commit

Permalink
Removing latlngtooltip from wax
Browse files Browse the repository at this point in the history
  • Loading branch information
tristen committed Jul 10, 2012
1 parent c6e2bfb commit 35d7757
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 159 deletions.
69 changes: 0 additions & 69 deletions control/mm/latlngtooltip.js

This file was deleted.

2 changes: 1 addition & 1 deletion dist/wax.esri.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion dist/wax.esri.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/wax.g.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion dist/wax.g.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/wax.leaf.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion dist/wax.leaf.min.js

Large diffs are not rendered by default.

71 changes: 1 addition & 70 deletions dist/wax.mm.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions dist/wax.mm.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/wax.ol.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion dist/wax.ol.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/wax.p.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion dist/wax.p.min.js

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions theme/controls.css
Original file line number Diff line number Diff line change
Expand Up @@ -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.