Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ba42a3a1b5 | |||
| 739b821570 | |||
| 82f786c630 | |||
| eb783aab37 | |||
| a668730ec1 |
Binary file not shown.
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 1.2 KiB |
@@ -48,7 +48,6 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
this._addButton("pan", "panning-hand-off.png", "panning-hand-on.png", centered, sz, "Drag the map to pan.");
|
this._addButton("pan", "panning-hand-off.png", "panning-hand-on.png", centered, sz, "Drag the map to pan.");
|
||||||
centered = centered.add((this.direction == "vertical" ? 0 : sz.w), (this.direction == "vertical" ? sz.h : 0));
|
centered = centered.add((this.direction == "vertical" ? 0 : sz.w), (this.direction == "vertical" ? sz.h : 0));
|
||||||
this.switchModeTo("pan");
|
this.switchModeTo("pan");
|
||||||
this.map.events.register("zoomend", this, function() { this.switchModeTo("pan"); });
|
|
||||||
return this.div;
|
return this.div;
|
||||||
|
|
||||||
},
|
},
|
||||||
@@ -105,8 +104,10 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
if (!Event.isLeftClick(evt)) return;
|
if (!Event.isLeftClick(evt)) return;
|
||||||
this.mouseDragStart = evt.xy.clone();
|
this.mouseDragStart = evt.xy.clone();
|
||||||
this.performedDrag = false;
|
this.performedDrag = false;
|
||||||
|
this.startViaKeyboard = false;
|
||||||
if (evt.shiftKey && this.mode !="zoombox") {
|
if (evt.shiftKey && this.mode !="zoombox") {
|
||||||
this.switchModeTo("zoombox");
|
this.switchModeTo("zoombox");
|
||||||
|
this.startViaKeyboard = true;
|
||||||
} else if (evt.altKey && this.mode !="measure") {
|
} else if (evt.altKey && this.mode !="measure") {
|
||||||
this.switchModeTo("measure");
|
this.switchModeTo("measure");
|
||||||
} else if (!this.mode) {
|
} else if (!this.mode) {
|
||||||
@@ -239,10 +240,6 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
if (!Event.isLeftClick(evt)) return;
|
if (!Event.isLeftClick(evt)) return;
|
||||||
switch (this.mode) {
|
switch (this.mode) {
|
||||||
case "zoombox":
|
case "zoombox":
|
||||||
console.log(this.mouseDragStart, evt.xy);
|
|
||||||
console.log(Math.abs(this.mouseDragStart.x - evt.xy.x) > 5 || Math.abs((this.mouseDragStart.y - evt.xy.y)) > 5);
|
|
||||||
console.log(Math.abs(this.mouseDragStart.x-evt.xy.x) > 5);
|
|
||||||
console.log(Math.abs(this.mouseDragStart.y-evt.xy.y)>5);
|
|
||||||
if (Math.abs(this.mouseDragStart.x - evt.xy.x) > 5 ||
|
if (Math.abs(this.mouseDragStart.x - evt.xy.x) > 5 ||
|
||||||
Math.abs(this.mouseDragStart.y - evt.xy.y) > 5) {
|
Math.abs(this.mouseDragStart.y - evt.xy.y) > 5) {
|
||||||
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
|
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
|
||||||
@@ -260,7 +257,7 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
}
|
}
|
||||||
this.map.viewPortDiv.removeChild(document.getElementById("zoomBox"));
|
this.map.viewPortDiv.removeChild(document.getElementById("zoomBox"));
|
||||||
this.zoomBox = null;
|
this.zoomBox = null;
|
||||||
this.leaveMode();
|
if (this.startViaKeyboard) this.leaveMode();
|
||||||
break;
|
break;
|
||||||
case "pan":
|
case "pan":
|
||||||
if (this.performedDrag) {
|
if (this.performedDrag) {
|
||||||
|
|||||||
@@ -182,6 +182,9 @@ OpenLayers.Layer.prototype = {
|
|||||||
'minExtent', 'maxExtent',
|
'minExtent', 'maxExtent',
|
||||||
'numZoomLevels'
|
'numZoomLevels'
|
||||||
);
|
);
|
||||||
|
if (this.map.maxZoomLevel && !this.numZoomLevels) {
|
||||||
|
this.numZoomLevels = this.map.maxZoomLevel + 1;
|
||||||
|
}
|
||||||
for(var i=0; i < properties.length; i++) {
|
for(var i=0; i < properties.length; i++) {
|
||||||
if (this[properties[i]] == null) {
|
if (this[properties[i]] == null) {
|
||||||
this[properties[i]] = this.map[properties[i]];
|
this[properties[i]] = this.map[properties[i]];
|
||||||
|
|||||||
Reference in New Issue
Block a user