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:
ahocevar
2013-05-13 11:29:20 +02:00
committed by Bart van den Eijnden
parent 7c5afe1acf
commit 8b4592e71a
2 changed files with 22 additions and 5 deletions
+6 -1
View File
@@ -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) {