gisviewer-vue3-arcgis 1.0.120 → 1.0.121

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.
@@ -281,12 +281,16 @@ class N {
281
281
  async showOpenDriveFromFile(e) {
282
282
  var u, c;
283
283
  this.projectName = Date.now().toString(), this.openDriveServer = e.server;
284
- const o = `http://${this.openDriveServer}/api/openDrive/uploadXodr`, i = await f.post(o, null, {
285
- params: {
286
- url: e.file,
287
- projectName: this.projectName
284
+ const o = `http://${this.openDriveServer}/api/openDrive/uploadXodr`, i = await f.post(
285
+ o,
286
+ {},
287
+ {
288
+ params: {
289
+ url: e.file,
290
+ projectName: this.projectName
291
+ }
288
292
  }
289
- });
293
+ );
290
294
  if (i.status !== 200)
291
295
  throw new Error(`OpenDriveRenderer: ${i.statusText}`);
292
296
  console.time("渲染用时");
@@ -214,7 +214,7 @@ export interface IShowOpenDriveFromFileParams {
214
214
  showJunctionPolygon: boolean;
215
215
  showJunctionLane: boolean;
216
216
  showRoadName: boolean;
217
- centerMap: boolean;
217
+ centerMap?: boolean;
218
218
  };
219
219
  }
220
220
  export interface IFindSumoParams {
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("@arcgis/core/Graphic"),C=require("@arcgis/core/core/promiseUtils"),$=require("@arcgis/core/geometry"),A=require("@arcgis/core/geometry/geometryEngineAsync"),D=require("@arcgis/core/layers/FeatureLayer"),j=require("@arcgis/core/layers/GraphicsLayer"),w=require("axios"),S=require("pako"),O=require("../common-utils.js"),M=require("./wasm-loader.js");function k(p){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const t in p)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(p,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>p[t]})}}return e.default=p,Object.freeze(e)}const P=k(C),N=k(A);class b{constructor(e){this.wasmLoader=M.default.getInstance(),this.projectName="",this.openDriveServer="",this.currentSectionCode="",this.currentJunctionId="",this.view=e,this.laneLayer=new D({id:"OpenDriveLane",fields:[{name:"ObjectID",alias:"ObjectID",type:"oid"},{name:"id",alias:"编号",type:"string"},{name:"roadId",alias:"道路号",type:"string"},{name:"roadName",alias:"道路名称",type:"string"},{name:"sectionId",alias:"路段号",type:"string"},{name:"laneId",alias:"车道号",type:"string"},{name:"type",alias:"类型",type:"string"},{name:"sumoId",alias:"sumo编号",type:"string"}],objectIdField:"ObjectID",geometryType:"polygon",spatialReference:{wkid:4326},source:[],outFields:["*"],renderer:{type:"unique-value",field:"type",defaultSymbol:{type:"simple-fill",color:[100,100,100],style:"solid",outline:{color:"white",width:1}},uniqueValueInfos:[{value:"shoulder",label:"路肩",symbol:{type:"simple-fill",color:"#008000",style:"solid",outline:{color:"white",width:1}}},{value:"border",label:"路沿",symbol:{type:"simple-fill",color:"#DCDCDC",style:"solid",outline:{color:"white",width:1}}},{value:"driving",label:"机动车道",symbol:{type:"simple-fill",color:[47,79,79,.8],style:"solid",outline:{color:"white",width:1}}},{value:"none",label:"无",symbol:{type:"simple-fill",color:[111,120,135],style:"none",outline:{color:"white",width:1}}},{value:"restricted",label:"禁行区",symbol:{type:"simple-fill",color:"yellow",style:"solid",outline:{color:"yellow",width:2}}},{value:"parking",label:"停车区",symbol:{type:"simple-fill",color:[115,115,115],style:"solid",outline:{color:"white",width:1}}},{value:"median",label:"中央隔离带",symbol:{type:"simple-fill",color:"#008000",style:"solid",outline:{color:"white",width:1}}},{value:"biking",label:"非机动车道",symbol:{type:"simple-fill",color:"#D3D3D3",style:"solid",outline:{color:"white",width:1}}},{value:"sidewalk",label:"人行道",symbol:{type:"simple-fill",color:"#C0C0C0",style:"solid",outline:{color:"white",width:1}}},{value:"junction",label:"路口区域",symbol:{type:"simple-fill",color:"#2F4F4F",style:"solid",outline:{color:"white",width:1}}},{value:"selected",label:"选中车道",symbol:{type:"simple-fill",color:[141,168,211],style:"solid",outline:{color:"white",width:1}}}]}}),this.roadNameLayer=new D({id:"OpenDriveRoadName",fields:[{name:"ObjectID",alias:"ObjectID",type:"oid"},{name:"roadId",alias:"道路号",type:"string"},{name:"roadName",alias:"道路名称",type:"string"}],objectIdField:"ObjectID",geometryType:"polyline",spatialReference:{wkid:4326},source:[],renderer:{type:"simple",symbol:{type:"simple-line",style:"solid",color:[0,0,0,0],width:1}},labelingInfo:[{symbol:{type:"text",color:"black",haloColor:"white",haloSize:1,font:{size:12,family:"sans-serif"}},labelPlacement:this.view.type==="2d"?"center-along":void 0,labelExpressionInfo:{expression:"$feature.roadName"}}]}),this.junctionLayer=new j({id:"OpenDriveJunction"}),this.highlightLayer=new j({id:"OpenDriveHighlight"}),this.view.map.addMany([this.laneLayer,this.junctionLayer,this.roadNameLayer,this.highlightLayer])}static getInstance(e){return this.instance||(this.instance=new b(e)),this.instance}async showOpenDriveFromFile(e){var d,c;this.projectName=Date.now().toString(),this.openDriveServer=e.server;const t=`http://${this.openDriveServer}/api/openDrive/uploadXodr`,i=await w.post(t,null,{params:{url:e.file,projectName:this.projectName}});if(i.status!==200)throw new Error(`OpenDriveRenderer: ${i.statusText}`);console.time("渲染用时");const r=i.data.result.geoSetting;O.default.setGeoData(r.geoReference,r.offsetX,r.offsetY);let s=i.data.result.json;s.startsWith(window.location.protocol)||(s=`${window.location.protocol}//${e.server}${s}`);const n=await(await fetch(s)).arrayBuffer(),a=S.inflate(n,{to:"string"}),o=JSON.parse(a);await this.showAllLanes(o,((d=e.options)==null?void 0:d.showJunctionLane)||!1,((c=e.options)==null?void 0:c.showRoadName)||!0);const l=i.data.result.junctions;if(this.showJunction(l),e.options&&e.options.centerMap!==!1){const g=O.default.transformPointProjection([0,0]);await this.view.goTo(g)}return this.mouseMoveHandler||this.monitorMouseMove(),this.mouseClickHandler||this.monitorMouseClick(),console.timeEnd("渲染用时"),{status:0,message:"ok"}}async showOpenDriveFromServer(e,t){const i=`http://${e}/api/openDrive/analyzeXodr`,r=await w.get(i,{headers:{projectName:t},params:{analyze:!1,compressed:!0}});if(r.status!==200)throw new Error(`OpenDriveRenderer: ${r.statusText}`);let s=r.data.result.json;s.startsWith(window.location.protocol)||(s=`${window.location.protocol}//${e}${s}`);const n=await(await fetch(s)).arrayBuffer(),a=S.inflate(n,{to:"string"}),o=JSON.parse(a);return await this.showAllLanes(o,!1,!1),{status:0,message:"ok"}}async showAllLanes(e,t,i){const r=await this.laneLayer.queryFeatures();return r.features.length>0&&this.laneLayer.applyEdits({deleteFeatures:r.features}),this.roadNameLayer.visible=i,new Promise(s=>{let h=0;this.allLaneGraphics=[],this.allRefLineGraphics=[];const n=[];for(const o of e){if(!t&&o.junction!=="-1")continue;const{id:l,refLine:d}=o;let c=o.name;c.includes("(")&&(c=c.slice(0,c.indexOf("("))),c=c.replace(/(.)/g,"$1 ");const g=new u({geometry:{type:"polyline",paths:[d]},attributes:{ObjectID:h++,roadId:l,roadName:c}});this.allRefLineGraphics.push(g);for(const v of o.laneSections){const I=Number(v.id);for(const y of v.lanePaths){const m=Number(y.id);if(m===0)continue;const F=y.type,f=y.innerPath.concat(y.outerPath.reverse());if(f.length<=3){console.warn(`lane ${m} has less than 3 points`);continue}f.push(y.innerPath[0]);const L=new $.Polygon({rings:[f]});if(L){const G=new u({geometry:L,attributes:{ObjectID:h++,id:`${l}+${I}+${m}`,roadId:l,roadName:o.name,sectionId:I,laneId:m,type:F,sumoId:""}});this.allLaneGraphics.push(G),n.push(G)}}}}const a=setInterval(()=>{if(n.length>0||this.allRefLineGraphics.length>0){if(n.length>0){const o=n.splice(0,100);this.laneLayer.applyEdits({addFeatures:o})}if(this.allRefLineGraphics.length>0){const o=this.allRefLineGraphics.splice(0,10);this.roadNameLayer.applyEdits({addFeatures:o})}}else clearInterval(a),s()},10)})}showJunction(e){const t=[];for(const i of e){const r=new u({geometry:{type:"point",x:i.coordinates[0],y:i.coordinates[1]},attributes:{...i,selected:!1},symbol:{type:"picture-marker",url:i.crossId?"/GisViewerAssets/Images/point_green.png":"/GisViewerAssets/Images/normal-cross.png",width:30,height:30}});t.push(r)}this.junctionLayer.addMany(t)}monitorMouseMove(){const e=P.debounce(async t=>{var h;const r=(h=(await this.view.hitTest(t,{include:[this.laneLayer,this.junctionLayer]})).results)==null?void 0:h.filter(n=>n.type==="graphic");if(r.length===0){this.currentSectionCode!==""&&(this.currentSectionCode="",this.highlightGraphic=void 0,this.highlightLayer.removeAll()),this.currentJunctionId!==""&&(this.currentJunctionId="",this.highlightGraphic=void 0,this.highlightLayer.removeAll());return}const s=r[0];if(this.hitGraphic=s.graphic,s.layer.id==="OpenDriveLane"){const n=`${this.hitGraphic.attributes.roadId}+${this.hitGraphic.attributes.sectionId}`;if(n===this.currentSectionCode)return;this.currentSectionCode=n;const a=this.allLaneGraphics.filter(l=>`${l.attributes.roadId}+${l.attributes.sectionId}`===n),o=await N.union(a.map(l=>l.geometry));this.highlightGraphic=new u({geometry:o,symbol:{type:"simple-fill",color:[255,0,0,.5],style:"solid",outline:{color:"red",width:2}},attributes:{type:"OpenDriveSection",id:n,detail:""}}),this.highlightLayer.removeAll(),this.highlightLayer.add(this.highlightGraphic)}else if(s.layer.id==="OpenDriveJunction"){const n=this.hitGraphic.attributes.id;if(n===this.currentJunctionId)return;this.currentJunctionId=n,this.highlightGraphic=new u({geometry:this.hitGraphic.geometry,symbol:{type:"simple-marker",style:"circle",size:40,color:[0,0,0,0],outline:{color:[0,0,0,0]}},attributes:{type:"OpenDriveJunction",id:n}});const a=new u({geometry:this.hitGraphic.geometry,symbol:{type:"text",color:"black",backgroundColor:"gray",text:`${this.hitGraphic.attributes.name}
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("@arcgis/core/Graphic"),C=require("@arcgis/core/core/promiseUtils"),$=require("@arcgis/core/geometry"),A=require("@arcgis/core/geometry/geometryEngineAsync"),D=require("@arcgis/core/layers/FeatureLayer"),j=require("@arcgis/core/layers/GraphicsLayer"),w=require("axios"),S=require("pako"),O=require("../common-utils.js"),M=require("./wasm-loader.js");function k(p){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(p){for(const t in p)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(p,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>p[t]})}}return e.default=p,Object.freeze(e)}const P=k(C),N=k(A);class b{constructor(e){this.wasmLoader=M.default.getInstance(),this.projectName="",this.openDriveServer="",this.currentSectionCode="",this.currentJunctionId="",this.view=e,this.laneLayer=new D({id:"OpenDriveLane",fields:[{name:"ObjectID",alias:"ObjectID",type:"oid"},{name:"id",alias:"编号",type:"string"},{name:"roadId",alias:"道路号",type:"string"},{name:"roadName",alias:"道路名称",type:"string"},{name:"sectionId",alias:"路段号",type:"string"},{name:"laneId",alias:"车道号",type:"string"},{name:"type",alias:"类型",type:"string"},{name:"sumoId",alias:"sumo编号",type:"string"}],objectIdField:"ObjectID",geometryType:"polygon",spatialReference:{wkid:4326},source:[],outFields:["*"],renderer:{type:"unique-value",field:"type",defaultSymbol:{type:"simple-fill",color:[100,100,100],style:"solid",outline:{color:"white",width:1}},uniqueValueInfos:[{value:"shoulder",label:"路肩",symbol:{type:"simple-fill",color:"#008000",style:"solid",outline:{color:"white",width:1}}},{value:"border",label:"路沿",symbol:{type:"simple-fill",color:"#DCDCDC",style:"solid",outline:{color:"white",width:1}}},{value:"driving",label:"机动车道",symbol:{type:"simple-fill",color:[47,79,79,.8],style:"solid",outline:{color:"white",width:1}}},{value:"none",label:"无",symbol:{type:"simple-fill",color:[111,120,135],style:"none",outline:{color:"white",width:1}}},{value:"restricted",label:"禁行区",symbol:{type:"simple-fill",color:"yellow",style:"solid",outline:{color:"yellow",width:2}}},{value:"parking",label:"停车区",symbol:{type:"simple-fill",color:[115,115,115],style:"solid",outline:{color:"white",width:1}}},{value:"median",label:"中央隔离带",symbol:{type:"simple-fill",color:"#008000",style:"solid",outline:{color:"white",width:1}}},{value:"biking",label:"非机动车道",symbol:{type:"simple-fill",color:"#D3D3D3",style:"solid",outline:{color:"white",width:1}}},{value:"sidewalk",label:"人行道",symbol:{type:"simple-fill",color:"#C0C0C0",style:"solid",outline:{color:"white",width:1}}},{value:"junction",label:"路口区域",symbol:{type:"simple-fill",color:"#2F4F4F",style:"solid",outline:{color:"white",width:1}}},{value:"selected",label:"选中车道",symbol:{type:"simple-fill",color:[141,168,211],style:"solid",outline:{color:"white",width:1}}}]}}),this.roadNameLayer=new D({id:"OpenDriveRoadName",fields:[{name:"ObjectID",alias:"ObjectID",type:"oid"},{name:"roadId",alias:"道路号",type:"string"},{name:"roadName",alias:"道路名称",type:"string"}],objectIdField:"ObjectID",geometryType:"polyline",spatialReference:{wkid:4326},source:[],renderer:{type:"simple",symbol:{type:"simple-line",style:"solid",color:[0,0,0,0],width:1}},labelingInfo:[{symbol:{type:"text",color:"black",haloColor:"white",haloSize:1,font:{size:12,family:"sans-serif"}},labelPlacement:this.view.type==="2d"?"center-along":void 0,labelExpressionInfo:{expression:"$feature.roadName"}}]}),this.junctionLayer=new j({id:"OpenDriveJunction"}),this.highlightLayer=new j({id:"OpenDriveHighlight"}),this.view.map.addMany([this.laneLayer,this.junctionLayer,this.roadNameLayer,this.highlightLayer])}static getInstance(e){return this.instance||(this.instance=new b(e)),this.instance}async showOpenDriveFromFile(e){var d,c;this.projectName=Date.now().toString(),this.openDriveServer=e.server;const t=`http://${this.openDriveServer}/api/openDrive/uploadXodr`,i=await w.post(t,{},{params:{url:e.file,projectName:this.projectName}});if(i.status!==200)throw new Error(`OpenDriveRenderer: ${i.statusText}`);console.time("渲染用时");const r=i.data.result.geoSetting;O.default.setGeoData(r.geoReference,r.offsetX,r.offsetY);let s=i.data.result.json;s.startsWith(window.location.protocol)||(s=`${window.location.protocol}//${e.server}${s}`);const n=await(await fetch(s)).arrayBuffer(),a=S.inflate(n,{to:"string"}),o=JSON.parse(a);await this.showAllLanes(o,((d=e.options)==null?void 0:d.showJunctionLane)||!1,((c=e.options)==null?void 0:c.showRoadName)||!0);const l=i.data.result.junctions;if(this.showJunction(l),e.options&&e.options.centerMap!==!1){const g=O.default.transformPointProjection([0,0]);await this.view.goTo(g)}return this.mouseMoveHandler||this.monitorMouseMove(),this.mouseClickHandler||this.monitorMouseClick(),console.timeEnd("渲染用时"),{status:0,message:"ok"}}async showOpenDriveFromServer(e,t){const i=`http://${e}/api/openDrive/analyzeXodr`,r=await w.get(i,{headers:{projectName:t},params:{analyze:!1,compressed:!0}});if(r.status!==200)throw new Error(`OpenDriveRenderer: ${r.statusText}`);let s=r.data.result.json;s.startsWith(window.location.protocol)||(s=`${window.location.protocol}//${e}${s}`);const n=await(await fetch(s)).arrayBuffer(),a=S.inflate(n,{to:"string"}),o=JSON.parse(a);return await this.showAllLanes(o,!1,!1),{status:0,message:"ok"}}async showAllLanes(e,t,i){const r=await this.laneLayer.queryFeatures();return r.features.length>0&&this.laneLayer.applyEdits({deleteFeatures:r.features}),this.roadNameLayer.visible=i,new Promise(s=>{let h=0;this.allLaneGraphics=[],this.allRefLineGraphics=[];const n=[];for(const o of e){if(!t&&o.junction!=="-1")continue;const{id:l,refLine:d}=o;let c=o.name;c.includes("(")&&(c=c.slice(0,c.indexOf("("))),c=c.replace(/(.)/g,"$1 ");const g=new u({geometry:{type:"polyline",paths:[d]},attributes:{ObjectID:h++,roadId:l,roadName:c}});this.allRefLineGraphics.push(g);for(const v of o.laneSections){const I=Number(v.id);for(const y of v.lanePaths){const m=Number(y.id);if(m===0)continue;const F=y.type,f=y.innerPath.concat(y.outerPath.reverse());if(f.length<=3){console.warn(`lane ${m} has less than 3 points`);continue}f.push(y.innerPath[0]);const L=new $.Polygon({rings:[f]});if(L){const G=new u({geometry:L,attributes:{ObjectID:h++,id:`${l}+${I}+${m}`,roadId:l,roadName:o.name,sectionId:I,laneId:m,type:F,sumoId:""}});this.allLaneGraphics.push(G),n.push(G)}}}}const a=setInterval(()=>{if(n.length>0||this.allRefLineGraphics.length>0){if(n.length>0){const o=n.splice(0,100);this.laneLayer.applyEdits({addFeatures:o})}if(this.allRefLineGraphics.length>0){const o=this.allRefLineGraphics.splice(0,10);this.roadNameLayer.applyEdits({addFeatures:o})}}else clearInterval(a),s()},10)})}showJunction(e){const t=[];for(const i of e){const r=new u({geometry:{type:"point",x:i.coordinates[0],y:i.coordinates[1]},attributes:{...i,selected:!1},symbol:{type:"picture-marker",url:i.crossId?"/GisViewerAssets/Images/point_green.png":"/GisViewerAssets/Images/normal-cross.png",width:30,height:30}});t.push(r)}this.junctionLayer.addMany(t)}monitorMouseMove(){const e=P.debounce(async t=>{var h;const r=(h=(await this.view.hitTest(t,{include:[this.laneLayer,this.junctionLayer]})).results)==null?void 0:h.filter(n=>n.type==="graphic");if(r.length===0){this.currentSectionCode!==""&&(this.currentSectionCode="",this.highlightGraphic=void 0,this.highlightLayer.removeAll()),this.currentJunctionId!==""&&(this.currentJunctionId="",this.highlightGraphic=void 0,this.highlightLayer.removeAll());return}const s=r[0];if(this.hitGraphic=s.graphic,s.layer.id==="OpenDriveLane"){const n=`${this.hitGraphic.attributes.roadId}+${this.hitGraphic.attributes.sectionId}`;if(n===this.currentSectionCode)return;this.currentSectionCode=n;const a=this.allLaneGraphics.filter(l=>`${l.attributes.roadId}+${l.attributes.sectionId}`===n),o=await N.union(a.map(l=>l.geometry));this.highlightGraphic=new u({geometry:o,symbol:{type:"simple-fill",color:[255,0,0,.5],style:"solid",outline:{color:"red",width:2}},attributes:{type:"OpenDriveSection",id:n,detail:""}}),this.highlightLayer.removeAll(),this.highlightLayer.add(this.highlightGraphic)}else if(s.layer.id==="OpenDriveJunction"){const n=this.hitGraphic.attributes.id;if(n===this.currentJunctionId)return;this.currentJunctionId=n,this.highlightGraphic=new u({geometry:this.hitGraphic.geometry,symbol:{type:"simple-marker",style:"circle",size:40,color:[0,0,0,0],outline:{color:[0,0,0,0]}},attributes:{type:"OpenDriveJunction",id:n}});const a=new u({geometry:this.hitGraphic.geometry,symbol:{type:"text",color:"black",backgroundColor:"gray",text:`${this.hitGraphic.attributes.name}
2
2
  ${this.hitGraphic.attributes.id}`,font:{size:10},yoffset:40}});this.highlightLayer.removeAll(),this.highlightLayer.addMany([this.highlightGraphic,a])}});this.mouseMoveHandler=this.view.on("pointer-move",async t=>{e(t).catch(()=>{})})}monitorMouseClick(){this.mouseClickHandler=this.view.on("immediate-click",async()=>{var e,t;if(this.hitGraphic&&!this.currentSectionCode){if(this.currentJunctionId)if(this.hitGraphic.getAttribute("selected")===!1){const i=`http://${this.openDriveServer}/api/sumo/getSumoJunction`,r=await w.get(i,{params:{id:this.currentJunctionId,projectName:this.projectName}});r.status===200&&r.data.status===0&&((e=this.highlightGraphic)==null||e.setAttribute("detail",r.data.result),this.hitGraphic.setAttribute("selected",!0),this.hitGraphic.symbol.url="/GisViewerAssets/Images/point_red.png",this.increasePictureMarkerSize(this.hitGraphic,50))}else(t=this.highlightGraphic)==null||t.setAttribute("detail",void 0),this.hitGraphic.setAttribute("selected",!1),this.hitGraphic.symbol.url="/GisViewerAssets/Images/point_green.png",this.decreasePictureMarkerSize(this.hitGraphic,30)}})}increasePictureMarkerSize(e,t){const i=setInterval(()=>{const r=e.symbol,s=r.width;s<t?e.symbol={type:"picture-marker",url:r.url,width:s+1,height:s+1}:clearInterval(i)},20)}decreasePictureMarkerSize(e,t){const i=setInterval(()=>{const r=e.symbol,s=r.width;s>t?e.symbol={type:"picture-marker",url:r.url,width:s-1,height:s-1}:clearInterval(i)},20)}async clearOpenDrive(){var t,i;let e=await this.laneLayer.queryFeatures();e.features.length>0&&await this.laneLayer.applyEdits({deleteFeatures:e.features}),e=await this.roadNameLayer.queryFeatures(),e.features.length>0&&await this.roadNameLayer.applyEdits({deleteFeatures:e.features}),this.highlightLayer.removeAll(),this.junctionLayer.removeAll(),this.wasmLoader.clear(),(t=this.mouseMoveHandler)==null||t.remove(),(i=this.mouseClickHandler)==null||i.remove()}async findSumo(e){const{id:t}=e,i=e.flash===void 0?!0:e.flash,r=t.split("+");if(r.length>2)return{status:-1,message:"id格式错误"};const s=r.length===2?Number(r[1]):void 0,h=r[0].split("#");if(h.length>2)return{status:-1,message:"id格式错误"};let n=h[0];n.startsWith("-")&&(n=n.slice(1));const a=h.length===2?Number(h[1]):void 0;return await this.findLane({roadsectId:n,segmentId:a,laneId:s,flash:i})}async findLane(e){let{segmentId:t,laneId:i}=e;const{roadsectId:r}=e;let s=this.allLaneGraphics.filter(a=>a.attributes.roadId===r);if(s.length===0)return{status:-1,message:"未找到。请检查路段编号"};if(t!==void 0){const a=[];if(s.forEach(o=>{const l=Number(o.attributes.sectionId);a.indexOf(l)===-1&&a.push(l)}),a.sort((o,l)=>o-l),t>a.length-1)return{status:-1,message:"未找到。请检查基本段编号"};t=a[t],s=s.filter(o=>Number(o.attributes.sectionId)===t)}if(i!==void 0){const a=[];if(s.forEach(o=>{const l=Number(o.attributes.laneId);a.indexOf(l)===-1&&a.push(l)}),a.sort((o,l)=>o-l),i>a.length-1)return{status:-1,message:"未找到。请检查车道编号"};i=a[i],s=s.filter(o=>Number(o.attributes.laneId)===i)}const h=s.map(a=>a.geometry),n=await N.union(h);if(e.flash){this.highlightLayer.removeAll();const a=new u({geometry:n,symbol:{type:"simple-fill",color:[255,0,0,.5],style:"solid",outline:{color:"red",width:2}}});this.highlightLayer.add(a);let o=0,l=!0;const d=setInterval(()=>{l?(this.highlightLayer.opacity-=.02,this.highlightLayer.opacity<=.1&&(l=!1,o++)):(this.highlightLayer.opacity+=.02,this.highlightLayer.opacity>=1&&(l=!0)),o>5&&(this.highlightLayer.removeAll(),this.highlightLayer.opacity=1,clearInterval(d))},20)}return await this.view.goTo(n,{duration:1e3}),{status:0,message:"ok"}}async splitLane(e){return{status:0,message:"ok",result:e}}}exports.default=b;
@@ -214,7 +214,7 @@ export interface IShowOpenDriveFromFileParams {
214
214
  showJunctionPolygon: boolean;
215
215
  showJunctionLane: boolean;
216
216
  showRoadName: boolean;
217
- centerMap: boolean;
217
+ centerMap?: boolean;
218
218
  };
219
219
  }
220
220
  export interface IFindSumoParams {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gisviewer-vue3-arcgis",
3
- "version": "1.0.120",
3
+ "version": "1.0.121",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [