Compare commits
3 Commits
release-2.
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98759ba74d | ||
|
|
5f8dc06823 | ||
|
|
130e527702 |
@@ -12,7 +12,6 @@ of different layers.
|
|||||||
clone() -- {OpenLayers.Layer} -- create a clone of the layer.
|
clone() -- {OpenLayers.Layer} -- create a clone of the layer.
|
||||||
setName({String|name}) -- none -- Set the name of the layer to something different.
|
setName({String|name}) -- none -- Set the name of the layer to something different.
|
||||||
moveTo({OpenLayers.Bounds|bounds}, {Boolean|zoomChanged}) -- none -- Not implemented here, but the general function called on dragging or setCenter, to move the Layer to a new geographic location.
|
moveTo({OpenLayers.Bounds|bounds}, {Boolean|zoomChanged}) -- none -- Not implemented here, but the general function called on dragging or setCenter, to move the Layer to a new geographic location.
|
||||||
reproject() -- none -- Subclassed by vector layers to redraw vectors when base layer changes.
|
|
||||||
setMap(map) -- none -- Set the map property of the layer. Also set the parameters which are inherited from the map.
|
setMap(map) -- none -- Set the map property of the layer. Also set the parameters which are inherited from the map.
|
||||||
getVisibility() -- {Boolean} -- Return true or false based on visibility of the layer.
|
getVisibility() -- {Boolean} -- Return true or false based on visibility of the layer.
|
||||||
setVisibility({Boolean|visible}) -- none -- Set the layer visibility, and trigger the appropriate events.
|
setVisibility({Boolean|visible}) -- none -- Set the layer visibility, and trigger the appropriate events.
|
||||||
|
|||||||
@@ -141,9 +141,12 @@ OpenLayers.Control.MouseDefaults.prototype =
|
|||||||
* @param {Event} evt
|
* @param {Event} evt
|
||||||
*/
|
*/
|
||||||
defaultMouseOut: function (evt) {
|
defaultMouseOut: function (evt) {
|
||||||
if (this.mouseDragStart != null
|
if (this.mouseDragStart != null &&
|
||||||
&& OpenLayers.Util.mouseLeft(evt, this.map.div)) {
|
OpenLayers.Util.mouseLeft(evt, this.map.div)) {
|
||||||
this.defaultMouseUp(evt);
|
if (this.zoomBox) {
|
||||||
|
this.removeZoomBox();
|
||||||
|
}
|
||||||
|
this.mouseDragStart = null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -188,9 +191,16 @@ OpenLayers.Control.MouseDefaults.prototype =
|
|||||||
(end.lat)
|
(end.lat)
|
||||||
), this.map.getZoom() + 1);
|
), this.map.getZoom() + 1);
|
||||||
}
|
}
|
||||||
this.map.viewPortDiv.removeChild(this.zoomBox);
|
this.removeZoomBox();
|
||||||
this.zoomBox = null;
|
}
|
||||||
}
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the zoombox from the screen and nullify our reference to it.
|
||||||
|
*/
|
||||||
|
removeZoomBox: function() {
|
||||||
|
this.map.viewPortDiv.removeChild(this.zoomBox);
|
||||||
|
this.zoomBox = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
|
|
||||||
direction: "vertical",
|
direction: "vertical",
|
||||||
|
|
||||||
|
/** @type String */
|
||||||
|
buttonClicked: null,
|
||||||
|
|
||||||
initialize: function(position, direction) {
|
initialize: function(position, direction) {
|
||||||
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
OpenLayers.Control.prototype.initialize.apply(this, arguments);
|
||||||
this.position = new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,
|
this.position = new OpenLayers.Pixel(OpenLayers.Control.MouseToolbar.X,
|
||||||
@@ -62,10 +65,10 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
btn.imgLocation = imgLocation;
|
btn.imgLocation = imgLocation;
|
||||||
btn.activeImgLocation = activeImgLocation;
|
btn.activeImgLocation = activeImgLocation;
|
||||||
|
|
||||||
btn.events = new OpenLayers.Events(this, btn);
|
btn.events = new OpenLayers.Events(this, btn, null, true);
|
||||||
btn.events.register("mousedown", this, this.buttonClick);
|
btn.events.register("mousedown", this, this.buttonDown);
|
||||||
btn.events.register("mouseup", this, Event.stop);
|
btn.events.register("mouseup", this, this.buttonUp);
|
||||||
btn.events.register("click", this, Event.stop);
|
btn.events.register("dblclick", this, Event.stop);
|
||||||
btn.action = id;
|
btn.action = id;
|
||||||
btn.title = title;
|
btn.title = title;
|
||||||
btn.alt = title;
|
btn.alt = title;
|
||||||
@@ -76,11 +79,28 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
return btn;
|
return btn;
|
||||||
},
|
},
|
||||||
|
|
||||||
buttonClick: function(evt) {
|
/**
|
||||||
|
* @param {Event} evt
|
||||||
|
*/
|
||||||
|
buttonDown: function(evt) {
|
||||||
if (!Event.isLeftClick(evt)) return;
|
if (!Event.isLeftClick(evt)) return;
|
||||||
this.switchModeTo(evt.element.action);
|
this.buttonClicked = evt.element.action;
|
||||||
Event.stop(evt);
|
Event.stop(evt);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Event} evt
|
||||||
|
*/
|
||||||
|
buttonUp: function(evt) {
|
||||||
|
if (!Event.isLeftClick(evt)) return;
|
||||||
|
if (this.buttonClicked != null) {
|
||||||
|
if (this.buttonClicked == evt.element.action) {
|
||||||
|
this.switchModeTo(evt.element.action);
|
||||||
|
}
|
||||||
|
Event.stop(evt);
|
||||||
|
this.buttonClicked = null;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Event} evt
|
* @param {Event} evt
|
||||||
@@ -89,7 +109,7 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
this.switchModeTo("pan");
|
this.switchModeTo("pan");
|
||||||
this.performedDrag = false;
|
this.performedDrag = false;
|
||||||
var newCenter = this.map.getLonLatFromViewPortPx( evt.xy );
|
var newCenter = this.map.getLonLatFromViewPortPx( evt.xy );
|
||||||
this.map.setCenter(newCenter, this.map.zoom + 2);
|
this.map.setCenter(newCenter, this.map.zoom + 1);
|
||||||
Event.stop(evt);
|
Event.stop(evt);
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
@@ -179,6 +199,8 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
|
|
||||||
switchModeTo: function(mode) {
|
switchModeTo: function(mode) {
|
||||||
if (mode != this.mode) {
|
if (mode != this.mode) {
|
||||||
|
|
||||||
|
|
||||||
if (this.mode && this.buttons[this.mode]) {
|
if (this.mode && this.buttons[this.mode]) {
|
||||||
OpenLayers.Util.modifyAlphaImageDiv(this.buttons[this.mode], null, null, null, this.buttons[this.mode].imgLocation);
|
OpenLayers.Util.modifyAlphaImageDiv(this.buttons[this.mode], null, null, null, this.buttons[this.mode].imgLocation);
|
||||||
}
|
}
|
||||||
@@ -195,6 +217,15 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
if (this.buttons[mode]) {
|
if (this.buttons[mode]) {
|
||||||
OpenLayers.Util.modifyAlphaImageDiv(this.buttons[mode], null, null, null, this.buttons[mode].activeImgLocation);
|
OpenLayers.Util.modifyAlphaImageDiv(this.buttons[mode], null, null, null, this.buttons[mode].activeImgLocation);
|
||||||
}
|
}
|
||||||
|
switch (this.mode) {
|
||||||
|
case "zoombox":
|
||||||
|
this.map.div.style.cursor = "crosshair";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this.map.div.style.cursor = "default";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -254,12 +285,21 @@ OpenLayers.Control.MouseToolbar.prototype =
|
|||||||
this.map.div.style.cursor = "default";
|
this.map.div.style.cursor = "default";
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {Event} evt
|
||||||
|
*/
|
||||||
defaultMouseOut: function (evt) {
|
defaultMouseOut: function (evt) {
|
||||||
if (this.mouseDragStart != null
|
if (this.mouseDragStart != null
|
||||||
&& OpenLayers.Util.mouseLeft(evt, this.map.div)) {
|
&& OpenLayers.Util.mouseLeft(evt, this.map.div)) {
|
||||||
this.defaultMouseUp(evt);
|
if (this.zoomBox) {
|
||||||
|
this.removeZoomBox();
|
||||||
|
if (this.startViaKeyboard) this.leaveMode();
|
||||||
|
}
|
||||||
|
this.mouseDragStart = null;
|
||||||
|
this.map.div.style.cursor = "default";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
defaultClick: function (evt) {
|
defaultClick: function (evt) {
|
||||||
if (this.performedDrag) {
|
if (this.performedDrag) {
|
||||||
this.performedDrag = false;
|
this.performedDrag = false;
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ OpenLayers.Control.PanZoomBar.prototype =
|
|||||||
"absolute");
|
"absolute");
|
||||||
this.slider = slider;
|
this.slider = slider;
|
||||||
|
|
||||||
this.sliderEvents = new OpenLayers.Events(this, slider);
|
this.sliderEvents = new OpenLayers.Events(this, slider, null, true);
|
||||||
this.sliderEvents.register("mousedown", this, this.zoomBarDown);
|
this.sliderEvents.register("mousedown", this, this.zoomBarDown);
|
||||||
this.sliderEvents.register("mousemove", this, this.zoomBarDrag);
|
this.sliderEvents.register("mousemove", this, this.zoomBarDrag);
|
||||||
this.sliderEvents.register("mouseup", this, this.zoomBarUp);
|
this.sliderEvents.register("mouseup", this, this.zoomBarUp);
|
||||||
@@ -116,7 +116,7 @@ OpenLayers.Control.PanZoomBar.prototype =
|
|||||||
|
|
||||||
this.zoombarDiv = div;
|
this.zoombarDiv = div;
|
||||||
|
|
||||||
this.divEvents = new OpenLayers.Events(this, div);
|
this.divEvents = new OpenLayers.Events(this, div, null, true);
|
||||||
this.divEvents.register("mousedown", this, this.divClick);
|
this.divEvents.register("mousedown", this, this.divClick);
|
||||||
this.divEvents.register("mousemove", this, this.passEventToSlider);
|
this.divEvents.register("mousemove", this, this.passEventToSlider);
|
||||||
this.divEvents.register("dblclick", this, this.doubleClick);
|
this.divEvents.register("dblclick", this, this.doubleClick);
|
||||||
|
|||||||
@@ -37,11 +37,14 @@ OpenLayers.Events.prototype = {
|
|||||||
* is being added
|
* is being added
|
||||||
* @param {DOMElement} element A dom element to respond to browser events
|
* @param {DOMElement} element A dom element to respond to browser events
|
||||||
* @param {Array} eventTypes Array of custom application events
|
* @param {Array} eventTypes Array of custom application events
|
||||||
|
* @param {Boolean} fallThrough Allow events to fall through after these
|
||||||
|
* have been handled?
|
||||||
*/
|
*/
|
||||||
initialize: function (object, element, eventTypes) {
|
initialize: function (object, element, eventTypes, fallThrough) {
|
||||||
this.object = object;
|
this.object = object;
|
||||||
this.element = element;
|
this.element = element;
|
||||||
this.eventTypes = eventTypes;
|
this.eventTypes = eventTypes;
|
||||||
|
this.fallThrough = fallThrough;
|
||||||
this.listeners = new Object();
|
this.listeners = new Object();
|
||||||
|
|
||||||
// if eventTypes is specified, create a listeners list for each
|
// if eventTypes is specified, create a listeners list for each
|
||||||
@@ -176,7 +179,9 @@ OpenLayers.Events.prototype = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// don't fall through to other DOM elements
|
// don't fall through to other DOM elements
|
||||||
Event.stop(evt);
|
if (!this.fallThrough) {
|
||||||
|
Event.stop(evt);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -322,7 +322,6 @@ OpenLayers.Layer.prototype = {
|
|||||||
this.resolutions.push(this.maxResolution / Math.pow(2, i));
|
this.resolutions.push(this.maxResolution / Math.pow(2, i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.resolutions = this.resolutions.sort().reverse();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -250,18 +250,16 @@ OpenLayers.Popup.prototype = {
|
|||||||
* hyperlinks or drag-selecting text.
|
* hyperlinks or drag-selecting text.
|
||||||
*/
|
*/
|
||||||
registerEvents:function() {
|
registerEvents:function() {
|
||||||
Event.observe(this.div, "mousedown",
|
this.events = new OpenLayers.Events(this, this.div, null, true);
|
||||||
this.onmousedown.bindAsEventListener(this));
|
|
||||||
Event.observe(this.div, "mousemove",
|
this.events.register("mousedown", this, this.onmousedown);
|
||||||
this.onmousemove.bindAsEventListener(this));
|
this.events.register("mousemove", this, this.onmousemove);
|
||||||
Event.observe(this.div, "mouseup",
|
this.events.register("mouseup", this, this.onmouseup);
|
||||||
this.onmouseup.bindAsEventListener(this));
|
this.events.register("click", this,
|
||||||
Event.observe(this.div, "click",
|
OpenLayers.Util.safeStopPropagation);
|
||||||
OpenLayers.Util.safeStopPropagation);
|
this.events.register("mouseout", this, this.onmouseout);
|
||||||
Event.observe(this.div, "mouseout",
|
this.events.register("dblclick", this,
|
||||||
this.onmouseout.bindAsEventListener(this));
|
OpenLayers.Util.safeStopPropagation);
|
||||||
Event.observe(this.div, "dblclick",
|
|
||||||
OpenLayers.Util.safeStopPropagation);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/** When mouse goes down within the popup, make a note of
|
/** When mouse goes down within the popup, make a note of
|
||||||
|
|||||||
Reference in New Issue
Block a user