Fix the SLD example.
Some notation was using a deprecated method of accessing an xml
document.  Add a test to make sure this actually reads data from the WMS
server.
This relies on a testing infrastructure change in a previous PR.
MODIFY
examples/sld/example.json
examples/sld/example.json
"exampleJs": ["main.js"],
"about": {
"text": "Rendering tiles from a WMS server by customizing the style."
- }
+ },
+ "tests": [{
+ "description": "data is loaded from the WMS source",
+ "idle": ["$('#map.geojs-map').data('data-geojs-map').onIdle"],
+ "tests": [
+ "Object.keys($('#map.geojs-map').data('data-geojs-map').layers()[1]._activeTiles).length === 15",
+ "$('#map.geojs-map').data('data-geojs-map').layers()[1]._activeTiles['9_194_148']._image.naturalWidth === 256"
+ ]
+ }]
}

MODIFY
examples/sld/main.js
examples/sld/main.js
@@ -208,8 +208,7 @@ var utility = {
for (var i = 0; i < count; i++) {
this.createMapEntry(xml, palette[i], values[i], 1);
}
- var xmlString = (new XMLSerializer())
- .serializeToString(xml.context);
+ var xmlString = new XMLSerializer().serializeToString(xml[0]);
return xmlString;
},

Fix the SLD example.

Some notation was using a deprecated method of accessing an xml
document.  Add a test to make sure this actually reads data from the WMS
server.

This relies on a testing infrastructure change in a previous PR.