Compare commits
3 Commits
v5.3.1
...
release-2.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f3ef9298b | ||
|
|
6162cbafec | ||
|
|
7884e9527f |
@@ -22,7 +22,7 @@
|
|||||||
url: "http://publicus.opengeo.org/geoserver/wfs",
|
url: "http://publicus.opengeo.org/geoserver/wfs",
|
||||||
featureType: "tasmania_roads",
|
featureType: "tasmania_roads",
|
||||||
featureNS: "http://www.openplans.org/topp"
|
featureNS: "http://www.openplans.org/topp"
|
||||||
}),
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
map.addLayers([wms, layer]);
|
map.addLayers([wms, layer]);
|
||||||
|
|||||||
@@ -212,22 +212,24 @@ OpenLayers.Layer.Google = OpenLayers.Class(
|
|||||||
* evt - {Event}
|
* evt - {Event}
|
||||||
*/
|
*/
|
||||||
onMapResize: function() {
|
onMapResize: function() {
|
||||||
this.windowResized = true;
|
|
||||||
if(this.visibility) {
|
if(this.visibility) {
|
||||||
this.checkResize();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* APIMethod: checkResize
|
|
||||||
* Check if the map has been resized, and if the Google Maps object is ready for checkResize.
|
|
||||||
* If the mapObject.getSize() equals the layer div's offset size, or if mapObject.getCenter()
|
|
||||||
* is null, the mapObject.checkResize() will fail.
|
|
||||||
*/
|
|
||||||
checkResize: function() {
|
|
||||||
if (this.windowResized && this.div.style.display != "none" && this.mapObject.getCenter()) {
|
|
||||||
this.mapObject.checkResize();
|
this.mapObject.checkResize();
|
||||||
this.windowResized = false;
|
} else {
|
||||||
|
// workaround for resizing of invisible layers where
|
||||||
|
// GMap2.checkResize() does not work. We need to load all tiles
|
||||||
|
// for the old div size, then checkResize(), and then call
|
||||||
|
// layer.moveTo() to trigger GMap.setCenter() (which will finish
|
||||||
|
// the GMap initialization).
|
||||||
|
if(!this._resized) {
|
||||||
|
var layer = this;
|
||||||
|
var handle = GEvent.addListener(this.mapObject, "tilesloaded", function() {
|
||||||
|
GEvent.removeListener(handle);
|
||||||
|
delete layer._resized;
|
||||||
|
layer.mapObject.checkResize();
|
||||||
|
layer.moveTo(layer.map.getCenter(), layer.map.getZoom());
|
||||||
|
})
|
||||||
|
}
|
||||||
|
this._resized = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -240,7 +242,6 @@ OpenLayers.Layer.Google = OpenLayers.Class(
|
|||||||
*/
|
*/
|
||||||
display: function(display) {
|
display: function(display) {
|
||||||
OpenLayers.Layer.EventPane.prototype.display.apply(this, arguments);
|
OpenLayers.Layer.EventPane.prototype.display.apply(this, arguments);
|
||||||
this.checkResize();
|
|
||||||
this.termsOfUse.style.display = this.div.style.display;
|
this.termsOfUse.style.display = this.div.style.display;
|
||||||
this.poweredBy.style.display = this.div.style.display;
|
this.poweredBy.style.display = this.div.style.display;
|
||||||
},
|
},
|
||||||
@@ -263,22 +264,7 @@ OpenLayers.Layer.Google = OpenLayers.Class(
|
|||||||
}
|
}
|
||||||
OpenLayers.Layer.EventPane.prototype.removeMap.apply(this, arguments);
|
OpenLayers.Layer.EventPane.prototype.removeMap.apply(this, arguments);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
|
||||||
* Method: moveTo
|
|
||||||
* Handle calls to move the layer.
|
|
||||||
*
|
|
||||||
* Parameters:
|
|
||||||
* bound - {<OpenLayers.Bounds>}
|
|
||||||
* zoomChanged - {Boolean} Tells when zoom has changed, as layers have to
|
|
||||||
* do some init work in that case.
|
|
||||||
* dragging - {Boolean}
|
|
||||||
*/
|
|
||||||
moveTo:function(bounds, zoomChanged, dragging) {
|
|
||||||
OpenLayers.Layer.EventPane.prototype.moveTo.apply(this, arguments);
|
|
||||||
this.checkResize();
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APIMethod: getZoomForExtent
|
* APIMethod: getZoomForExtent
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -122,7 +122,8 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
|
|||||||
this.imgDiv.map = null;
|
this.imgDiv.map = null;
|
||||||
}
|
}
|
||||||
this.imgDiv.urls = null;
|
this.imgDiv.urls = null;
|
||||||
this.imgDiv.src = null;
|
// abort any currently loading image
|
||||||
|
this.imgDiv.src = OpenLayers.Util.getImagesLocation() + "blank.gif";
|
||||||
}
|
}
|
||||||
this.imgDiv = null;
|
this.imgDiv = null;
|
||||||
if ((this.frame != null) && (this.frame.parentNode == this.layer.div)) {
|
if ((this.frame != null) && (this.frame.parentNode == this.layer.div)) {
|
||||||
|
|||||||
@@ -1356,7 +1356,10 @@ OpenLayers.Util.createUrlObject = function(url, options) {
|
|||||||
a.href = url;
|
a.href = url;
|
||||||
|
|
||||||
//host (without port)
|
//host (without port)
|
||||||
urlObject.host = a.host;
|
// if we don't have a host (which is the case with URLs starting with "/"
|
||||||
|
// in IE), take the window location's host to match other browsers that
|
||||||
|
// fill in the window's location host automatically
|
||||||
|
urlObject.host = a.host || window.location.host;
|
||||||
var port = a.port;
|
var port = a.port;
|
||||||
if (port.length <= 0) {
|
if (port.length <= 0) {
|
||||||
var newHostLength = urlObject.host.length - (port.length);
|
var newHostLength = urlObject.host.length - (port.length);
|
||||||
@@ -1380,7 +1383,6 @@ OpenLayers.Util.createUrlObject = function(url, options) {
|
|||||||
}
|
}
|
||||||
urlObject.args = OpenLayers.Util.getParameters(queryString);
|
urlObject.args = OpenLayers.Util.getParameters(queryString);
|
||||||
|
|
||||||
|
|
||||||
//pathname (this part allows for relative <-> absolute comparison)
|
//pathname (this part allows for relative <-> absolute comparison)
|
||||||
if ( ((urlObject.protocol == "file:") && (url.indexOf("file:") != -1)) ||
|
if ( ((urlObject.protocol == "file:") && (url.indexOf("file:") != -1)) ||
|
||||||
((urlObject.protocol != "file:") && (urlObject.host != "")) ) {
|
((urlObject.protocol != "file:") && (urlObject.host != "")) ) {
|
||||||
|
|||||||
@@ -606,7 +606,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function test_Util_isEquivalentUrl(t) {
|
function test_Util_isEquivalentUrl(t) {
|
||||||
t.plan(8);
|
t.plan(9);
|
||||||
|
|
||||||
var url1, url2, options;
|
var url1, url2, options;
|
||||||
|
|
||||||
@@ -663,7 +663,12 @@
|
|||||||
url1 = "foo.html?bar=now#go";
|
url1 = "foo.html?bar=now#go";
|
||||||
url2 = "../tests/../tests/foo.html?bar=now#go";
|
url2 = "../tests/../tests/foo.html?bar=now#go";
|
||||||
|
|
||||||
t.ok(OpenLayers.Util.isEquivalentUrl(url1, url2), "relative vs. absolute paths works");
|
t.ok(OpenLayers.Util.isEquivalentUrl(url1, url2), "relative vs. absolute paths works");
|
||||||
|
|
||||||
|
url1 = "/foo/bar";
|
||||||
|
url2 = new Array(window.location.pathname.split("/").length-1).join("../")+"foo/bar";
|
||||||
|
|
||||||
|
t.ok(OpenLayers.Util.isEquivalentUrl(url1, url2), "absolute and relative path without host works for "+url2)
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_Util_createUniqueIDSeq(t) {
|
function test_Util_createUniqueIDSeq(t) {
|
||||||
|
|||||||
Reference in New Issue
Block a user