raintee-maputils 1.0.17 → 1.0.19

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/index.js CHANGED
@@ -6501,6 +6501,30 @@ class TerrainToggleControl {
6501
6501
  }
6502
6502
  }
6503
6503
 
6504
+ const DrawCacheFeatureManager = {
6505
+ _SourceId: 'drawCache',
6506
+ _id: '',
6507
+ constructor: (options) => {
6508
+ if (options.SourceId) DrawCacheFeatureManager._SourceId = options.SourceId;
6509
+ },
6510
+ on: (map, id) => {
6511
+ if (!map.getSource(DrawCacheFeatureManager._SourceId)) return
6512
+ console.log(`output->map.loaded()`, map.loaded());
6513
+ DrawCacheFeatureManager._id && map.setFeatureState({ source: DrawCacheFeatureManager._SourceId, id: DrawCacheFeatureManager._id }, { hover: false });
6514
+ map.setFeatureState({ source: DrawCacheFeatureManager._SourceId, id: id }, { hover: true });
6515
+ DrawCacheFeatureManager._id = id;
6516
+ // console.log(`output->成功高亮ID`, parseInt(id))
6517
+
6518
+ },
6519
+ off: (map, id) => {
6520
+ if (!map.getSource(DrawCacheFeatureManager._SourceId)) return
6521
+ DrawCacheFeatureManager._id && map.setFeatureState({ source: DrawCacheFeatureManager._SourceId, id: DrawCacheFeatureManager._id }, { hover: false });
6522
+ id && map.setFeatureState({ source: DrawCacheFeatureManager._SourceId, id: id }, { hover: false });
6523
+ DrawCacheFeatureManager._id = '';
6524
+ // console.log(`output->成功恢复常态ID`, parseInt(id))
6525
+ }
6526
+ };
6527
+
6504
6528
  const taskQueue = [];
6505
6529
  const addTask = (task) => {
6506
6530
  taskQueue.push(task);
@@ -6562,5 +6586,5 @@ const useDrawCache = () => {
6562
6586
  }
6563
6587
  };
6564
6588
 
6565
- export { CustomOptionsControl, CustomToggleControl, RainteeConstants, RainteeGISUtil, RainteeSourceMapTool, RasterLayerControl, TerrainToggleControl, useDrawCache };
6589
+ export { CustomOptionsControl, CustomToggleControl, DrawCacheFeatureManager, RainteeConstants, RainteeGISUtil, RainteeSourceMapTool, RasterLayerControl, TerrainToggleControl, useDrawCache };
6566
6590
  //# sourceMappingURL=index.js.map