Merge branch 'master' into osm
Conflicts: notes/2.12.md
This commit is contained in:
@@ -280,7 +280,6 @@ Group: OpenLayers {
|
|||||||
} # Group: Handler
|
} # Group: Handler
|
||||||
|
|
||||||
File: Icon (no auto-title, OpenLayers/Icon.js)
|
File: Icon (no auto-title, OpenLayers/Icon.js)
|
||||||
File: Kinetic (no auto-title, OpenLayers/Kinetic.js)
|
|
||||||
|
|
||||||
Group: Lang {
|
Group: Lang {
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ var init = function (onSelectFeatureFunction) {
|
|||||||
styleMap: new OpenLayers.StyleMap({
|
styleMap: new OpenLayers.StyleMap({
|
||||||
externalGraphic: "img/mobile-loc.png",
|
externalGraphic: "img/mobile-loc.png",
|
||||||
graphicOpacity: 1.0,
|
graphicOpacity: 1.0,
|
||||||
graphicWith: 16,
|
graphicWidth: 16,
|
||||||
graphicHeight: 26,
|
graphicHeight: 26,
|
||||||
graphicYOffset: -26
|
graphicYOffset: -26
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -24,7 +24,10 @@ OpenLayers.Control.Geolocate = OpenLayers.Class(OpenLayers.Control, {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Supported event types:
|
* Supported event types:
|
||||||
* - *locationupdated* Triggered when browser return a new position
|
* - *locationupdated* Triggered when browser return a new position. Listeners will
|
||||||
|
* receive an object with a 'position' property which is the browser.geolocation.position
|
||||||
|
* native object, as well as a 'point' property which is the location transformed in the
|
||||||
|
* current map projection.
|
||||||
* - *locationfailed* Triggered when geolocation has failed
|
* - *locationfailed* Triggered when geolocation has failed
|
||||||
* - *locationuncapable* Triggered when control is activated on a browser
|
* - *locationuncapable* Triggered when control is activated on a browser
|
||||||
* which doesn't support geolocation
|
* which doesn't support geolocation
|
||||||
|
|||||||
@@ -262,7 +262,9 @@ OpenLayers.Format.CSWGetRecords.v2_0_2 = OpenLayers.Class(OpenLayers.Format.XML,
|
|||||||
dc_element[attrs[i].name] = attrs[i].nodeValue;
|
dc_element[attrs[i].name] = attrs[i].nodeValue;
|
||||||
}
|
}
|
||||||
dc_element.value = this.getChildValue(node);
|
dc_element.value = this.getChildValue(node);
|
||||||
obj[name].push(dc_element);
|
if (dc_element.value != "") {
|
||||||
|
obj[name].push(dc_element);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dct": {
|
"dct": {
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ OpenLayers.Geometry.LinearRing = OpenLayers.Class(
|
|||||||
var px = approx(point.x, digs);
|
var px = approx(point.x, digs);
|
||||||
var py = approx(point.y, digs);
|
var py = approx(point.y, digs);
|
||||||
function getX(y, x1, y1, x2, y2) {
|
function getX(y, x1, y1, x2, y2) {
|
||||||
return (((x1 - x2) * y) + ((x2 * y1) - (x1 * y2))) / (y1 - y2);
|
return (y - y2) * ((x2 - x1) / (y2 - y1)) + x2;
|
||||||
}
|
}
|
||||||
var numSeg = this.components.length - 1;
|
var numSeg = this.components.length - 1;
|
||||||
var start, end, x1, y1, x2, y2, cx, cy;
|
var start, end, x1, y1, x2, y2, cx, cy;
|
||||||
|
|||||||
+15
-1
@@ -266,6 +266,16 @@ OpenLayers.Layer = OpenLayers.Class({
|
|||||||
*/
|
*/
|
||||||
minResolution: null,
|
minResolution: null,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Property: resolution
|
||||||
|
* {Float} Current resolution that the layer is drawn in. This is
|
||||||
|
* used to determine whether the zoom has changed when calling
|
||||||
|
* <moveTo> from <redraw>. Subclasses may set this.resolution to
|
||||||
|
* null prior to calling redraw to force passing zoomChanged
|
||||||
|
* true to moveTo.
|
||||||
|
*/
|
||||||
|
resolution: null,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* APIProperty: numZoomLevels
|
* APIProperty: numZoomLevels
|
||||||
* {Integer}
|
* {Integer}
|
||||||
@@ -552,7 +562,8 @@ OpenLayers.Layer = OpenLayers.Class({
|
|||||||
var extent = this.getExtent();
|
var extent = this.getExtent();
|
||||||
|
|
||||||
if (extent && this.inRange && this.visibility) {
|
if (extent && this.inRange && this.visibility) {
|
||||||
var zoomChanged = true;
|
zoomChanged = this.resolution == null ||
|
||||||
|
this.resolution !== this.map.getResolution();
|
||||||
this.moveTo(extent, zoomChanged, false);
|
this.moveTo(extent, zoomChanged, false);
|
||||||
this.events.triggerEvent("moveend",
|
this.events.triggerEvent("moveend",
|
||||||
{"zoomChanged": zoomChanged});
|
{"zoomChanged": zoomChanged});
|
||||||
@@ -577,6 +588,7 @@ OpenLayers.Layer = OpenLayers.Class({
|
|||||||
display = display && this.inRange;
|
display = display && this.inRange;
|
||||||
}
|
}
|
||||||
this.display(display);
|
this.display(display);
|
||||||
|
this.resolution = this.map.getResolution();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -632,6 +644,8 @@ OpenLayers.Layer = OpenLayers.Class({
|
|||||||
|
|
||||||
// deal with gutters
|
// deal with gutters
|
||||||
this.setTileSize();
|
this.setTileSize();
|
||||||
|
|
||||||
|
this.resolution = null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ OpenLayers.Layer.HTTPRequest = OpenLayers.Class(OpenLayers.Layer, {
|
|||||||
*/
|
*/
|
||||||
mergeNewParams:function(newParams) {
|
mergeNewParams:function(newParams) {
|
||||||
this.params = OpenLayers.Util.extend(this.params, newParams);
|
this.params = OpenLayers.Util.extend(this.params, newParams);
|
||||||
|
this.resolution = null;
|
||||||
var ret = this.redraw();
|
var ret = this.redraw();
|
||||||
if(this.map != null) {
|
if(this.map != null) {
|
||||||
this.map.events.triggerEvent("changelayer", {
|
this.map.events.triggerEvent("changelayer", {
|
||||||
@@ -144,7 +145,7 @@ OpenLayers.Layer.HTTPRequest = OpenLayers.Class(OpenLayers.Layer, {
|
|||||||
if (force) {
|
if (force) {
|
||||||
return this.mergeNewParams({"_olSalt": Math.random()});
|
return this.mergeNewParams({"_olSalt": Math.random()});
|
||||||
} else {
|
} else {
|
||||||
return OpenLayers.Layer.prototype.redraw.apply(this, []);
|
return OpenLayers.Layer.prototype.redraw.call(this);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -9,8 +9,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: remove this dependency in 3.0
|
* if application uses the query string, for example, for BBOX parameters,
|
||||||
* @requires OpenLayers/Format/QueryStringFilter.js
|
* OpenLayers/Format/QueryStringFilter.js should be included in the build config file
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -9,6 +9,11 @@
|
|||||||
* @requires OpenLayers/Format/GeoJSON.js
|
* @requires OpenLayers/Format/GeoJSON.js
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* if application uses the query string, for example, for BBOX parameters,
|
||||||
|
* OpenLayers/Format/QueryStringFilter.js should be included in the build config file
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class: OpenLayers.Protocol.Script
|
* Class: OpenLayers.Protocol.Script
|
||||||
* A basic Script protocol for vector layers. Create a new instance with the
|
* A basic Script protocol for vector layers. Create a new instance with the
|
||||||
|
|||||||
@@ -54,6 +54,10 @@ Without the WKT format included (by default), the `OpenLayers.Geometry::toString
|
|||||||
|
|
||||||
`Layer.OSM` is now defined in its own script file, namely `OpenLayers/Layer/OSM.js`. So people using `Layer.OSM` should now include `OpenLayers/Layer/OSM.js`, as opposed to `OpenLayers/Layer/XYZ.js`, in their OpenLayers builds. (See https://github.com/openlayers/openlayers/issues/138)
|
`Layer.OSM` is now defined in its own script file, namely `OpenLayers/Layer/OSM.js`. So people using `Layer.OSM` should now include `OpenLayers/Layer/OSM.js`, as opposed to `OpenLayers/Layer/XYZ.js`, in their OpenLayers builds. (See https://github.com/openlayers/openlayers/issues/138)
|
||||||
|
|
||||||
|
## QueryStringFilter
|
||||||
|
|
||||||
|
`OpenLayers.Protocol.HTTP` no longer requires `OpenLayers.Format.QueryStringFilter`. It you need this, make sure it is included in your build config file.
|
||||||
|
|
||||||
## Deprecated Components
|
## Deprecated Components
|
||||||
|
|
||||||
A number of properties, methods, and constructors have been marked as deprecated for multiple releases in the 2.x series. For the 2.12 release this deprecated functionality has been moved to a separate deprecated.js file. If you use any of the constructors or methods below, you will have to explicitly include the deprecated.js file in your build (or add it in a separate `<script>` tag after OpenLayers.js).
|
A number of properties, methods, and constructors have been marked as deprecated for multiple releases in the 2.x series. For the 2.12 release this deprecated functionality has been moved to a separate deprecated.js file. If you use any of the constructors or methods below, you will have to explicitly include the deprecated.js file in your build (or add it in a separate `<script>` tag after OpenLayers.js).
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
|
|
||||||
function test_read(t) {
|
function test_read(t) {
|
||||||
|
|
||||||
t.plan(16);
|
t.plan(17);
|
||||||
|
|
||||||
var obj = format.read(csw_response);
|
var obj = format.read(csw_response);
|
||||||
|
|
||||||
@@ -65,6 +65,9 @@
|
|||||||
t.eq(testRecord.type, "BriefRecord", "check value for record.type");
|
t.eq(testRecord.type, "BriefRecord", "check value for record.type");
|
||||||
t.eq(testRecord.title, [{value:"Sample title"}], "check value for record.title");
|
t.eq(testRecord.title, [{value:"Sample title"}], "check value for record.title");
|
||||||
|
|
||||||
|
// test empty subject
|
||||||
|
t.eq(testRecord.subject, [], "Empty subject tags are ignored");
|
||||||
|
|
||||||
//test bbox
|
//test bbox
|
||||||
t.eq(testRecord.BoundingBox.length, 2, "object contains 2 BoundingBoxes");
|
t.eq(testRecord.BoundingBox.length, 2, "object contains 2 BoundingBoxes");
|
||||||
var bbox = testRecord.BoundingBox[0];
|
var bbox = testRecord.BoundingBox[0];
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ var csw_response =
|
|||||||
'<csw:BriefRecord xmlns:geonet="http://www.fao.org/geonetwork" xmlns:ows="http://www.opengis.net/ows" xmlns:dc="http://purl.org/dc/elements/1.1/">' +
|
'<csw:BriefRecord xmlns:geonet="http://www.fao.org/geonetwork" xmlns:ows="http://www.opengis.net/ows" xmlns:dc="http://purl.org/dc/elements/1.1/">' +
|
||||||
'<dc:identifier>895ac38b-7aef-4a21-b593-b35a6fc7bba9</dc:identifier>' +
|
'<dc:identifier>895ac38b-7aef-4a21-b593-b35a6fc7bba9</dc:identifier>' +
|
||||||
'<dc:title>Sample title</dc:title>' +
|
'<dc:title>Sample title</dc:title>' +
|
||||||
|
'<dc:subject />' +
|
||||||
|
'<dc:subject />' +
|
||||||
'<ows:BoundingBox crs="::Lambert Azimuthal Projection">' +
|
'<ows:BoundingBox crs="::Lambert Azimuthal Projection">' +
|
||||||
'<ows:LowerCorner>156 -3</ows:LowerCorner>' +
|
'<ows:LowerCorner>156 -3</ows:LowerCorner>' +
|
||||||
'<ows:UpperCorner>37 83</ows:UpperCorner>' +
|
'<ows:UpperCorner>37 83</ows:UpperCorner>' +
|
||||||
|
|||||||
@@ -250,6 +250,110 @@
|
|||||||
"resize correctly adjusts y of component 4");
|
"resize correctly adjusts y of component 4");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function test_containsPoint(t) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The ring:
|
||||||
|
* edge 3
|
||||||
|
* (5, 10) __________ (15, 10)
|
||||||
|
* / /
|
||||||
|
* edge 4 / / edge 2
|
||||||
|
* / /
|
||||||
|
* (0, 0) /_________/ (10, 0)
|
||||||
|
* edge 1
|
||||||
|
*/
|
||||||
|
var components = [
|
||||||
|
new OpenLayers.Geometry.Point(0, 0),
|
||||||
|
new OpenLayers.Geometry.Point(10, 0),
|
||||||
|
new OpenLayers.Geometry.Point(15, 10),
|
||||||
|
new OpenLayers.Geometry.Point(5, 10)
|
||||||
|
];
|
||||||
|
|
||||||
|
var ring = new OpenLayers.Geometry.LinearRing(components);
|
||||||
|
|
||||||
|
function p(x, y) {
|
||||||
|
return new OpenLayers.Geometry.Point(x, y);
|
||||||
|
}
|
||||||
|
|
||||||
|
// contains: 1 (touches), true (within), false (outside)
|
||||||
|
var cases = [{
|
||||||
|
point: p(5, 5), contains: true
|
||||||
|
}, {
|
||||||
|
point: p(20, 20), contains: false
|
||||||
|
}, {
|
||||||
|
point: p(15, 15), contains: false
|
||||||
|
}, {
|
||||||
|
point: p(0, 0), contains: 1 // lower left corner
|
||||||
|
}, {
|
||||||
|
point: p(10, 0), contains: 1 // lower right corner
|
||||||
|
}, {
|
||||||
|
point: p(15, 10), contains: 1 // upper right corner
|
||||||
|
}, {
|
||||||
|
point: p(5, 10), contains: 1 // upper left corner
|
||||||
|
}, {
|
||||||
|
point: p(5, 0), contains: 1 // on edge 1
|
||||||
|
}, {
|
||||||
|
point: p(5, -0.1), contains: false // below edge 1
|
||||||
|
}, {
|
||||||
|
point: p(5, 0.1), contains: true // above edge 1
|
||||||
|
}, {
|
||||||
|
point: p(12.5, 5), contains: 1 // on edge 2
|
||||||
|
}, {
|
||||||
|
point: p(12.4, 5), contains: true // left of edge 2
|
||||||
|
}, {
|
||||||
|
point: p(12.6, 5), contains: false // right of edge 2
|
||||||
|
}, {
|
||||||
|
point: p(10, 10), contains: 1 // on edge 3
|
||||||
|
}, {
|
||||||
|
point: p(10, 9.9), contains: true // below edge 3
|
||||||
|
}, {
|
||||||
|
point: p(10, 10.1), contains: false // above edge 3
|
||||||
|
}, {
|
||||||
|
point: p(2.5, 5), contains: 1 // on edge 4
|
||||||
|
}, {
|
||||||
|
point: p(2.4, 5), contains: false // left of edge 4
|
||||||
|
}, {
|
||||||
|
point: p(2.6, 5), contains: true // right of edge 4
|
||||||
|
}];
|
||||||
|
|
||||||
|
var len = cases.length;
|
||||||
|
t.plan(len);
|
||||||
|
var c;
|
||||||
|
for (var i=0; i<len; ++i) {
|
||||||
|
c = cases[i];
|
||||||
|
t.eq(ring.containsPoint(c.point), c.contains, "case " + i + ": " + c.point);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function test_containsPoint_precision(t) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The test for linear ring containment was sensitive to failure when
|
||||||
|
* looking for ray crossings on nearly vertical edges. With a loss
|
||||||
|
* of precision in calculating the x-coordinate for the crossing,
|
||||||
|
* the method would erronously determine that the x-coordinate was
|
||||||
|
* not within the (very narrow) x-range of the nearly vertical edge.
|
||||||
|
*
|
||||||
|
* The test below creates a polygon whose first vertical edge is
|
||||||
|
* nearly horizontal. The test point lies "far" outside the polygon
|
||||||
|
* and we expect the containsPoint method to return false.
|
||||||
|
*/
|
||||||
|
|
||||||
|
t.plan(1);
|
||||||
|
|
||||||
|
var components = [
|
||||||
|
new OpenLayers.Geometry.Point(10000020.000001, 1000000),
|
||||||
|
new OpenLayers.Geometry.Point(10000020.000002, 1000010), // nearly vertical
|
||||||
|
new OpenLayers.Geometry.Point(10000030, 1000010),
|
||||||
|
new OpenLayers.Geometry.Point(10000030, 1000000)
|
||||||
|
];
|
||||||
|
|
||||||
|
var ring = new OpenLayers.Geometry.LinearRing(components);
|
||||||
|
var point = new OpenLayers.Geometry.Point(10000000, 1000001);
|
||||||
|
|
||||||
|
t.eq(ring.containsPoint(point), false, "false for point outside polygon with nearly vertical edge");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
+66
-3
@@ -672,20 +672,83 @@
|
|||||||
// test that the moveend event was triggered
|
// test that the moveend event was triggered
|
||||||
t.ok(log.event, "an event was logged");
|
t.ok(log.event, "an event was logged");
|
||||||
t.eq(log.event.type, "moveend", "moveend was triggered");
|
t.eq(log.event.type, "moveend", "moveend was triggered");
|
||||||
t.eq(log.event.zoomChanged, true, "event says zoomChanged true - poor name");
|
t.eq(log.event.zoomChanged, false, "event says zoomChanged false");
|
||||||
|
|
||||||
layer.moveTo = function(bounds, zoomChanged, dragging) {
|
layer.moveTo = function(bounds, zoomChanged, dragging) {
|
||||||
var extent = layer.map.getExtent();
|
var extent = layer.map.getExtent();
|
||||||
t.ok(bounds.equals(extent),
|
t.ok(bounds.equals(extent),
|
||||||
"redraw calls moveTo with the map extent");
|
"redraw calls moveTo with the map extent");
|
||||||
t.ok(zoomChanged,
|
t.ok(!zoomChanged,
|
||||||
"redraw calls moveTo with zoomChanged true");
|
"redraw calls moveTo with zoomChanged false");
|
||||||
t.ok(!dragging,
|
t.ok(!dragging,
|
||||||
"redraw calls moveTo with dragging false");
|
"redraw calls moveTo with dragging false");
|
||||||
}
|
}
|
||||||
layer.redraw();
|
layer.redraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This function includes integration tests to verify that the
|
||||||
|
// layer's moveTo function is called with the expected value
|
||||||
|
// for zoomChanged
|
||||||
|
function test_moveTo_zoomChanged(t) {
|
||||||
|
t.plan(6);
|
||||||
|
|
||||||
|
var log = {};
|
||||||
|
var map = new OpenLayers.Map('map');
|
||||||
|
|
||||||
|
var l1 = new OpenLayers.Layer('l1', {isBaseLayer: true});
|
||||||
|
l1.moveTo = function(bounds, zoomChanged, dragging) {
|
||||||
|
log.moveTo = {zoomChanged: zoomChanged};
|
||||||
|
OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
|
||||||
|
};
|
||||||
|
|
||||||
|
map.addLayer(l1);
|
||||||
|
map.zoomToMaxExtent();
|
||||||
|
|
||||||
|
log = {};
|
||||||
|
l1.redraw();
|
||||||
|
t.eq(log.moveTo.zoomChanged, false,
|
||||||
|
"[a] redraw calls moveTo with zoomChanged false");
|
||||||
|
|
||||||
|
log = {};
|
||||||
|
l1.resolution = null;
|
||||||
|
l1.redraw();
|
||||||
|
t.eq(log.moveTo.zoomChanged, true,
|
||||||
|
"[b] redraw calls moveTo with zoomChanged true");
|
||||||
|
|
||||||
|
l1.setVisibility(false);
|
||||||
|
log = {};
|
||||||
|
l1.setVisibility(true);
|
||||||
|
t.eq(log.moveTo.zoomChanged, false,
|
||||||
|
"[c] redraw calls moveTo with zoomChanged false");
|
||||||
|
|
||||||
|
l1.setVisibility(false);
|
||||||
|
map.zoomIn();
|
||||||
|
log = {};
|
||||||
|
l1.setVisibility(true);
|
||||||
|
t.eq(log.moveTo.zoomChanged, true,
|
||||||
|
"[d] redraw calls moveTo with zoomChanged true");
|
||||||
|
|
||||||
|
l1.moveTo = OpenLayers.Layer.prototype.moveTo;
|
||||||
|
|
||||||
|
var l2 = new OpenLayers.Layer('l2');
|
||||||
|
l2.moveTo = function(bounds, zoomChanged, dragging) {
|
||||||
|
log.moveTo = {zoomChanged: zoomChanged};
|
||||||
|
OpenLayers.Layer.prototype.moveTo.apply(this, arguments);
|
||||||
|
};
|
||||||
|
log = {};
|
||||||
|
map.addLayer(l2);
|
||||||
|
t.eq(log.moveTo.zoomChanged, true,
|
||||||
|
"[e] redraw calls moveTo with zoomChanged true");
|
||||||
|
|
||||||
|
map.removeLayer(l2);
|
||||||
|
log = {};
|
||||||
|
map.addLayer(l2);
|
||||||
|
t.eq(log.moveTo.zoomChanged, true,
|
||||||
|
"[f] redraw calls moveTo with zoomChanged true");
|
||||||
|
|
||||||
|
map.destroy();
|
||||||
|
}
|
||||||
|
|
||||||
function test_layer_setIsBaseLayer(t) {
|
function test_layer_setIsBaseLayer(t) {
|
||||||
t.plan(2);
|
t.plan(2);
|
||||||
var map = new OpenLayers.Map('map');
|
var map = new OpenLayers.Map('map');
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function test_Layer_HTTPRequest_mergeNewParams (t) {
|
function test_Layer_HTTPRequest_mergeNewParams (t) {
|
||||||
t.plan( 8 );
|
t.plan( 9 );
|
||||||
|
|
||||||
var map = new OpenLayers.Map('map');
|
var map = new OpenLayers.Map('map');
|
||||||
layer = new OpenLayers.Layer.HTTPRequest(name, url, params, options);
|
layer = new OpenLayers.Layer.HTTPRequest(name, url, params, options);
|
||||||
@@ -97,7 +97,9 @@
|
|||||||
|
|
||||||
layer.redraw = function() {
|
layer.redraw = function() {
|
||||||
t.ok(true, "layer.mergeNewParams calls layer.redraw");
|
t.ok(true, "layer.mergeNewParams calls layer.redraw");
|
||||||
}
|
t.ok(layer.resolution === null, "layer.mergeNewParams sets resolution to null");
|
||||||
|
};
|
||||||
|
layer.resolution = 'fake';
|
||||||
layer.mergeNewParams();
|
layer.mergeNewParams();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-5
@@ -191,11 +191,12 @@
|
|||||||
//closeOnMove
|
//closeOnMove
|
||||||
var checkMapEvent = function(map, popup) {
|
var checkMapEvent = function(map, popup) {
|
||||||
var startListeners = map.events.listeners['movestart'];
|
var startListeners = map.events.listeners['movestart'];
|
||||||
for(var i=0; i < startListeners.length; i++) {
|
if (startListeners) {
|
||||||
var listener = startListeners[i];
|
for (var i = 0; i < startListeners.length; i++) {
|
||||||
|
var listener = startListeners[i];
|
||||||
if ((listener.obj == popup) && (listener.func == popup.hide)) {
|
if ((listener.obj == popup) && (listener.func == popup.hide)) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -343,6 +343,38 @@
|
|||||||
map.destroy();
|
map.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// test for https://github.com/openlayers/openlayers/pull/36
|
||||||
|
// (more an integration test than a unit test)
|
||||||
|
function test_olImageLoadError(t) {
|
||||||
|
t.plan(2);
|
||||||
|
|
||||||
|
var map = new OpenLayers.Map('map');
|
||||||
|
var layer = new OpenLayers.Layer.WMS("invalid", "", {layers: 'basic'});
|
||||||
|
map.addLayer(layer);
|
||||||
|
|
||||||
|
var size = new OpenLayers.Size(5, 6);
|
||||||
|
var position = new OpenLayers.Pixel(20, 30);
|
||||||
|
var bounds = new OpenLayers.Bounds(1, 2, 3, 4);
|
||||||
|
|
||||||
|
var tile = new OpenLayers.Tile.Image(layer, position, bounds, null, size);
|
||||||
|
tile.draw();
|
||||||
|
|
||||||
|
t.delay_call(0.1, function() {
|
||||||
|
|
||||||
|
// check initial state
|
||||||
|
t.ok(OpenLayers.Element.hasClass(tile.imgDiv, 'olImageLoadError'),
|
||||||
|
'tile image has the olImageLoadError class (init state)');
|
||||||
|
|
||||||
|
layer.setVisibility(false);
|
||||||
|
layer.setVisibility(true);
|
||||||
|
|
||||||
|
t.ok(OpenLayers.Element.hasClass(tile.imgDiv, 'olImageLoadError'),
|
||||||
|
'tile image still has the olImageLoadError class');
|
||||||
|
|
||||||
|
map.destroy();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
Reference in New Issue
Block a user