Skip to content

Commit 8679105

Browse files
committed
more small tidy ups
1 parent 4757b80 commit 8679105

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

worldmap/worldmap.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ var handleData = function(data) {
146146
}
147147

148148
// handle any commands in the data
149-
if (data.command) { doCommand(data.command); delete data.command; }
149+
if (data?.command) { doCommand(data.command); delete data.command; }
150150

151151
// handle raw geojson type msg
152152
if (data.hasOwnProperty("type") && data.type.indexOf("Feature") === 0) {
@@ -1267,7 +1267,7 @@ var addOverlays = function(overlist) {
12671267
};
12681268

12691269
var decode = function (encoded, options) {
1270-
options = defaultOptions(options);
1270+
options = defaultOptions();
12711271
var flatPoints = decodeDeltas(encoded);
12721272
var points = [];
12731273
for (var i = 0, len = flatPoints.length; i + (options.dimension - 1) < len;) {
@@ -1281,7 +1281,7 @@ var addOverlays = function(overlist) {
12811281
}
12821282

12831283
var decodeDeltas = function (encoded, options) {
1284-
options = defaultOptions(options);
1284+
options = defaultOptions();
12851285
var lastNumbers = [];
12861286
var numbers = decodeFloats(encoded, options);
12871287
for (var i = 0, len = numbers.length; i < len;) {
@@ -1293,7 +1293,7 @@ var addOverlays = function(overlist) {
12931293
}
12941294

12951295
var decodeFloats = function (encoded, options) {
1296-
options = defaultOptions(options);
1296+
options = defaultOptions();
12971297
var numbers = decodeSignedIntegers(encoded);
12981298
for (var i = 0, len = numbers.length; i < len; ++i) {
12991299
numbers[i] /= options.factor;
@@ -1676,7 +1676,7 @@ function setMarker(data) {
16761676
});
16771677
data = Object.assign({},allData[data["name"]]);
16781678
}
1679-
delete data.action;
1679+
if (data.action) { delete data.action; }
16801680

16811681
if (typeof markers[data["name"]] != "undefined") {
16821682
if (markers[data["name"]].lay !== lay) {
@@ -3226,7 +3226,7 @@ function doGeojson(n,g,l,o,i) { // name, geojson, layer, options, icon
32263226
opt.pointToLayer = function (feature, latlng) {
32273227
var myMarker;
32283228
if (feature.properties.hasOwnProperty("icon")) {
3229-
var regi = /^[S,G,E,I,O][A-Z]{3}.*/i; // if it looks like a SIDC code
3229+
var regi = /^[SGEIO][A-Z]{3}.*/i; // if it looks like a SIDC code
32303230
if (regi.test(feature.properties.icon)) {
32313231
feature.properties.SIDC = (feature.properties.icon.toUpperCase()+"------------").substr(0,12);
32323232
delete feature.properties.icon;
@@ -3272,7 +3272,7 @@ function doGeojson(n,g,l,o,i) { // name, geojson, layer, options, icon
32723272
});
32733273
}
32743274
if (!feature.properties.hasOwnProperty("title") && feature.properties.hasOwnProperty("marker-symbol")) {
3275-
if (!(feature.properties["marker-symbol"].indexOf('fa-') === 0)) {
3275+
if (!feature.properties["marker-symbol"].indexOf('fa-') === 0) {
32763276
feature.properties.title = feature.properties["marker-symbol"];
32773277
}
32783278
}

0 commit comments

Comments
 (0)