Web Developer Work - I
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
621 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. // MapViewManager.ts
  2. import { JimuMapView } from 'jimu-arcgis';
  3. class MapViewManager {
  4. private static instance: MapViewManager;
  5. private mapView: JimuMapView | null = null;
  6. private constructor() { }
  7. static getInstance(): MapViewManager {
  8. if (!MapViewManager.instance) {
  9. MapViewManager.instance = new MapViewManager();
  10. }
  11. return MapViewManager.instance;
  12. }
  13. setMapView(view: JimuMapView) {
  14. this.mapView = view;
  15. }
  16. getMapView(): JimuMapView | null {
  17. return this.mapView;
  18. }
  19. }
  20. export const mapViewManager = MapViewManager.getInstance();