Compare commits

..

4 Commits

Author SHA1 Message Date
crschmidt
539df55c39 RC3 had a major bug with event handling in the MouseToolbar, introduced due
to firebug/safari-specific debug statements left in the RC. This will fix the
"Every time I drag a rectangle, it just keeps dragging" issue that users
were reporting.


git-svn-id: http://svn.openlayers.org/tags/openlayers/release-2.0-rc4@1349 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-24 05:14:46 +00:00
crschmidt
82f786c630 Restore maxZoomLevel functionality, removoed between rc1 and rc2 by Erik.
This was the *only* way of setting zoom levels up until 2.0, taking it away
in an RC release is bad. (This resolves Jeff Dege's most recent mail to the
users list.)


git-svn-id: http://svn.openlayers.org/branches/openlayers/2.0@1348 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-24 05:11:28 +00:00
crschmidt
eb783aab37 If we choose to switch to a mode via the toolbar, don't leave that mode
until we're explicitly told to. This allows users to click the zoombox
and zoom several times.


git-svn-id: http://svn.openlayers.org/branches/openlayers/2.0@1347 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-24 05:01:10 +00:00
Schuyler Erle
a668730ec1 Replicating r1345 in 2.0 branch.
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.0@1346 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
2006-08-24 04:21:27 +00:00
4 changed files with 7 additions and 6 deletions

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

View File

@@ -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.");
centered = centered.add((this.direction == "vertical" ? 0 : sz.w), (this.direction == "vertical" ? sz.h : 0));
this.switchModeTo("pan");
this.map.events.register("zoomend", this, function() { this.switchModeTo("pan"); });
return this.div;
},
@@ -105,8 +104,10 @@ OpenLayers.Control.MouseToolbar.prototype =
if (!Event.isLeftClick(evt)) return;
this.mouseDragStart = evt.xy.clone();
this.performedDrag = false;
this.startViaKeyboard = false;
if (evt.shiftKey && this.mode !="zoombox") {
this.switchModeTo("zoombox");
this.startViaKeyboard = true;
} else if (evt.altKey && this.mode !="measure") {
this.switchModeTo("measure");
} else if (!this.mode) {
@@ -239,10 +240,6 @@ OpenLayers.Control.MouseToolbar.prototype =
if (!Event.isLeftClick(evt)) return;
switch (this.mode) {
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 ||
Math.abs(this.mouseDragStart.y - evt.xy.y) > 5) {
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
@@ -260,7 +257,8 @@ OpenLayers.Control.MouseToolbar.prototype =
}
this.map.viewPortDiv.removeChild(document.getElementById("zoomBox"));
this.zoomBox = null;
this.leaveMode();
console.log(this.startViaKeyboard);
if (this.startViaKeyboard) this.leaveMode();
break;
case "pan":
if (this.performedDrag) {

View File

@@ -182,6 +182,9 @@ OpenLayers.Layer.prototype = {
'minExtent', 'maxExtent',
'numZoomLevels'
);
if (this.map.maxZoomLevel && !this.numZoomLevels) {
this.numZoomLevels = this.map.maxZoomLevel + 1;
}
for(var i=0; i < properties.length; i++) {
if (this[properties[i]] == null) {
this[properties[i]] = this.map[properties[i]];