Skip to content

Commit

Permalink
Adjust coordinates for Pacific islands
Browse files Browse the repository at this point in the history
  • Loading branch information
norkans7 committed Oct 11, 2024
1 parent 4c4fcbe commit 8c86f34
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions static/coffee/v2_locations.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,14 @@ $(->
mouseout: reset
click: clickFeature
});


coordsToLatLng = (coords) ->
lon = coords[0]
lat = coords[1]
if lon < -120
lon += 360
L.latLng(lat, lon)

resetBoundaries = ->
map.removeLayer(boundaries)

Expand Down Expand Up @@ -215,7 +222,8 @@ $(->

boundaries = L.geoJSON(data, {
style: countStyle,
onEachFeature: onEachFeature
onEachFeature: onEachFeature,
coordsToLatLng: coordsToLatLng
})
boundaries.addTo(map);

Expand Down

0 comments on commit 8c86f34

Please sign in to comment.