Merge branch 'master' of https://github.com/openlayers/openlayers into no-$
This commit is contained in:
@@ -139,7 +139,7 @@
|
||||
}
|
||||
function test_Control_Permalink_base_with_query (t) {
|
||||
t.plan( 3 );
|
||||
|
||||
|
||||
control = new OpenLayers.Control.Permalink('permalink', "./edit.html?foo=bar" );
|
||||
map = new OpenLayers.Map('map');
|
||||
layer = new OpenLayers.Layer.WMS('Test Layer', "http://example.com" );
|
||||
@@ -162,7 +162,38 @@
|
||||
map.pan(-5, 0, {animate:false});
|
||||
t.eq(OpenLayers.Util.getElement('permalink').href, OpenLayers.Util.getElement('edit_permalink').href, "Panning sets permalink with base and querystring ending with '?'");
|
||||
map.destroy();
|
||||
}
|
||||
|
||||
function test_Control_Permalink_base_with_anchor (t) {
|
||||
t.plan( 4 );
|
||||
control = new OpenLayers.Control.Permalink('permalink', "./edit.html#foo" );
|
||||
map = new OpenLayers.Map('map');
|
||||
layer = new OpenLayers.Layer.WMS('Test Layer', "http://example.com" );
|
||||
map.addLayer(layer);
|
||||
if (!map.getCenter()) map.zoomToMaxExtent();
|
||||
map.addControl(control);
|
||||
map.pan(5, 0, {animate:false});
|
||||
OpenLayers.Util.getElement('edit_permalink').href = './edit.html?zoom=2&lat=0&lon=1.75781&layers=B#foo';
|
||||
t.eq(OpenLayers.Util.getElement('permalink').href, OpenLayers.Util.getElement('edit_permalink').href, "Panning sets permalink with base and anchor");
|
||||
|
||||
control = new OpenLayers.Control.Permalink('permalink', "./edit.html#" );
|
||||
map.addControl(control);
|
||||
map.pan(0, 0, {animate:false});
|
||||
OpenLayers.Util.getElement('edit_permalink').href = './edit.html?zoom=2&lat=0&lon=1.75781&layers=B#';
|
||||
t.eq(OpenLayers.Util.getElement('permalink').href, OpenLayers.Util.getElement('edit_permalink').href, "Panning sets permalink with base and an empty anchor");
|
||||
|
||||
control = new OpenLayers.Control.Permalink('permalink', "./edit.html?foo=bar#test" );
|
||||
OpenLayers.Util.getElement('edit_permalink').href = './edit.html?foo=bar&zoom=2&lat=0&lon=1.75781&layers=B#test';
|
||||
map.addControl(control);
|
||||
map.pan(5, 0, {animate:false});
|
||||
map.pan(-5, 0, {animate:false});
|
||||
t.eq(OpenLayers.Util.getElement('permalink').href, OpenLayers.Util.getElement('edit_permalink').href, "Panning sets permalink with base, querystring and an anchor");
|
||||
|
||||
control = new OpenLayers.Control.Permalink('permalink', "./edit.html#foo", {anchor : true} );
|
||||
map.addControl(control);
|
||||
map.pan(0, 0, {animate:false});
|
||||
OpenLayers.Util.getElement('edit_permalink').href = './edit.html#zoom=2&lat=0&lon=1.75781&layers=B';
|
||||
t.eq(OpenLayers.Util.getElement('permalink').href, OpenLayers.Util.getElement('edit_permalink').href, "Panning sets permalink with base and an empty anchor");
|
||||
}
|
||||
|
||||
function test_Control_Permalink_nonRepeating (t) {
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
|
||||
t.ok( feature instanceof OpenLayers.Feature, "new OpenLayers.Feature returns Feature object" );
|
||||
t.eq( feature.layer, layer, "feature.layer set correctly" );
|
||||
t.ok(OpenLayers.String.startsWith(feature.id, "OpenLayers.Feature_"),
|
||||
t.ok(OpenLayers.String.startsWith(feature.id, "OpenLayers_Feature_"),
|
||||
"feature.id set correctly");
|
||||
t.ok( feature.lonlat.equals(lonlat), "feature.lonlat set correctly" );
|
||||
t.eq( feature.data.iconURL, iconURL, "feature.data.iconURL set correctly" );
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@
|
||||
var g = new OpenLayers.Geometry();
|
||||
|
||||
t.eq(g.CLASS_NAME, "OpenLayers.Geometry", "correct CLASS_NAME")
|
||||
t.ok(OpenLayers.String.startsWith(g.id, "OpenLayers.Geometry_"),
|
||||
t.ok(OpenLayers.String.startsWith(g.id, "OpenLayers_Geometry_"),
|
||||
"id correctly set");
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
var clone = geometry.clone();
|
||||
|
||||
t.eq(clone.CLASS_NAME, "OpenLayers.Geometry", "correct CLASS_NAME")
|
||||
t.ok(OpenLayers.String.startsWith(clone.id, "OpenLayers.Geometry_"),
|
||||
t.ok(OpenLayers.String.startsWith(clone.id, "OpenLayers_Geometry_"),
|
||||
"id correctly set");
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
popup = new OpenLayers.Popup();
|
||||
|
||||
t.ok( popup instanceof OpenLayers.Popup, "new OpenLayers.Popup returns Popup object" );
|
||||
t.ok(OpenLayers.String.startsWith(popup.id, "OpenLayers.Popup"),
|
||||
t.ok(OpenLayers.String.startsWith(popup.id, "OpenLayers_Popup"),
|
||||
"valid default popupid");
|
||||
var firstID = popup.id;
|
||||
t.ok(popup.contentSize.equals(size), "good default popup.size");
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
popup = new OpenLayers.Popup.Anchored();
|
||||
|
||||
t.ok( popup instanceof OpenLayers.Popup.Anchored, "new OpenLayers.Popup.Anchored returns Popup.Anchored object" );
|
||||
t.ok(OpenLayers.String.startsWith(popup.id, "OpenLayers.Popup.Anchored"), "valid default popupid");
|
||||
t.ok(OpenLayers.String.startsWith(popup.id, "OpenLayers_Popup_Anchored"), "valid default popupid");
|
||||
var firstID = popup.id;
|
||||
t.eq(popup.contentHTML, null, "good default popup.contentHTML");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user