@yuneta/gobj-ui 1.0.2 → 1.0.3
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
|
@@ -5560,7 +5560,7 @@ function decod_coordinates(gobj, coordinates) {
|
|
|
5560
5560
|
*
|
|
5561
5561
|
************************************************************/
|
|
5562
5562
|
function get_coordinates(gobj, device) {
|
|
5563
|
-
let coordinates = decod_coordinates(gobj, device.settings
|
|
5563
|
+
let coordinates = decod_coordinates(gobj, device.settings?.coordinates);
|
|
5564
5564
|
if (coordinates.lng === 0 && coordinates.lat === 0) coordinates = decod_coordinates(gobj, device.coordinates);
|
|
5565
5565
|
if (coordinates.lng === 0 && coordinates.lat === 0) {
|
|
5566
5566
|
coordinates.lng = (0, _yuneta_gobj_js.gobj_read_attr)(gobj, "default_longitude");
|
|
@@ -5609,7 +5609,7 @@ function devices2geojson(gobj, devices) {
|
|
|
5609
5609
|
id: device.id,
|
|
5610
5610
|
name: device.name,
|
|
5611
5611
|
image: device.image,
|
|
5612
|
-
connected: device.connected,
|
|
5612
|
+
connected: !!device.connected,
|
|
5613
5613
|
gobj_service_name: device.gobj_service_name
|
|
5614
5614
|
}
|
|
5615
5615
|
};
|
package/dist/gobj-ui.es.js
CHANGED
|
@@ -5555,7 +5555,7 @@ function decod_coordinates(gobj, coordinates) {
|
|
|
5555
5555
|
*
|
|
5556
5556
|
************************************************************/
|
|
5557
5557
|
function get_coordinates(gobj, device) {
|
|
5558
|
-
let coordinates = decod_coordinates(gobj, device.settings
|
|
5558
|
+
let coordinates = decod_coordinates(gobj, device.settings?.coordinates);
|
|
5559
5559
|
if (coordinates.lng === 0 && coordinates.lat === 0) coordinates = decod_coordinates(gobj, device.coordinates);
|
|
5560
5560
|
if (coordinates.lng === 0 && coordinates.lat === 0) {
|
|
5561
5561
|
coordinates.lng = gobj_read_attr(gobj, "default_longitude");
|
|
@@ -5604,7 +5604,7 @@ function devices2geojson(gobj, devices) {
|
|
|
5604
5604
|
id: device.id,
|
|
5605
5605
|
name: device.name,
|
|
5606
5606
|
image: device.image,
|
|
5607
|
-
connected: device.connected,
|
|
5607
|
+
connected: !!device.connected,
|
|
5608
5608
|
gobj_service_name: device.gobj_service_name
|
|
5609
5609
|
}
|
|
5610
5610
|
};
|
package/package.json
CHANGED
package/src/c_yui_map.js
CHANGED
|
@@ -305,7 +305,7 @@ function get_coordinates(gobj, device)
|
|
|
305
305
|
* Coordinates can be set in device.settings or in device
|
|
306
306
|
* If devices.settings are null then get it from device
|
|
307
307
|
*/
|
|
308
|
-
let coordinates = decod_coordinates(gobj, device.settings
|
|
308
|
+
let coordinates = decod_coordinates(gobj, device.settings?.coordinates);
|
|
309
309
|
if(coordinates.lng === 0 && coordinates.lat === 0) {
|
|
310
310
|
coordinates = decod_coordinates(gobj, device.coordinates);
|
|
311
311
|
}
|
|
@@ -381,7 +381,18 @@ function devices2geojson(gobj, devices)
|
|
|
381
381
|
id: device.id,
|
|
382
382
|
name: device.name,
|
|
383
383
|
image: device.image,
|
|
384
|
-
|
|
384
|
+
/*
|
|
385
|
+
* A REAL boolean. Four style expressions test this with
|
|
386
|
+
* ['case', ...], and maplibre asserts a STRICT boolean
|
|
387
|
+
* there, so null, absent, or the 1/0 a backend may send all
|
|
388
|
+
* fail the assertion. The consequences are not cosmetic:
|
|
389
|
+
* the point paints with the property default instead of
|
|
390
|
+
* green/red, and the cluster accumulator turns NULL, which
|
|
391
|
+
* the cluster colour compares against point_count -- never
|
|
392
|
+
* equal, so the whole cluster stays red as if something were
|
|
393
|
+
* disconnected.
|
|
394
|
+
*/
|
|
395
|
+
connected: !!device.connected,
|
|
385
396
|
gobj_service_name: device.gobj_service_name,
|
|
386
397
|
}
|
|
387
398
|
};
|