gisviewer-vue3-arcgis 1.0.166 → 1.0.167

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.
Files changed (26) hide show
  1. package/es/src/gis-map/gis-map.vue.d.ts +11 -2
  2. package/es/src/gis-map/gis-map.vue.mjs +26 -23
  3. package/es/src/gis-map/index.d.ts +11 -2
  4. package/es/src/gis-map/utils/common-utils.mjs +9 -9
  5. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +9 -1
  6. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.mjs +1 -1
  7. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue2.mjs +6 -5
  8. package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +1 -0
  9. package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.mjs +103 -73
  10. package/es/src/gis-map/utils/map-initializer.d.ts +1 -0
  11. package/es/src/gis-map/utils/map-initializer.mjs +121 -122
  12. package/es/src/types/index.d.ts +1 -0
  13. package/es/style.css +1 -1
  14. package/lib/src/gis-map/gis-map.vue.d.ts +11 -2
  15. package/lib/src/gis-map/gis-map.vue.js +1 -1
  16. package/lib/src/gis-map/index.d.ts +11 -2
  17. package/lib/src/gis-map/utils/common-utils.js +1 -1
  18. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +9 -1
  19. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.js +1 -1
  20. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue2.js +1 -1
  21. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +1 -0
  22. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.js +1 -1
  23. package/lib/src/gis-map/utils/map-initializer.d.ts +1 -0
  24. package/lib/src/gis-map/utils/map-initializer.js +1 -1
  25. package/lib/src/types/index.d.ts +1 -0
  26. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const h=require("@arcgis/core/core/reactiveUtils"),f=require("@arcgis/core/geometry"),P=require("@arcgis/core/layers/GraphicsLayer"),g=require("@turf/bearing"),y=require("@turf/destination"),m=require("@turf/helpers"),w=require("../../stores/index.js"),L=require("../common-utils.js"),S=require("./signal-holo-flow.js");function d(p){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const n in p)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(p,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:()=>p[n]})}}return t.default=p,Object.freeze(t)}const v=d(h),u=d(m);class M extends S.default{constructor(t){super(t),this.stopLineLayer=new P,this.store=w.default.useAppDataStore,this.stopLineMap=new Map,this.view.map.add(this.stopLineLayer)}async initializeLayer(){var a,c;console.time("初始化停止线图层");let t=(c=(a=this.mapConfig.holoFlow)==null?void 0:a.signal)==null?void 0:c.stopLineLayer;if(!t)return;t=this.mapConfig.assetsRoot+"/"+t,(await(await fetch(t)).json()).features.forEach(e=>{const{roadId:s,nodeId:o}=e.properties,{coordinates:r}=e.geometry,l=this.stopLineMap.get(o);l?l.set(s,r):this.stopLineMap.set(o,new Map([[s,r]]))}),console.timeEnd("初始化停止线图层"),v.watch(()=>this.view.extent,()=>{for(const e of this.store.countdownPanels){const{mapPoint:s,stopLine:o}=e,r=this.view.toScreen({type:"point",x:s[0],y:s[1]});e.position.left=r.x,e.position.top=r.y;const l=this.getPanelRotation(o);e.rotation=l}})}async handleSignalData(t){const{crossId:n,roadId:i,lampStatus:a}=t,c=this.stopLineMap.get(n);if(!c)return;const e=c.get(i);if(!e)return;const s=this.store.countdownPanels.find(o=>o.crossId===n&&o.roadId===i);if(s)s.lampStatus=a;else{const o=this.getPanelPoint(e),r=this.view.toScreen({type:"point",x:o[0],y:o[1]}),l=this.getPanelRotation(e);this.store.countdownPanels.push({crossId:n,roadId:i,mapPoint:o,stopLine:e,position:{left:r.x,top:r.y},rotation:l,lampStatus:a})}}clearSignal(){this.stopLineLayer.removeAll()}getPanelPoint(t){const n=L.default.getCenterPointInLine(t),i=t[0],a=t[t.length-1];let e=g(u.point(i),u.point(a))-90;return e<-180&&(e+=360),y(u.point(n),1,e,{units:"meters"}).geometry.coordinates}getPanelRotation(t){const n=t[0],i=new f.Point({x:n[0],y:n[1],spatialReference:this.view.spatialReference}),a=this.view.toScreen(i),c=t[t.length-1],e=new f.Point({x:c[0],y:c[1],spatialReference:this.view.spatialReference}),s=this.view.toScreen(e),o=s.x-a.x,r=s.y-a.y;return Math.atan2(r,o)*(180/Math.PI)}}exports.default=M;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=require("@arcgis/core/core/reactiveUtils"),w=require("@arcgis/core/geometry"),S=require("@arcgis/core/layers/GraphicsLayer"),L=require("@turf/bearing"),R=require("@turf/destination"),v=require("@turf/helpers"),M=require("../../stores/index.js"),b=require("../common-utils.js"),x=require("./signal-holo-flow.js");function P(h){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const t in h)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(h,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>h[t]})}}return e.default=h,Object.freeze(e)}const C=P(y),m=P(v);class T extends x.default{constructor(e){super(e),this.stopLineLayer=new S,this.store=M.default.useAppDataStore,this.watchHandle=null,this.stopLineMap=new Map,this.view.map.add(this.stopLineLayer)}async initializeLayer(){var p,f;console.time("初始化停止线图层");let e=(f=(p=this.mapConfig.holoFlow)==null?void 0:p.signal)==null?void 0:f.stopLineLayer;if(!e)return;e=this.mapConfig.assetsRoot+"/"+e,(await(await fetch(e)).json()).features.forEach(a=>{const{roadId:o,nodeId:s}=a.properties,{coordinates:r}=a.geometry,n=this.stopLineMap.get(s);n?n.set(o,r):this.stopLineMap.set(s,new Map([[o,r]]))}),console.timeEnd("初始化停止线图层")}async handleSignalData(e){this.watchHandle||(this.watchHandle=C.watch(()=>this.view.extent,()=>{for(const o of this.store.countdownPanels){const{mapPoint:s}=o,r=this.view.toScreen({type:"point",x:s[0],y:s[1]});o.position.left=r.x,o.position.top=r.y}}));const t=e.crossId,i=e.rtStage,p=e.nonCurStageRemainingTime,f=e.allStageFlows;console.log(t,i,p,f);const a=new Map;f.forEach(o=>{const{stageId:s,stageFlows:r}=o;let n="green",u=i.stageRemainingTime;if(s===i.stageId)u<=i.stageAllRedTime?n="red":i.stageYellowTime!==0&&u<=i.stageYellowTime+i.stageAllRedTime&&(n="yellow");else{n="red";const l=p.find(g=>g.stageId===s);u=l?l.stageNextRunRemainingTime:0}r.forEach(l=>{let{fromRoadId:g}=l;g.startsWith("-")&&(g=g.slice(1));const d=l.direction.toLowerCase();let c=a.get(g);c||(c={},a.set(g,c)),d==="u"?(c.uNumber=u,c.uColor=n):d==="l"?(c.lNumber=u,c.lColor=n):d==="s"?(c.sNumber=u,c.sColor=n):d==="r"&&(c.rNumber=u,c.rColor=n==="yellow"?"red":n)})}),a.forEach((o,s)=>{console.log(s,o);const r=this.stopLineMap.get(t);if(!r){console.error(`路口${t}没有找到对应的停止线`);return}const n=r.get(s);if(!n){console.error(`路口${t}的进口道${s}没有找到对应的停止线`);return}const u=this.store.countdownPanels.find(l=>l.crossId===t&&l.roadId===s);if(u)u.lampStatus=o;else{const l=this.getPanelPoint(n),g=this.view.toScreen({type:"point",x:l[0],y:l[1]}),d=this.getPanelRotation(n);this.store.countdownPanels.push({displayMode:"complete",crossId:t,roadId:s,mapPoint:l,stopLine:n,position:{left:g.x,top:g.y},rotation:d,lampStatus:o})}})}clearSignal(){var e;this.stopLineLayer.removeAll(),this.store.countdownPanels=[],(e=this.watchHandle)==null||e.remove(),this.watchHandle=null}getPanelPoint(e){const t=b.default.getCenterPointInLine(e),i=e[0],p=e[e.length-1];let a=L(m.point(i),m.point(p))-90;return a<-180&&(a+=360),R(m.point(t),1,a,{units:"meters"}).geometry.coordinates}getPanelRotation(e){const t=e[0],i=new w.Point({x:t[0],y:t[1],spatialReference:this.view.spatialReference}),p=this.view.toScreen(i),f=e[e.length-1],a=new w.Point({x:f[0],y:f[1],spatialReference:this.view.spatialReference}),o=this.view.toScreen(a),s=o.x-p.x,r=o.y-p.y;return Math.atan2(r,s)*(180/Math.PI)}}exports.default=T;
