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:
parent
da109c9e6b
commit
d97d3f76a6
8 changed files with 12 additions and 7 deletions
|
@ -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})
|
||||
],
|
||||
|
|
|
@ -898,7 +898,7 @@ p#contributorGuidance {
|
|||
display: none;
|
||||
}
|
||||
|
||||
.user_map .olControlPanZoom {
|
||||
.user_map .olControlZoom {
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,6 @@
|
|||
|
||||
/* Rules for OpenLayers maps */
|
||||
|
||||
.olControlPanZoom {
|
||||
.olControlZoom {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
display: none;
|
||||
}
|
||||
|
||||
.olControlPanZoom {
|
||||
.olControlZoom {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
]
|
||||
});
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
// -->
|
||||
|
|
6
vendor/assets/openlayers/OpenLayers.js
vendored
6
vendor/assets/openlayers/OpenLayers.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue