We are dealing with strings for comparison
Because OpenLayers.Util.getParameters turns comma delimited values into arrays, comparing e.g. bbox values in urls will return false. By introducing a splitArgs option, we can use getParameters in a way that leaves such values as strings and makes them comparable in OpenLayers.Util.isEquivalentUrl.
This commit is contained in:
committed by
Bart van den Eijnden
parent
7c5afe1acf
commit
8b4592e71a
+6
-1
@@ -783,7 +783,7 @@
|
||||
}
|
||||
|
||||
function test_Util_isEquivalentUrl(t) {
|
||||
t.plan(9);
|
||||
t.plan(10);
|
||||
|
||||
var url1, url2, options;
|
||||
|
||||
@@ -846,6 +846,11 @@
|
||||
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)
|
||||
|
||||
//ARGS
|
||||
url1 = "foo.html?bbox=1,2,3,4",
|
||||
url2 = url1;
|
||||
t.ok(OpenLayers.Util.isEquivalentUrl(url1, url2), "equal urls with comma delimited params are equal");
|
||||
}
|
||||
|
||||
function test_createUrlObject(t) {
|
||||
|
||||
Reference in New Issue
Block a user