gisviewer-vue3-arcgis 1.0.165 → 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 (40) hide show
  1. package/es/_virtual/_plugin-vue_export-helper.mjs +9 -0
  2. package/es/src/gis-map/gis-map.vue.d.ts +120 -0
  3. package/es/src/gis-map/gis-map.vue.mjs +142 -128
  4. package/es/src/gis-map/index.d.ts +120 -0
  5. package/es/src/gis-map/stores/appData.d.ts +2 -0
  6. package/es/src/gis-map/stores/appData.mjs +4 -2
  7. package/es/src/gis-map/utils/common-utils.mjs +5 -5
  8. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +93 -0
  9. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.mjs +7 -0
  10. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue2.mjs +121 -0
  11. package/es/src/gis-map/utils/holo-flow/signal-countdown-panel.vue3.mjs +4 -0
  12. package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +14 -0
  13. package/es/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.mjs +123 -33
  14. package/es/src/gis-map/utils/holo-flow/trace-renderer-layer.mjs +102 -99
  15. package/es/src/gis-map/utils/map-initializer.d.ts +1 -0
  16. package/es/src/gis-map/utils/map-initializer.mjs +135 -127
  17. package/es/src/gis-map/utils/open-drive-renderer/index.mjs +10 -10
  18. package/es/src/gis-map/utils/traffic-flow.mjs +5 -4
  19. package/es/src/types/index.d.ts +22 -0
  20. package/es/style.css +1 -1
  21. package/lib/_virtual/_plugin-vue_export-helper.js +1 -0
  22. package/lib/src/gis-map/gis-map.vue.d.ts +120 -0
  23. package/lib/src/gis-map/gis-map.vue.js +1 -1
  24. package/lib/src/gis-map/index.d.ts +120 -0
  25. package/lib/src/gis-map/stores/appData.d.ts +2 -0
  26. package/lib/src/gis-map/stores/appData.js +1 -1
  27. package/lib/src/gis-map/utils/common-utils.js +1 -1
  28. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.d.ts +93 -0
  29. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue.js +1 -0
  30. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue2.js +1 -0
  31. package/lib/src/gis-map/utils/holo-flow/signal-countdown-panel.vue3.js +1 -0
  32. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.d.ts +14 -0
  33. package/lib/src/gis-map/utils/holo-flow/signal-holo-flow-lsr.js +1 -1
  34. package/lib/src/gis-map/utils/holo-flow/trace-renderer-layer.js +1 -1
  35. package/lib/src/gis-map/utils/map-initializer.d.ts +1 -0
  36. package/lib/src/gis-map/utils/map-initializer.js +1 -1
  37. package/lib/src/gis-map/utils/open-drive-renderer/index.js +1 -1
  38. package/lib/src/gis-map/utils/traffic-flow.js +1 -1
  39. package/lib/src/types/index.d.ts +22 -0
  40. package/package.json +1 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@arcgis/core/Graphic"),u=require("@arcgis/core/geometry"),y=require("@arcgis/core/layers/GraphicsLayer"),p=require("../stores/index.js"),m=require("./common-utils.js");class g{constructor(i){this.maxMissCount=2,this.objectMissCount=new Map,this.showVehiclePlate=!0,this.showGroundVehicle=!0,this.showElevatedVehicle=!0,this.showLog=!1,this.focusVehNo="",this.view=i;const t=p.default.useAppDataStore;this.mapConfig=JSON.parse(JSON.stringify(t.mapConfig)),this.objectsLayer=new y,this.view.map.add(this.objectsLayer)}connectTrafficFlow(i,t){var e;this.showVehiclePlate=(t==null?void 0:t.showVehiclePlate)!==!1,this.showLog=(t==null?void 0:t.showTraceLog)===!0,(e=this.webSocket)==null||e.close(),this.webSocket=new WebSocket(i),this.webSocket.onopen=()=>{console.log("websocket连接成功"),this.objectMissCount.clear()},this.webSocket.onclose=()=>{console.log("websocket连接关闭")},this.webSocket.onmessage=o=>{this.handleTrafficFlowData(o.data)}}disconnectTrafficFlow(){var i;(i=this.webSocket)==null||i.close(),this.objectsLayer.removeAll(),this.objectMissCount.clear()}toggleTrafficInfo(i){switch(i.name.toLowerCase()){case"vehiclePlate".toLowerCase():this.showVehiclePlate=i.visible;break}}toggleTrafficObject(i){switch(i.name.toLowerCase()){case"groundVehicle".toLowerCase():this.showGroundVehicle=i.visible;break;case"elevatedVehicle".toLowerCase():this.showElevatedVehicle=i.visible;break}}handleTrafficFlowData(i){const t=m.default.unzip(i);if(!t)return;const e=[],o=[],n=[],c=JSON.parse(t);this.showLog&&console.log(c);const s=c.data||c.rtPositionList;if(!s||s.length===0)return;const b=new Date(c.jgsj).getTime();for(const a of s){const r=this.buildVehicleTrackData(a,b);r&&(this.objectMissCount.has(r.ptcId)?e.push(r):o.push(r),this.objectMissCount.set(r.ptcId,0))}for(const a of this.objectMissCount){const r=a[0];let l=a[1];s.findIndex(d=>d.vehno===r)<0&&(l++,this.objectMissCount.set(r,l),l===this.maxMissCount&&n.push(r))}for(const a of n)this.objectMissCount.delete(a);this.addTrafficObjects(o),this.updateTrafficObjects(e),this.deleteTrafficObjects(n)}addTrafficObjects(i){const t=i.map(e=>new f({geometry:new u.Point({longitude:e.x,latitude:e.y}),symbol:this.createCIMSymbol(e),attributes:e,visible:this.getVehicleVisibility(e)}));this.objectsLayer.addMany(t)}getVehicleVisibility(i){return i.roadLayer==="1"?this.showGroundVehicle:i.roadLayer==="2"||i.roadLayer==="3"?this.showElevatedVehicle:!0}updateTrafficObjects(i){i.forEach(t=>{const e=this.objectsLayer.graphics.find(o=>o.getAttribute("ptcId")===t.ptcId);e&&(e.geometry=new u.Point({longitude:t.x,latitude:t.y}),e.symbol=this.createCIMSymbol(t),e.visible=this.getVehicleVisibility(t))})}createCIMSymbol(i){const t=this.getPlateFontColor(i.plateColor);return{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:"$feature.showName",returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:this.showVehiclePlate,size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-8,ymin:-8,xmax:8,ymax:8},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:4,horizontalAlignment:"Center",offsetX:0,offsetY:8,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:t.backgroundColor}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:t.fillColor}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:15,rotation:i.heading,rotateClockwise:!0,textureFilter:"Picture",url:`${this.mapConfig.assetsRoot}Images/car/${this.getCarPic(i.vehicleColor).pic}`}]}}}}deleteTrafficObjects(i){i.forEach(t=>{const e=this.objectsLayer.graphics.find(o=>o.getAttribute("ptcId")===t);e&&this.objectsLayer.remove(e)})}buildVehicleTrackData(i,t){const{hpys:e,csys:o,lng:n,angle:c,hphm:s,lat:b,cx:a,roadLayer:r}=i,l=i.vehno||i.vehNo;if(!l)return;let h;if(s&&s!=="0"&&s!==0?h=s.includes("-")?s.split("-")[1]:s:h=l.includes("-")?l.split("-")[1]:l,!["1","2","3","4","5","6",1,2,3,4,5,6].includes(a)){console.log("车辆类型错误",a);return}return{ptcId:l,timestamp:t,localTimestamp:t,x:n,y:b,ptcType:Number(a),heading:c,vehicleColor:o||"z",plateColor:s?e:"99",showName:h,vehicleType:99,roadLayer:r||"1"}}getCarPic(i){let t=0;if(this.view.type==="3d"?t=this.view.zoom:t=this.view.zoom,t<=17)return{pic:"point.png",color:[128,128,128,255]};{let e="grey",o=[128,128,128,255];switch(i.toLowerCase()){case"a":e="white",o=[200,200,200,255];break;case"b":e="grey",o=[128,128,128,255];break;case"c":e="yellow",o=[255,215,0,255];break;case"d":e="pink",o=[255,182,193,255];break;case"e":e="red",o=[255,0,0,255];break;case"f":e="purple",o=[128,0,128,255];break;case"g":e="green",o=[124,252,0,255];break;case"h":e="blue",o=[0,191,255,255];break;case"i":e="brown",o=[244,164,96,255];break;case"j":e="black",o=[0,0,0,255];break}return{pic:e+".png",color:o}}}getPlateFontColor(i){let t=[255,255,255,255],e=[169,169,169,255];switch(i){case 0:t=[0,0,0,255],e=[255,255,255,255];break;case 1:t=[0,0,0,255],e=[244,164,96,255];break;case 2:t=[255,255,255,255],e=[65,105,225,255];break;case 3:t=[255,255,255,255],e=[0,0,0,255];break;case 15:t=[244,164,96,255],e=[0,250,154,255];break;case 16:t=[0,0,0,255],e=[0,250,154,255];break}return{fillColor:t,backgroundColor:e}}}exports.default=g;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@arcgis/core/Graphic"),u=require("@arcgis/core/geometry"),y=require("@arcgis/core/layers/GraphicsLayer"),p=require("../stores/index.js"),m=require("./common-utils.js");class g{constructor(i){this.maxMissCount=2,this.objectMissCount=new Map,this.showVehiclePlate=!0,this.showGroundVehicle=!0,this.showElevatedVehicle=!0,this.showLog=!1,this.focusVehNo="",this.view=i;const t=p.default.useAppDataStore;this.mapConfig=JSON.parse(JSON.stringify(t.mapConfig)),this.objectsLayer=new y,this.view.map.add(this.objectsLayer)}connectTrafficFlow(i,t){var e;this.showVehiclePlate=(t==null?void 0:t.showVehiclePlate)!==!1,this.showLog=(t==null?void 0:t.showTraceLog)===!0,(e=this.webSocket)==null||e.close(),this.webSocket=new WebSocket(i),this.webSocket.onopen=()=>{console.log("websocket连接成功"),this.objectMissCount.clear()},this.webSocket.onclose=()=>{console.log("websocket连接关闭")},this.webSocket.onmessage=o=>{this.handleTrafficFlowData(o.data)}}disconnectTrafficFlow(){var i;(i=this.webSocket)==null||i.close(),this.objectsLayer.removeAll(),this.objectMissCount.clear()}toggleTrafficInfo(i){switch(i.name.toLowerCase()){case"vehiclePlate".toLowerCase():this.showVehiclePlate=i.visible;break}}toggleTrafficObject(i){switch(i.name.toLowerCase()){case"groundVehicle".toLowerCase():this.showGroundVehicle=i.visible;break;case"elevatedVehicle".toLowerCase():this.showElevatedVehicle=i.visible;break}}handleTrafficFlowData(i){const t=m.default.unzip(i);if(!t)return;const e=[],o=[],n=[],c=JSON.parse(t);this.showLog&&console.log(c);const s=c.data||c.rtPositionList;if(!s||s.length===0)return;const b=new Date(c.jgsj).getTime();for(const a of s){const r=this.buildVehicleTrackData(a,b);r&&(this.objectMissCount.has(r.ptcId)?e.push(r):o.push(r),this.objectMissCount.set(r.ptcId,0))}for(const a of this.objectMissCount){const r=a[0];let l=a[1];s.findIndex(d=>d.vehno===r)<0&&(l++,this.objectMissCount.set(r,l),l===this.maxMissCount&&n.push(r))}for(const a of n)this.objectMissCount.delete(a);this.addTrafficObjects(o),this.updateTrafficObjects(e),this.deleteTrafficObjects(n)}addTrafficObjects(i){const t=i.map(e=>new f({geometry:new u.Point({longitude:e.x,latitude:e.y}),symbol:this.createCIMSymbol(e),attributes:e,visible:this.getVehicleVisibility(e)}));this.objectsLayer.addMany(t)}getVehicleVisibility(i){return i.roadLayer==="1"?this.showGroundVehicle:i.roadLayer==="2"||i.roadLayer==="3"?this.showElevatedVehicle:!0}updateTrafficObjects(i){i.forEach(t=>{const e=this.objectsLayer.graphics.find(o=>o.getAttribute("ptcId")===t.ptcId);e&&(e.geometry=new u.Point({longitude:t.x,latitude:t.y}),e.symbol=this.createCIMSymbol(t),e.visible=this.getVehicleVisibility(t))})}createCIMSymbol(i){const t=this.getPlateFontColor(i.plateColor);return{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:"$feature.showName",returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:this.showVehiclePlate,size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-8,ymin:-8,xmax:8,ymax:8},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:4,horizontalAlignment:"Center",offsetX:0,offsetY:8,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:t.backgroundColor}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:t.fillColor}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:15,rotation:i.heading,rotateClockwise:!0,textureFilter:"Picture",url:`${this.mapConfig.assetsRoot}Images/car/${this.getCarPic(i.vehicleColor).pic}`}]}}}}deleteTrafficObjects(i){i.forEach(t=>{const e=this.objectsLayer.graphics.find(o=>o.getAttribute("ptcId")===t);e&&this.objectsLayer.remove(e)})}buildVehicleTrackData(i,t){const{hpys:e,csys:o,lng:n,angle:c,hphm:s,lat:b,cx:a,roadLayer:r}=i,l=i.vehno||i.vehNo;if(!l)return;let h;if(s&&s!=="0"&&s!==0?h=s.includes("-")?s.split("-")[1]:s:h=l.includes("-")?l.split("-")[1]:l,!["1","2","3","4","5","6",1,2,3,4,5,6].includes(a)){console.log("车辆类型错误",a);return}return{vehicleId:l,ptcId:l,timestamp:t,localTimestamp:t,x:n,y:b,ptcType:Number(a),heading:c,vehicleColor:o||"z",plateColor:s?e:"99",showName:h,vehicleType:99,roadLayer:r||"1"}}getCarPic(i){let t=0;if(this.view.type==="3d"?t=this.view.zoom:t=this.view.zoom,t<=17)return{pic:"point.png",color:[128,128,128,255]};{let e="grey",o=[128,128,128,255];switch(i.toLowerCase()){case"a":e="white",o=[200,200,200,255];break;case"b":e="grey",o=[128,128,128,255];break;case"c":e="yellow",o=[255,215,0,255];break;case"d":e="pink",o=[255,182,193,255];break;case"e":e="red",o=[255,0,0,255];break;case"f":e="purple",o=[128,0,128,255];break;case"g":e="green",o=[124,252,0,255];break;case"h":e="blue",o=[0,191,255,255];break;case"i":e="brown",o=[244,164,96,255];break;case"j":e="black",o=[0,0,0,255];break}return{pic:e+".png",color:o}}}getPlateFontColor(i){let t=[255,255,255,255],e=[169,169,169,255];switch(i){case 0:t=[0,0,0,255],e=[255,255,255,255];break;case 1:t=[0,0,0,255],e=[244,164,96,255];break;case 2:t=[255,255,255,255],e=[65,105,225,255];break;case 3:t=[255,255,255,255],e=[0,0,0,255];break;case 15:t=[244,164,96,255],e=[0,250,154,255];break;case 16:t=[0,0,0,255],e=[0,250,154,255];break}return{fillColor:t,backgroundColor:e}}}exports.default=g;
@@ -247,3 +247,25 @@ export interface IJunctionTableData {
247
247
  crossId?: string;
248
248
  factoryCode?: string;
249
249
  }
250
+ export interface ISignalCountdownProps {
251
+ displayMode: string;
252
+ crossId: string;
253
+ roadId: string;
254
+ mapPoint: number[];
255
+ stopLine: number[][];
256
+ position: {
257
+ left: number;
258
+ top: number;
259
+ };
260
+ rotation: number;
261
+ lampStatus: {
262
+ uNumber?: number;
263
+ uColor?: string;
264
+ lNumber?: number;
265
+ lColor?: string;
266
+ sNumber?: number;
267
+ sColor?: string;
268
+ rNumber?: number;
269
+ rColor?: string;
270
+ };
271
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gisviewer-vue3-arcgis",
3
- "version": "1.0.165",
3
+ "version": "1.0.167",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [