diff --git a/js/helpers.js b/js/helpers.js index 1fe7e46..013f0c4 100644 --- a/js/helpers.js +++ b/js/helpers.js @@ -304,6 +304,9 @@ function shipMarker(feature, instance = true){ } } + // retrieve marker / fallback to model 'ship' + const marker = markers['marine'][model] || markers['marine']['ship']; + var altitude = 'water'; if(feature.properties.statusLong=='Moored' || feature.properties.statusLong=='At anchor'){ altitude='ground'; @@ -323,7 +326,7 @@ function shipMarker(feature, instance = true){ } let options = { type: scaled ? "scaledShipMarker" : "shipMarker", - radius: markers['marine'][model].size[0]/2, + radius: marker.size[0]/2, zIndexOffset: parseInt(feature.properties.altitude), fillColor: typeToColor(altitude, feature.properties.type), color: "#000", @@ -331,7 +334,7 @@ function shipMarker(feature, instance = true){ opacity: feature.properties.opacity, fillOpacity: 0.9, rotation: (feature.properties.track != 511 ? feature.properties.track : 0), - marker: markers['marine'][model], + marker: marker, renderer: vehicleRenderer, bubblingMouseEvents: false, shadowColor: (feature.properties.id == id ? "black" : null),