@yuneta/gobj-ui 7.10.4 → 7.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gobj-ui.cjs.js +2 -2
- package/dist/gobj-ui.es.js +2 -2
- package/package.json +1 -1
- package/src/c_yui_map.js +13 -2
package/dist/gobj-ui.cjs.js
CHANGED
|
@@ -8536,7 +8536,7 @@ function decod_coordinates(gobj, coordinates) {
|
|
|
8536
8536
|
*
|
|
8537
8537
|
************************************************************/
|
|
8538
8538
|
function get_coordinates(gobj, device) {
|
|
8539
|
-
let coordinates = decod_coordinates(gobj, device.settings
|
|
8539
|
+
let coordinates = decod_coordinates(gobj, device.settings?.coordinates);
|
|
8540
8540
|
if (coordinates.lng === 0 && coordinates.lat === 0) coordinates = decod_coordinates(gobj, device.coordinates);
|
|
8541
8541
|
if (coordinates.lng === 0 && coordinates.lat === 0) {
|
|
8542
8542
|
coordinates.lng = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "default_longitude");
|
|
@@ -8585,7 +8585,7 @@ function devices2geojson(gobj, devices) {
|
|
|
8585
8585
|
id: device.id,
|
|
8586
8586
|
name: device.name,
|
|
8587
8587
|
image: device.image,
|
|
8588
|
-
connected: device.connected,
|
|
8588
|
+
connected: !!device.connected,
|
|
8589
8589
|
gobj_service_name: device.gobj_service_name
|
|
8590
8590
|
}
|
|
8591
8591
|
};
|
package/dist/gobj-ui.es.js
CHANGED
|
@@ -8531,7 +8531,7 @@ function decod_coordinates(gobj, coordinates) {
|
|
|
8531
8531
|
*
|
|
8532
8532
|
************************************************************/
|
|
8533
8533
|
function get_coordinates(gobj, device) {
|
|
8534
|
-
let coordinates = decod_coordinates(gobj, device.settings
|
|
8534
|
+
let coordinates = decod_coordinates(gobj, device.settings?.coordinates);
|
|
8535
8535
|
if (coordinates.lng === 0 && coordinates.lat === 0) coordinates = decod_coordinates(gobj, device.coordinates);
|
|
8536
8536
|
if (coordinates.lng === 0 && coordinates.lat === 0) {
|
|
8537
8537
|
coordinates.lng = gobj_read_attr(gobj, "default_longitude");
|
|
@@ -8580,7 +8580,7 @@ function devices2geojson(gobj, devices) {
|
|
|
8580
8580
|
id: device.id,
|
|
8581
8581
|
name: device.name,
|
|
8582
8582
|
image: device.image,
|
|
8583
|
-
connected: device.connected,
|
|
8583
|
+
connected: !!device.connected,
|
|
8584
8584
|
gobj_service_name: device.gobj_service_name
|
|
8585
8585
|
}
|
|
8586
8586
|
};
|
package/package.json
CHANGED
package/src/c_yui_map.js
CHANGED
|
@@ -293,7 +293,7 @@ function get_coordinates(gobj, device)
|
|
|
293
293
|
* Coordinates can be set in device.settings or in device
|
|
294
294
|
* If devices.settings are null then get it from device
|
|
295
295
|
*/
|
|
296
|
-
let coordinates = decod_coordinates(gobj, device.settings
|
|
296
|
+
let coordinates = decod_coordinates(gobj, device.settings?.coordinates);
|
|
297
297
|
if(coordinates.lng === 0 && coordinates.lat === 0) {
|
|
298
298
|
coordinates = decod_coordinates(gobj, device.coordinates);
|
|
299
299
|
}
|
|
@@ -369,7 +369,18 @@ function devices2geojson(gobj, devices)
|
|
|
369
369
|
id: device.id,
|
|
370
370
|
name: device.name,
|
|
371
371
|
image: device.image,
|
|
372
|
-
|
|
372
|
+
/*
|
|
373
|
+
* A REAL boolean. Four style expressions test this with
|
|
374
|
+
* ['case', ...], and maplibre asserts a STRICT boolean
|
|
375
|
+
* there, so null, absent, or the 1/0 a backend may send all
|
|
376
|
+
* fail the assertion. The consequences are not cosmetic:
|
|
377
|
+
* the point paints with the property default instead of
|
|
378
|
+
* green/red, and the cluster accumulator turns NULL, which
|
|
379
|
+
* the cluster colour compares against point_count -- never
|
|
380
|
+
* equal, so the whole cluster stays red as if something were
|
|
381
|
+
* disconnected.
|
|
382
|
+
*/
|
|
383
|
+
connected: !!device.connected,
|
|
373
384
|
gobj_service_name: device.gobj_service_name,
|
|
374
385
|
}
|
|
375
386
|
};
|