Merge branch 'master' of https://github.com/openlayers/openlayers
Conflicts: tests/list-tests.html
This commit is contained in:
@@ -75,6 +75,14 @@ OpenLayers.Control.KeyboardDefaults = OpenLayers.Class(OpenLayers.Control, {
|
||||
*/
|
||||
defaultKeyPress: function (evt) {
|
||||
var size, handled = true;
|
||||
|
||||
if((typeof evt.target) != 'undefined' &&
|
||||
(evt.target.tagName == 'INPUT' ||
|
||||
evt.target.tagName == 'TEXTAREA' ||
|
||||
evt.target.tagName == 'SELECT')) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch(evt.keyCode) {
|
||||
case OpenLayers.Event.KEY_LEFT:
|
||||
this.map.pan(-this.slideFactor, 0);
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
* @requires OpenLayers/Control.js
|
||||
* @requires OpenLayers/BaseTypes.js
|
||||
* @requires OpenLayers/Events/buttonclick.js
|
||||
* @requires OpenLayers/Map.js
|
||||
* @requires OpenLayers/Handler/Click.js
|
||||
* @requires OpenLayers/Handler/Drag.js
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -99,6 +99,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
|
||||
this.map.events.un({
|
||||
"changebaselayer": this.redraw,
|
||||
"updatesize": this.redraw,
|
||||
scope: this
|
||||
});
|
||||
|
||||
@@ -116,7 +117,11 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
*/
|
||||
setMap: function(map) {
|
||||
OpenLayers.Control.PanZoom.prototype.setMap.apply(this, arguments);
|
||||
this.map.events.register("changebaselayer", this, this.redraw);
|
||||
this.map.events.on({
|
||||
"changebaselayer": this.redraw,
|
||||
"updatesize": this.redraw,
|
||||
scope: this
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -189,6 +194,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
_addZoomBar:function(centered) {
|
||||
var imgLocation = OpenLayers.Util.getImageLocation("slider.png");
|
||||
var id = this.id + "_" + this.map.id;
|
||||
var minZoom = this.map.getMinZoom();
|
||||
var zoomsToEnd = this.map.getNumZoomLevels() - 1 - this.map.getZoom();
|
||||
var slider = OpenLayers.Util.createAlphaImageDiv(id,
|
||||
centered.add(-1, zoomsToEnd * this.zoomStopHeight),
|
||||
@@ -211,7 +217,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
|
||||
var sz = {
|
||||
w: this.zoomStopWidth,
|
||||
h: this.zoomStopHeight * this.map.getNumZoomLevels()
|
||||
h: this.zoomStopHeight * (this.map.getNumZoomLevels() - minZoom)
|
||||
};
|
||||
var imgLocation = OpenLayers.Util.getImageLocation("zoombar.png");
|
||||
var div = null;
|
||||
@@ -242,7 +248,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
||||
this.map.events.register("zoomend", this, this.moveZoomBar);
|
||||
|
||||
centered = centered.add(0,
|
||||
this.zoomStopHeight * this.map.getNumZoomLevels());
|
||||
this.zoomStopHeight * (this.map.getNumZoomLevels() - minZoom));
|
||||
return centered;
|
||||
},
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* full text of the license. */
|
||||
|
||||
/**
|
||||
* @requires OpenLayers/Util/vendorPrefix.js
|
||||
* @requires OpenLayers/Handler/Pinch.js
|
||||
*/
|
||||
|
||||
@@ -162,8 +163,10 @@ OpenLayers.Control.PinchZoom = OpenLayers.Class(OpenLayers.Control, {
|
||||
*/
|
||||
applyTransform: function(transform) {
|
||||
var style = this.map.layerContainerDiv.style;
|
||||
style['-webkit-transform'] = transform;
|
||||
style['-moz-transform'] = transform;
|
||||
var transformProperty = OpenLayers.Util.vendorPrefix.style("transform");
|
||||
if (transformProperty) {
|
||||
style[transformProperty] = transform;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -124,7 +124,7 @@ OpenLayers.Control.Snapping = OpenLayers.Class(OpenLayers.Control, {
|
||||
* objects below. If the items in the targets list are vector layers
|
||||
* (instead of configuration objects), the defaults from the <defaults>
|
||||
* property will apply. The editable layer itself may be a target
|
||||
* layer - allowing newly created or edited features to be snapped to
|
||||
* layer, allowing newly created or edited features to be snapped to
|
||||
* existing features from the same layer. If no targets are provided
|
||||
* the layer given in the constructor (as <layer>) will become the
|
||||
* initial target.
|
||||
|
||||
@@ -240,7 +240,7 @@ OpenLayers.Control.Split = OpenLayers.Class(OpenLayers.Control, {
|
||||
var deactivated = OpenLayers.Control.prototype.deactivate.call(this);
|
||||
if(deactivated) {
|
||||
if(this.source && this.source.events) {
|
||||
this.layer.events.un({
|
||||
this.source.events.un({
|
||||
sketchcomplete: this.onSketchComplete,
|
||||
afterfeaturemodified: this.afterFeatureModified,
|
||||
scope: this
|
||||
|
||||
@@ -37,9 +37,9 @@ OpenLayers.Control.Zoom = OpenLayers.Class(OpenLayers.Control, {
|
||||
/**
|
||||
* APIProperty: zoomOutText
|
||||
* {String}
|
||||
* Text for zoom-out link. Default is "-".
|
||||
* Text for zoom-out link. Default is "\u2212".
|
||||
*/
|
||||
zoomOutText: "-",
|
||||
zoomOutText: "\u2212",
|
||||
|
||||
/**
|
||||
* APIProperty: zoomOutId
|
||||
|
||||
@@ -41,9 +41,17 @@ OpenLayers.Control.ZoomBox = OpenLayers.Class(OpenLayers.Control, {
|
||||
|
||||
/**
|
||||
* APIProperty: alwaysZoom
|
||||
* {Boolean} Always zoom in/out, when box drawed
|
||||
* {Boolean} Always zoom in/out when box drawn, even if the zoom level does
|
||||
* not change.
|
||||
*/
|
||||
alwaysZoom: false,
|
||||
|
||||
/**
|
||||
* APIProperty: zoomOnClick
|
||||
* {Boolean} Should we zoom when no box was dragged, i.e. the user only
|
||||
* clicked? Default is true.
|
||||
*/
|
||||
zoomOnClick: true,
|
||||
|
||||
/**
|
||||
* Method: draw
|
||||
@@ -93,7 +101,7 @@ OpenLayers.Control.ZoomBox = OpenLayers.Class(OpenLayers.Control, {
|
||||
if (lastZoom == this.map.getZoom() && this.alwaysZoom == true){
|
||||
this.map.zoomTo(lastZoom + (this.out ? -1 : 1));
|
||||
}
|
||||
} else { // it's a pixel
|
||||
} else if (this.zoomOnClick) { // it's a pixel
|
||||
if (!this.out) {
|
||||
this.map.setCenter(this.map.getLonLatFromPixel(position),
|
||||
this.map.getZoom() + 1);
|
||||
|
||||
Reference in New Issue
Block a user