Skip to content

Commit 67245e7

Browse files
nemesifierpandafy
authored andcommitted
[fix] Fixed issue in dashboard map (east/west replication)
(cherry picked from commit 4ab982f)
1 parent 2ff461a commit 67245e7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

openwisp_monitoring/device/static/monitoring/js/device-map.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@
248248
let westWorldFeatures = window.structuredClone(netjsonGraph.data);
249249
// Exclude the features that may be added for the East world map
250250
westWorldFeatures.features = westWorldFeatures.features.filter(
251-
element => element.geometry.coordinates[0] <= 180
251+
(element) =>
252+
!element.geometry || element.geometry.coordinates[0] <= 180,
252253
);
253254
westWorldFeatures.features.forEach(element => {
254255
if (element.geometry) {
@@ -263,7 +264,8 @@
263264
let eastWorldFeatures = window.structuredClone(netjsonGraph.data);
264265
// Exclude the features that may be added for the West world map
265266
eastWorldFeatures.features = eastWorldFeatures.features.filter(
266-
element => element.geometry.coordinates[0] >= -180
267+
(element) =>
268+
!element.geometry || element.geometry.coordinates[0] >= -180,
267269
);
268270
eastWorldFeatures.features.forEach(element => {
269271
if (element.geometry) {

0 commit comments

Comments
 (0)