Permalink
Browse files

Prevent dragging on modern browsers and in IE.

Tested in IE9, could use testing across the board.
Fixes #58.
  • Loading branch information...
tmcw committed Dec 7, 2011
1 parent a9e6595 commit c897af650d82ff16bb86ecbcd1f90768f9859ea3
Showing with 11 additions and 3 deletions.
  1. +5 −1 modestmaps.js
  2. +1 −1 modestmaps.min.js
  3. +5 −1 src/layer.js
View
@@ -1710,7 +1710,11 @@ var MM = com.modestmaps = {
// position this tile (avoids a full draw() call):
var theCoord = this.map.coordinate.zoomTo(tile.coord.zoom);
- tile.style.position = 'absolute';
+ // Start tile positioning and prevent drag for modern browsers
+ tile.style.cssText = 'position:absolute;-webkit-user-select: none;-webkit-user-drag: none;-moz-user-drag: none;';
+
+ // Prevent drag for IE
+ tile.ondragstart = function() { return false; };
var scale = Math.pow(2, this.map.coordinate.zoom - tile.coord.zoom);
var tx = ((this.map.dimensions.x/2) +
Oops, something went wrong.

0 comments on commit c897af6

Please sign in to comment.