blob: f8365bca85a0ab92b6d40fd034522f01edac245d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// Tool used to set position on the map and let you change the view by dragging.
var PositionTool = MapTool.extend(function(base){
var exports = {
recenterCursor: false,
drag: function(e, cursor){
map.center.a = -cursor.x.magnitude()
map.center.b = cursor.y.magnitude()
},
rightclick: function(e, cursor){
cursor.quantize(1/map.zoom)
map.center.a = cursor.x.a
map.center.b = -cursor.y.a
cursor.x.b = cursor.x.a
cursor.y.b = cursor.y.a
}
}
return exports
})
|