Replace PanZoom control with Zoom control for small maps

In OpenLayers 2.12 the event handling of PanZoom and PanZoomBar clashes
with the result that the zoom level changes by two steps every time one
of the zoom buttons is pressed. Using the Zoom control fixes this issue.
This commit is contained in:
Sarah Hoffmann 2012-07-14 16:57:58 +02:00 committed by Tom Hughes
parent da109c9e6b
commit d97d3f76a6
8 changed files with 12 additions and 7 deletions

View file

@ -13,7 +13,7 @@ function createMap(divName, options) {
new OpenLayers.Control.Attribution(),
new SimpleLayerSwitcher(),
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.PanZoom(),
new OpenLayers.Control.Zoom(),
new OpenLayers.Control.PanZoomBar(),
new OpenLayers.Control.ScaleLine({geodesic: true})
],

View file

@ -898,7 +898,7 @@ p#contributorGuidance {
display: none;
}
.user_map .olControlPanZoom {
.user_map .olControlZoom {
display: block;
}

View file

@ -14,6 +14,6 @@
/* Rules for OpenLayers maps */
.olControlPanZoom {
.olControlZoom {
display: none;
}

View file

@ -26,7 +26,7 @@
display: none;
}
.olControlPanZoom {
.olControlZoom {
display: none;
}

View file

@ -41,7 +41,7 @@
var map = createMap("changeset_list_map", {
controls: [
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.PanZoom(),
new OpenLayers.Control.Zoom(),
new OpenLayers.Control.PanZoomBar()
]
});

View file

@ -10,6 +10,7 @@ OpenLayers/Control/DrawFeature.js
OpenLayers/Control/LayerSwitcher.js
OpenLayers/Control/Navigation.js
OpenLayers/Control/PanZoomBar.js
OpenLayers/Control/Zoom.js
OpenLayers/Control/PinchZoom.js
OpenLayers/Control/ScaleLine.js
OpenLayers/Control/SelectFeature.js

View file

@ -94,7 +94,7 @@
if (size.h > 320) {
map.addControl(new OpenLayers.Control.PanZoomBar());
} else {
map.addControl(new OpenLayers.Control.PanZoom());
map.addControl(new OpenLayers.Control.Zoom());
}
}
// -->

File diff suppressed because one or more lines are too long