@@ -11,6 +11,7 @@ export default class MapInitializer {
11
11
  */
12
12
  initialize(params: {
13
13
  container: HTMLElement;
14
+ mapConfig: any;
14
15
  markerClickCallback?: (type: string, id: string, detail: any, event?: any) => void;
15
16
  mapClickCallback?: (mapPoint: number[], screenPoint: number[], event?: any) => void;
16
17
  }): Promise<MapView | SceneView>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const P=require("@arcgis/core/Basemap"),b=require("@arcgis/core/config"),q=require("@arcgis/core/core/reactiveUtils"),g=require("@arcgis/core/geometry"),L=require("@arcgis/core/geometry/support/webMercatorUtils"),z=require("@arcgis/core/layers/GeoJSONLayer"),O=require("@arcgis/core/layers/MapImageLayer"),W=require("@arcgis/core/layers/TileLayer"),S=require("@arcgis/core/layers/WebTileLayer"),x=require("@arcgis/core/Map"),I=require("@arcgis/core/views/MapView"),R=require("@arcgis/core/views/SceneView"),H=require("@turf/destination"),N=require("@turf/helpers"),_=require("../stores/index.js"),C=require("./custom-layer/custom-wmts-layer.js");function y(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const i in r)if(i!=="default"){const t=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(e,i,t.get?t:{enumerable:!0,get:()=>r[i]})}}return e.default=r,Object.freeze(e)}const k=y(q),d=y(L),G=y(N);function T(r,e){return r&&(r.startsWith("http://")||r.startsWith("https://")?r:e+r)}class j{constructor(){this.mapConfig={},this.watchHandleMap=new Map,this.handleIndex=0,this.zoomWatchHandle=null}async initialize(e){const i=_.default.useAppDataStore,t=JSON.parse(JSON.stringify(i.mapConfig));this.mapConfig=t;const{container:o,markerClickCallback:l,mapClickCallback:f}=e;b.assetsPath=`${t.assetsRoot}/ArcgisAssets`,b.fontsUrl=`${t.assetsRoot}/fonts`,b.apiKey="AAPKf5a3e1044d7a4faeb3b1ec7060f5c68equIrP2KbRyL-t_b40Kk4GTWUQ1BFCyttvyQPQnWpFmBd7kp9gkrVihjfmcKBwxjW";const c=new x;if((t==null?void 0:t.mapOptions.mode.toLowerCase())==="2d"?this.view=new I({map:c,container:o,...t.mapOptions}):this.view=new R({map:c,container:o,environment:{atmosphereEnabled:!0,lighting:{type:"virtual"}},...t==null?void 0:t.mapOptions}),this.view.popup.visibleElements={closeButton:!0,collapseButton:!1,actionBar:!1,featureNavigation:!1},this.view.popup.dockOptions={buttonEnabled:!1,breakpoint:!1},this.view.on("click",async s=>{var v,M;if(f){let a=s.mapPoint;a.spatialReference.isWebMercator&&(a=d.webMercatorToGeographic(a)),f([a.x,a.y],[s.screenPoint.x,s.screenPoint.y],s)}if(this.view.type==="3d"){const a=this.view.camera;if(this.view.spatialReference.isWebMercator){const u=d.webMercatorToGeographic(a.position),p={heading:a.heading,tilt:a.tilt,position:u.toJSON()};console.log(p),(v=navigator.clipboard)==null||v.writeText(JSON.stringify(p))}else console.log(a.toJSON());console.log(this.view.zoom,this.view.scale)}else{let a=this.view.center;this.view.spatialReference.isWebMercator&&(a=d.webMercatorToGeographic(a)),console.log({center:a.toJSON(),zoom:this.view.zoom,scale:this.view.scale})}const n=(M=(await this.view.hitTest(s)).results)==null?void 0:M.filter(a=>a.type==="graphic");n.length>0&&n.forEach(a=>{var p;const u=a.graphic;(p=u.attributes)!=null&&p.type&&l&&l(u.attributes.type,u.attributes.id,u.attributes,s)})}),t!=null&&t.baseLayers?(console.log(t.baseLayers),t.baseLayers.forEach(s=>{const h=T(s.url,t.assetsRoot);switch(s.type.toLowerCase()){case"webTile".toLowerCase():{const n=new S({urlTemplate:h,...s.options});c.add(n);break}case"tile":{const n=new W({url:h,...s.options});c.add(n);break}case"customWMTS".toLowerCase():{const n=new C.default({urlTemplate:h,...s.options});c.add(n);break}case"mapImage".toLowerCase():{const n=new O({url:h,...s.options});c.add(n),console.log(n);break}case"arcgis":{const n=new P(s.options);c.basemap=n;break}}})):c.basemap=new P({style:{id:"arcgis/light-gray",language:"zh-CN"}}),t!=null&&t.hdLayers){const s=t.hdLayers.map(h=>new z({url:T(h.url,t.assetsRoot),...h.options,title:h.options.id}));c.addMany(s)}this.view.ui.remove("attribution"),this.view.ui.add("compass","top-left"),await this.view.when();const w=this.mapConfig.camera;let m;if(this.view.type==="2d"){let s=this.view.center;this.view.spatialReference.isWebMercator&&(s=d.webMercatorToGeographic(s)),m={center:[s.x,s.y],zoom:this.view.zoom}}else{let s=this.view.camera.position;this.view.spatialReference.isWebMercator&&(s=d.webMercatorToGeographic(s)),m={position:s,heading:this.view.camera.heading,tilt:this.view.camera.tilt}}return w?w.home=m:this.mapConfig.camera={home:m},this.view}setLayerVisibility(e){const{id:i,visible:t}=e,o=this.view.map.findLayerById(i);return o?(o.visible=t,{status:0,message:"ok"}):{status:-1,message:"未找到图层"}}async setMapCenter(e){var i;if(!this.view)return{status:-1,message:"未初始化"};if(e.center||e.target){switch((i=e.target)==null?void 0:i.type){case"point":e.target=new g.Point(e.target);break;case"polyline":e.target=new g.Polyline(e.target);break;case"polygon":e.target=new g.Polygon(e.target);break}await this.view.goTo(e,{duration:(e.duration||0)*1e3})}return{status:0,message:"成功"}}async lookAt(e){if(this.view.type==="2d")return;const i=e.tilt||0,t=e.heading||0;if(i===0)await this.view.goTo({position:{x:e.center[0],y:e.center[1],z:e.height},heading:t,tilt:0},{duration:(e.duration||2)*1e3});else{const o=Math.tan(i*Math.PI/180)*e.height,l=H(G.point(e.center),o,t+180,{units:"meters"});await this.view.goTo({position:{x:l.geometry.coordinates[0],y:l.geometry.coordinates[1],z:e.height},heading:t,tilt:i},{duration:(e.duration||2)*1e3})}}async setMapCamera(e){if(!this.view)return{status:-1,message:"未初始化"};const{name:i,duration:t=0}=e,{camera:o}=this.mapConfig;if(!o)return{status:-1,message:"未配置camera"};const l=o[i];return l?(await this.view.goTo(l,{duration:t*1e3}),{status:0,message:"成功"}):{status:-1,message:"未配置camera"}}requestCoordinateTransform(e,i){let t=0;const l=1e3/30,f=k.watch(()=>this.view.center,()=>{const c=this.transformPoints(e),w=Date.now();w-t>l&&(i(c),t=w)});return this.handleIndex++,this.watchHandleMap.set(this.handleIndex,f),{handle:this.handleIndex,points:this.transformPoints(e)}}transformPoints(e){return e.map(i=>{const t=new g.Point({x:i[0],y:i[1]}),o=this.view.toScreen(t);return[o.x,o.y]})}cancelCoordinateTransform(e){const i=this.watchHandleMap.get(e);i&&(i.remove(),this.watchHandleMap.delete(e))}setMapZoomRange(e){const{min:i,max:t}=e;!i&&!t||(this.zoomWatchHandle&&this.zoomWatchHandle.remove(),this.zoomWatchHandle=k.watch(()=>this.view.zoom,o=>{i&&o<=i&&(this.view.zoom=i),t&&o>=t&&(this.view.zoom=t)}))}}exports.default=j;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("@arcgis/core/Basemap"),d=require("@arcgis/core/config"),z=require("@arcgis/core/core/reactiveUtils"),g=require("@arcgis/core/geometry"),L=require("@arcgis/core/geometry/support/webMercatorUtils"),W=require("@arcgis/core/layers/GeoJSONLayer"),O=require("@arcgis/core/layers/MapImageLayer"),x=require("@arcgis/core/layers/TileLayer"),I=require("@arcgis/core/layers/WebTileLayer"),S=require("@arcgis/core/Map"),R=require("@arcgis/core/views/MapView"),H=require("@arcgis/core/views/SceneView"),_=require("@turf/destination"),G=require("@turf/helpers"),j=require("./custom-layer/custom-wmts-layer.js");function b(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,s.get?s:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const T=b(z),m=b(L),B=b(G);function q(r,e){return r&&(r.startsWith("http://")||r.startsWith("https://")?r:e+r)}class N{constructor(){this.mapConfig={},this.watchHandleMap=new Map,this.handleIndex=0,this.zoomWatchHandle=null}async initialize(e){var u,y,v,M;this.mapConfig=e.mapConfig;const{container:t,markerClickCallback:s,mapClickCallback:o}=e;d.assetsPath=`${this.mapConfig.assetsRoot}/ArcgisAssets`,d.fontsUrl=`${this.mapConfig.assetsRoot}/fonts`,d.apiKey="AAPKf5a3e1044d7a4faeb3b1ec7060f5c68equIrP2KbRyL-t_b40Kk4GTWUQ1BFCyttvyQPQnWpFmBd7kp9gkrVihjfmcKBwxjW";const n=new S;if(((u=this.mapConfig)==null?void 0:u.mapOptions.mode.toLowerCase())==="2d"?this.view=new R({map:n,container:t,...this.mapConfig.mapOptions}):this.view=new H({map:n,container:t,environment:{atmosphereEnabled:!0,lighting:{type:"virtual"}},...(y=this.mapConfig)==null?void 0:y.mapOptions}),this.view.popup.visibleElements={closeButton:!0,collapseButton:!1,actionBar:!1,featureNavigation:!1},this.view.popup.dockOptions={buttonEnabled:!1,breakpoint:!1},this.view.on("click",async i=>{var C,P;if(o){let a=i.mapPoint;a.spatialReference.isWebMercator&&(a=m.webMercatorToGeographic(a)),o([a.x,a.y],[i.screenPoint.x,i.screenPoint.y],i)}if(this.view.type==="3d"){const a=this.view.camera;if(this.view.spatialReference.isWebMercator){const p=m.webMercatorToGeographic(a.position),f={heading:a.heading,tilt:a.tilt,position:p.toJSON()};console.log(f),(C=navigator.clipboard)==null||C.writeText(JSON.stringify(f))}else console.log(a.toJSON());console.log(this.view.zoom,this.view.scale)}else{let a=this.view.center;this.view.spatialReference.isWebMercator&&(a=m.webMercatorToGeographic(a)),console.log({center:a.toJSON(),zoom:this.view.zoom,scale:this.view.scale})}const c=(P=(await this.view.hitTest(i)).results)==null?void 0:P.filter(a=>a.type==="graphic");c.length>0&&c.forEach(a=>{var f;const p=a.graphic;(f=p.attributes)!=null&&f.type&&s&&s(p.attributes.type,p.attributes.id,p.attributes,i)})}),(v=this.mapConfig)!=null&&v.baseLayers?this.mapConfig.baseLayers.forEach(i=>{const l=q(i.url,this.mapConfig.assetsRoot);switch(i.type.toLowerCase()){case"webTile".toLowerCase():{const c=new I({urlTemplate:l,...i.options});n.add(c);break}case"tile":{const c=new x({url:l,...i.options});n.add(c);break}case"customWMTS".toLowerCase():{const c=new j.default({urlTemplate:l,...i.options});n.add(c);break}case"mapImage".toLowerCase():{const c=new O({url:l,...i.options});n.add(c);break}case"arcgis":{const c=new k(i.options);n.basemap=c;break}}}):n.basemap=new k({style:{id:"arcgis/light-gray",language:"zh-CN"}}),(M=this.mapConfig)!=null&&M.hdLayers){const i=this.mapConfig.hdLayers.map(l=>new W({url:q(l.url,this.mapConfig.assetsRoot),...l.options,title:l.options.id}));n.addMany(i)}this.view.ui.remove("attribution"),await this.view.when();const w=this.mapConfig.camera;let h;if(this.view.type==="2d"){let i=this.view.center;this.view.spatialReference.isWebMercator&&(i=m.webMercatorToGeographic(i)),h={center:[i.x,i.y],zoom:this.view.zoom}}else{let i=this.view.camera.position;this.view.spatialReference.isWebMercator&&(i=m.webMercatorToGeographic(i)),h={position:i,heading:this.view.camera.heading,tilt:this.view.camera.tilt}}return w?w.home=h:this.mapConfig.camera={home:h},this.view}setLayerVisibility(e){const{id:t,visible:s}=e,o=this.view.map.findLayerById(t);return o?(o.visible=s,{status:0,message:"ok"}):{status:-1,message:"未找到图层"}}async setMapCenter(e){var t;if(!this.view)return{status:-1,message:"未初始化"};if(e.center||e.target){switch((t=e.target)==null?void 0:t.type){case"point":e.target=new g.Point(e.target);break;case"polyline":e.target=new g.Polyline(e.target);break;case"polygon":e.target=new g.Polygon(e.target);break}await this.view.goTo(e,{duration:(e.duration||0)*1e3})}return{status:0,message:"成功"}}async lookAt(e){if(this.view.type==="2d")return;const t=e.tilt||0,s=e.heading||0;if(t===0)await this.view.goTo({position:{x:e.center[0],y:e.center[1],z:e.height},heading:s,tilt:0},{duration:(e.duration||2)*1e3});else{const o=Math.tan(t*Math.PI/180)*e.height,n=_(B.point(e.center),o,s+180,{units:"meters"});await this.view.goTo({position:{x:n.geometry.coordinates[0],y:n.geometry.coordinates[1],z:e.height},heading:s,tilt:t},{duration:(e.duration||2)*1e3})}}async setMapCamera(e){if(!this.view)return{status:-1,message:"未初始化"};const{name:t,duration:s=0}=e,{camera:o}=this.mapConfig;if(!o)return{status:-1,message:"未配置camera"};const n=o[t];return n?(await this.view.goTo(n,{duration:s*1e3}),{status:0,message:"成功"}):{status:-1,message:"未配置camera"}}requestCoordinateTransform(e,t){let s=0;const n=1e3/30,w=T.watch(()=>this.view.center,()=>{const h=this.transformPoints(e),u=Date.now();u-s>n&&(t(h),s=u)});return this.handleIndex++,this.watchHandleMap.set(this.handleIndex,w),{handle:this.handleIndex,points:this.transformPoints(e)}}transformPoints(e){return e.map(t=>{const s=new g.Point({x:t[0],y:t[1]}),o=this.view.toScreen(s);return[o.x,o.y]})}cancelCoordinateTransform(e){const t=this.watchHandleMap.get(e);t&&(t.remove(),this.watchHandleMap.delete(e))}setMapZoomRange(e){const{min:t,max:s}=e;!t&&!s||(this.zoomWatchHandle&&this.zoomWatchHandle.remove(),this.zoomWatchHandle=T.watch(()=>this.view.zoom,o=>{t&&o<=t&&(this.view.zoom=t),s&&o>=s&&(this.view.zoom=s)}))}}exports.default=N;
@@ -248,6 +248,7 @@ export interface IJunctionTableData {
248
248
  factoryCode?: string;
249
249
  }
250
250
  export interface ISignalCountdownProps {
251
+ displayMode: string;
251
252
  crossId: string;
252
253
  roadId: string;
253
254
  mapPoint: number[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gisviewer-vue3-arcgis",
3
- "version": "1.0.166",
3
+ "version": "1.0.167",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [