Version
@nasaworldwind/worldwind 0.11.1 (npm), also present on develop.
Problem
OpenStreetMapImageLayer's JSDoc says the constructor argument is the display name and optional:
@param {String} displayName This layer's display name. "Open Street Map" if this parameter is null or undefined.
but the constructor uses it as the WMS layer name and never defaults it:
var OpenStreetMapImageLayer = function (layerName) {
TiledImageLayer.call(this,
Sector.FULL_SPHERE, new Location(36, 36), 16, "image/jpeg", "OpenStreetMap-" + layerName, 256, 256);
this.displayName = "OpenStreetMap";
this.pickEnabled = false;
this.urlBuilder = new WmsUrlBuilder("https://worldwind47.arc.nasa.gov/mapcache",
layerName, "", "1.3.0");
};
So new WorldWind.OpenStreetMapImageLayer() throws:
WmsUrlBuilder.constructor: The WMS layer names are not specified.
and passing a display name such as "Streets" silently requests a non-existent WMS layer. Only new WorldWind.OpenStreetMapImageLayer("osm") works, and nothing documents that.
Suggested fix
Default the layer name and fix the doc, e.g.
var OpenStreetMapImageLayer = function (layerName) {
layerName = layerName || "osm";
...
};
with @param {String} layerName The WMS layer name on the mapcache server. Defaults to "osm". Happy to open a PR if that is welcome.
Version
@nasaworldwind/worldwind0.11.1 (npm), also present ondevelop.Problem
OpenStreetMapImageLayer's JSDoc says the constructor argument is the display name and optional:but the constructor uses it as the WMS layer name and never defaults it:
So
new WorldWind.OpenStreetMapImageLayer()throws:and passing a display name such as
"Streets"silently requests a non-existent WMS layer. Onlynew WorldWind.OpenStreetMapImageLayer("osm")works, and nothing documents that.Suggested fix
Default the layer name and fix the doc, e.g.
with
@param {String} layerName The WMS layer name on the mapcache server. Defaults to "osm".Happy to open a PR if that is welcome.