Skip to content

Commit

Permalink
Improve test layer.type
Browse files Browse the repository at this point in the history
  • Loading branch information
elias75015 committed Oct 16, 2019
1 parent b20bedd commit 20bec89
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Itowns/ItMapListeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ ItMap.prototype._addRasterLayer = function (layerObj) {
layer.type = "color";
layer.id = layerId;
layer.title = (layerOpts.title === undefined) ? layerId : layerOpts.title;
if (layerOpts.type.toUpperCase() !== "ELEVATION") {
if (layerOpts.type && layerOpts.type.toUpperCase() !== "ELEVATION") {
layer.visible = (layerOpts.visibility === undefined) ? true : layerOpts.visibility;
layer.opacity = (layerOpts.opacity === undefined) ? 1 : layerOpts.opacity;
}
Expand Down Expand Up @@ -635,7 +635,7 @@ ItMap.prototype._addRasterLayer = function (layerObj) {
layer.type = "color";
layer.id = layerId;
layer.title = (layerOpts.title === undefined) ? layerId : layerOpts.title;
if (layerOpts.type.toUpperCase() !== "ELEVATION") {
if (layerOpts.type && layerOpts.type.toUpperCase() !== "ELEVATION") {
layer.visible = (layerOpts.visibility === undefined) ? true : layerOpts.visibility;
layer.opacity = (layerOpts.opacity === undefined) ? 1 : layerOpts.opacity;
}
Expand Down Expand Up @@ -722,7 +722,7 @@ ItMap.prototype._addRasterLayer = function (layerObj) {
options : layerOpts,
obj : layer
});
if (layerOpts.type.toUpperCase() === "ELEVATION") {
if (layerOpts.type && layerOpts.type.toUpperCase() === "ELEVATION") {
layer.type = "elevation";
// we add the noDataValue if it is given
if (layerOpts.noDataValue) {
Expand Down

0 comments on commit 20bec89

Please sign in to comment.