Skip to content

Commit

Permalink
Fix lighthouses with missing sequences not being drawn
Browse files Browse the repository at this point in the history
  • Loading branch information
Ergo Enn committed Jan 26, 2022
1 parent c354ba2 commit 327de7a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion data-full2.json
Original file line number Diff line number Diff line change
Expand Up @@ -1140634,7 +1140634,7 @@
"seamark:light:colour": "yellow",
"seamark:light:group": "C",
"seamark:light:period": "12",
"seamark:name": "Su’ai Haiwan Tunnel Temporary No.S2 (South bank)",
"seamark:name": "Su’ai Haiwan Tunnel Temporary No.S2 (South bank)",
"seamark:topmark:colour": "yellow",
"seamark:topmark:shape": "x-shape",
"seamark:type": "buoy_special_purpose",
Expand Down
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
return L.indexedGeoJSON(null, {
pointToLayer: function (feat, latlng) {
let sequence;
if (feat.properties.tags['seamark:light:sequence']) {
if (feat.properties.tags['seamark:light:colour']) {
try {
sequence = L.Light.sequence(feat.properties.tags, Math.random(), '#FF0');
} catch (e) {
Expand All @@ -175,11 +175,11 @@
fill: !!sequence.state(0),
fillColor: sequence.state(0)
})]);
} else if (feat.properties.tags['seamark:light:1:sequence']) {
} else if (feat.properties.tags['seamark:light:1:colour']) {
var i = 1;
let layr = [];
let seqOffset = Math.random();
while (feat.properties.tags['seamark:light:' + i + ':sequence']) {
while (feat.properties.tags['seamark:light:' + i + ':colour']) {
let data = {
"seamark:light:character": feat.properties.tags['seamark:light:' + i + ':character'],
"seamark:light:colour": feat.properties.tags['seamark:light:' + i + ':colour'],
Expand Down
2 changes: 1 addition & 1 deletion leaflet.light.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ L.Light = L.SemiCircle.extend({
if(b)
this.setRadius(this.options.realDistance);
else
this.setRadius(500);
this.setRadius(250);
this.useRealDistance = b;
}
}
Expand Down

0 comments on commit 327de7a

Please sign in to comment.