Pulled down bug fixes, example updates, etc. r717:r787 from source:/branches/openlayers/1.0.
git-svn-id: http://svn.openlayers.org/trunk/openlayers@788 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* See http://svn.openlayers.org/trunk/openlayers/license.txt for the full
|
||||
* text of the license. */
|
||||
|
||||
OpenLayers.ProxyHost = "/viewer/Crossbrowser/blindproxy.py?url=";
|
||||
OpenLayers.ProxyHost = "/proxy/?url=";
|
||||
//OpenLayers.ProxyHost = "examples/proxy.cgi?url=";
|
||||
|
||||
/**
|
||||
@@ -51,11 +51,6 @@ OpenLayers.loadURL = function(uri, params, caller,
|
||||
|
||||
if (OpenLayers.ProxyHost && uri.startsWith("http")) {
|
||||
uri = OpenLayers.ProxyHost + escape(uri);
|
||||
|
||||
if (!params) {
|
||||
params="";
|
||||
}
|
||||
params += "&cachehack=" + new Date().getTime();
|
||||
}
|
||||
|
||||
var success = (onComplete) ? onComplete.bind(caller)
|
||||
@@ -110,4 +105,4 @@ OpenLayers.parseXMLString = function(text) {
|
||||
);
|
||||
|
||||
return ajaxResponse;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -143,6 +143,8 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
backdropLabelOuter.style.marginTop = "4px";
|
||||
backdropLabelOuter.style.marginBottom = "4px";
|
||||
|
||||
this._setEventHandlers(backdropLabelOuter);
|
||||
|
||||
// Inner Label - for Rico Corners
|
||||
//
|
||||
var backdropLabel = document.createElement('p');
|
||||
@@ -191,9 +193,10 @@ OpenLayers.Control.LayerSwitcher.prototype =
|
||||
_setEventHandlers : function(element, labelDiv) {
|
||||
|
||||
// We only want to respond to a mousedown event.
|
||||
element.onclick = this.ignoreEvent.bindAsEventListener(this);
|
||||
element.ondblclick = this.ignoreEvent.bindAsEventListener(this);
|
||||
element.onmousedown = this.singleClick.bindAsEventListener(this);
|
||||
element.onclick = this.singleClick.bindAsEventListener(this);
|
||||
element.ondblclick = this.singleClick.bindAsEventListener(this);
|
||||
element.onmouseup = this.ignoreEvent.bindAsEventListener(this);
|
||||
element.onmousedown = this.ignoreEvent.bindAsEventListener(this);
|
||||
|
||||
// If we are operating on a corner span we need to store a
|
||||
// reference to the actual tab. (See comment about OL #57 fix above.)
|
||||
|
||||
@@ -22,6 +22,7 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
},
|
||||
|
||||
defaultClick: function (evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
var notAfterDrag = !this.performedDrag;
|
||||
this.performedDrag = false;
|
||||
return notAfterDrag;
|
||||
@@ -39,6 +40,7 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
* @param {Event} evt
|
||||
*/
|
||||
defaultMouseDown: function (evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
this.mouseDragStart = evt.xy.copyOf();
|
||||
this.performedDrag = false;
|
||||
if (evt.shiftKey) {
|
||||
@@ -94,6 +96,7 @@ OpenLayers.Control.MouseDefaults.prototype =
|
||||
* @param {Event} evt
|
||||
*/
|
||||
defaultMouseUp: function (evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
if (this.zoomBox) {
|
||||
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
|
||||
var end = this.map.getLonLatFromViewPortPx( evt.xy );
|
||||
|
||||
@@ -63,7 +63,7 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
|
||||
btn.events = new OpenLayers.Events(this, btn);
|
||||
btn.events.register("mousedown", this, this.buttonClick);
|
||||
btn.events.register("mouseup", this, this.stopAction);
|
||||
btn.events.register("mouseup", this, Event.stop);
|
||||
btn.action = id;
|
||||
btn.title = title;
|
||||
btn.alt = title;
|
||||
@@ -74,11 +74,8 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
return btn;
|
||||
},
|
||||
|
||||
stopAction: function(evt) {
|
||||
Event.stop(evt);
|
||||
},
|
||||
|
||||
buttonClick: function(evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
this.switchModeTo(evt.div.action);
|
||||
Event.stop(evt);
|
||||
},
|
||||
@@ -96,6 +93,7 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
* @param {Event} evt
|
||||
*/
|
||||
defaultMouseDown: function (evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
this.mouseDragStart = evt.xy.copyOf();
|
||||
if (evt.shiftKey && this.mode !="zoombox") {
|
||||
this.switchModeTo("zoombox");
|
||||
@@ -226,6 +224,7 @@ OpenLayers.Control.MouseToolbar.prototype =
|
||||
* @param {Event} evt
|
||||
*/
|
||||
defaultMouseUp: function (evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
switch (this.mode) {
|
||||
case "zoombox":
|
||||
var start = this.map.getLonLatFromViewPortPx( this.mouseDragStart );
|
||||
|
||||
@@ -111,6 +111,7 @@ OpenLayers.Control.PanZoom.prototype =
|
||||
* @param {event} evt
|
||||
*/
|
||||
buttonDown: function (evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
|
||||
var slide = this.map.getResolution() * this.slideFactor;
|
||||
var center = this.map.getCenter();
|
||||
|
||||
@@ -127,6 +127,7 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
* and sets the zoom level appropriately.
|
||||
*/
|
||||
divClick: function (evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
var y = evt.xy.y;
|
||||
var top = Position.page(evt.object)[1];
|
||||
var levels = Math.floor((y - top)/this.zoomStopHeight);
|
||||
@@ -139,6 +140,7 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
* event listener for clicks on the slider
|
||||
*/
|
||||
zoomBarDown:function(evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
this.map.events.register("mousemove", this, this.passEventToSlider);
|
||||
this.map.events.register("mouseup", this, this.passEventToSlider);
|
||||
this.mouseDragStart = evt.xy.copyOf();
|
||||
@@ -173,6 +175,7 @@ OpenLayers.Control.PanZoomBar.prototype =
|
||||
* and switch to it.
|
||||
*/
|
||||
zoomBarUp:function(evt) {
|
||||
if (!Event.isLeftClick(evt)) return;
|
||||
if (this.zoomStart) {
|
||||
this.div.style.cursor="default";
|
||||
this.map.events.remove("mousemove");
|
||||
|
||||
@@ -43,8 +43,15 @@ OpenLayers.Feature.WFS.prototype =
|
||||
*/
|
||||
processXMLNode: function(xmlNode) {
|
||||
//this should be overridden by subclasses
|
||||
|
||||
// must return an Object with 'id' and 'lonlat' values set
|
||||
var point = xmlNode.getElementsByTagName("Point");
|
||||
var text = point[0].textContent;
|
||||
var floats = text.split(",");
|
||||
|
||||
return {lonlat: new OpenLayers.LonLat(parseFloat(floats[0]),
|
||||
parseFloat(floats[1])),
|
||||
id: null};
|
||||
|
||||
},
|
||||
|
||||
/** @final @type String */
|
||||
|
||||
@@ -12,7 +12,7 @@ OpenLayers.Layer.WFS.prototype =
|
||||
Object.extend(new OpenLayers.Layer.Markers(), {
|
||||
|
||||
/** @type Object */
|
||||
featureClass: null,
|
||||
featureClass: OpenLayers.Feature.WFS,
|
||||
|
||||
/** @final @type hash */
|
||||
DEFAULT_PARAMS: { service: "WFS",
|
||||
@@ -30,7 +30,7 @@ OpenLayers.Layer.WFS.prototype =
|
||||
* @param {Object} featureClass
|
||||
*/
|
||||
initialize: function(name, url, params, featureClass) {
|
||||
this.featureClass = featureClass;
|
||||
if (featureClass != null) this.featureClass = featureClass;
|
||||
|
||||
var newArguments = new Array();
|
||||
if (arguments.length > 0) {
|
||||
|
||||
@@ -545,12 +545,11 @@ OpenLayers.Map.prototype = {
|
||||
*/
|
||||
zoomToFullExtent: function() {
|
||||
var fullExtent = this.getFullExtent();
|
||||
var oldZoom = this.zoom;
|
||||
this.setCenter(
|
||||
new OpenLayers.LonLat((fullExtent.left+fullExtent.right)/2,
|
||||
(fullExtent.bottom+fullExtent.top)/2),
|
||||
0
|
||||
);
|
||||
this.getZoomForExtent(fullExtent)
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -51,7 +51,7 @@ OpenLayers.Popup.AnchoredBubble.prototype =
|
||||
var id = this.div.id + "-contentDiv";
|
||||
this.contentDiv = OpenLayers.Util.createDiv(id, null, contentSize,
|
||||
null, "relative", null,
|
||||
"none");
|
||||
"hidden");
|
||||
this.div.appendChild(this.contentDiv);
|
||||
this.setContentHTML();
|
||||
|
||||
|
||||
@@ -36,7 +36,9 @@ OpenLayers.Tile.Image.prototype =
|
||||
/**
|
||||
*/
|
||||
draw:function(transparent) {
|
||||
if (transparent) {
|
||||
if (false) { // don't actually use the alpha PNG hack right now
|
||||
// it has a fiercely bad effect on IE6's performance
|
||||
// if (transparent) {
|
||||
this.imgDiv = OpenLayers.Util.createAlphaImageDiv(null,
|
||||
this.position,
|
||||
this.size,
|
||||
|
||||
@@ -79,7 +79,7 @@ OpenLayers.Tile.WFS.prototype =
|
||||
doc = OpenLayers.parseXMLString(request.responseText);
|
||||
}
|
||||
|
||||
var resultFeatures = OpenLayers.Util.getNodes(doc, "gml:featureMember");
|
||||
var resultFeatures = doc.getElementsByTagName("featureMember");
|
||||
|
||||
//clear old featureList
|
||||
this.features = new Array();
|
||||
|
||||
Reference in New Issue
Block a user