@yuneta/gobj-ui 1.0.1 → 1.0.2
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 +752 -546
- package/dist/gobj-ui.es.js +752 -546
- package/package.json +1 -1
- package/src/c_yui_map.js +17 -3
package/package.json
CHANGED
package/src/c_yui_map.js
CHANGED
|
@@ -776,10 +776,24 @@ function ac_refresh(gobj, event, kw, src)
|
|
|
776
776
|
let devices = gobj_read_attr(gobj, "devices");
|
|
777
777
|
|
|
778
778
|
let map = priv.xmap;
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
779
|
+
|
|
780
|
+
/*
|
|
781
|
+
* Ask for the source, do not infer it from the style. 'devices' is added
|
|
782
|
+
* by load_devices() on the map 'load' event, which is a LATER milestone:
|
|
783
|
+
* isStyleLoaded() is already true one render frame before 'load' fires,
|
|
784
|
+
* and getSource() is undefined in that frame. Nothing is lost by
|
|
785
|
+
* skipping, load_devices() reads the same attr.
|
|
786
|
+
*
|
|
787
|
+
* Testing the style was also wrong the other way: it goes back to false
|
|
788
|
+
* while new tiles load, so every refresh during a pan or a zoom was
|
|
789
|
+
* silently dropped and the devices stopped moving.
|
|
790
|
+
*/
|
|
791
|
+
const source = map.getSource('devices');
|
|
792
|
+
if(!source) {
|
|
793
|
+
return 0;
|
|
782
794
|
}
|
|
795
|
+
|
|
796
|
+
source.setData(devices2geojson(gobj, devices));
|
|
783
797
|
return 0;
|
|
784
798
|
}
|
|
785
799
|
|