gisviewer-vue3-arcgis 1.0.168 → 1.0.169
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/es/src/gis-map/utils/holo-flow/trace-renderer-external.d.ts +0 -1
- package/es/src/gis-map/utils/signal-control-area-controller/index.mjs +23 -20
- package/lib/src/gis-map/utils/holo-flow/trace-renderer-external.d.ts +0 -1
- package/lib/src/gis-map/utils/signal-control-area-controller/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as g from "@arcgis/core/core/reactiveUtils.js";
|
|
2
2
|
import y from "@arcgis/core/Graphic";
|
|
3
3
|
import h from "@arcgis/core/layers/GraphicsLayer";
|
|
4
4
|
import u from "@turf/buffer";
|
|
5
5
|
import d from "@turf/convex";
|
|
6
|
-
import * as
|
|
6
|
+
import * as l from "@turf/helpers";
|
|
7
7
|
import b from "concaveman";
|
|
8
8
|
import f from "./district-controller.mjs";
|
|
9
9
|
class x {
|
|
@@ -35,7 +35,7 @@ class x {
|
|
|
35
35
|
const i = new f(t);
|
|
36
36
|
this.drawArea(i, !0);
|
|
37
37
|
}
|
|
38
|
-
return this.watchHandle =
|
|
38
|
+
return this.watchHandle = g.watch(
|
|
39
39
|
() => this.view.scale,
|
|
40
40
|
(t, i) => {
|
|
41
41
|
t > this.crossScale && i <= this.crossScale ? (this.crossLayer.graphics.forEach((s) => {
|
|
@@ -77,7 +77,10 @@ class x {
|
|
|
77
77
|
if (!e.id || e.id === "")
|
|
78
78
|
return { status: 1, message: "请输入id" };
|
|
79
79
|
this.highlightLayer.removeAll(), this.districtControllerLayer.visible = !1;
|
|
80
|
-
const t = this.districtControllerLayer.graphics.filter((r) => r.getAttribute("id") === e.id).toArray().map((r) =>
|
|
80
|
+
const t = this.districtControllerLayer.graphics.filter((r) => r.getAttribute("id") === e.id).toArray().map((r) => {
|
|
81
|
+
const a = r.clone();
|
|
82
|
+
return a.symbol.style = "none", a;
|
|
83
|
+
}), i = this.subDistrictControllerLayer.graphics.filter(
|
|
81
84
|
(r) => r.getAttribute("id") === e.id || r.getAttribute("parentId") === e.id
|
|
82
85
|
).toArray().map((r) => r.clone()), s = this.crossLayer.graphics.filter(
|
|
83
86
|
(r) => r.getAttribute("id") === e.id || r.getAttribute("districtId") === e.id || r.getAttribute("subDistrictId") === e.id
|
|
@@ -147,20 +150,20 @@ class x {
|
|
|
147
150
|
if (i.length >= 2) {
|
|
148
151
|
let r = null;
|
|
149
152
|
if (i.length === 2)
|
|
150
|
-
r =
|
|
153
|
+
r = l.lineString(i);
|
|
151
154
|
else {
|
|
152
155
|
if (t) {
|
|
153
|
-
const n =
|
|
154
|
-
i.map((
|
|
156
|
+
const n = l.featureCollection(
|
|
157
|
+
i.map((p) => l.point(p))
|
|
155
158
|
);
|
|
156
159
|
r = d(n);
|
|
157
160
|
} else {
|
|
158
161
|
const n = b(i, 0.5);
|
|
159
|
-
n.length >= 4 && (r =
|
|
162
|
+
n.length >= 4 && (r = l.polygon([n]));
|
|
160
163
|
}
|
|
161
|
-
r || (r =
|
|
164
|
+
r || (r = l.lineString(i));
|
|
162
165
|
}
|
|
163
|
-
const
|
|
166
|
+
const a = u(
|
|
164
167
|
r.geometry,
|
|
165
168
|
// 区控面积更大,需要更大的缓冲半径
|
|
166
169
|
t ? 200 : 30,
|
|
@@ -168,8 +171,8 @@ class x {
|
|
|
168
171
|
units: "meters"
|
|
169
172
|
}
|
|
170
173
|
);
|
|
171
|
-
let
|
|
172
|
-
t ?
|
|
174
|
+
let o;
|
|
175
|
+
t ? o = [
|
|
173
176
|
{
|
|
174
177
|
fieldName: "id",
|
|
175
178
|
label: "区控编号"
|
|
@@ -182,7 +185,7 @@ class x {
|
|
|
182
185
|
fieldName: "subDistrictCount",
|
|
183
186
|
label: "子区数量"
|
|
184
187
|
}
|
|
185
|
-
] :
|
|
188
|
+
] : o = [
|
|
186
189
|
{
|
|
187
190
|
fieldName: "parentName",
|
|
188
191
|
label: "所属区控"
|
|
@@ -203,7 +206,7 @@ class x {
|
|
|
203
206
|
}, c = new y({
|
|
204
207
|
geometry: {
|
|
205
208
|
type: "polygon",
|
|
206
|
-
rings:
|
|
209
|
+
rings: a.geometry.coordinates
|
|
207
210
|
},
|
|
208
211
|
symbol: {
|
|
209
212
|
type: "simple-fill",
|
|
@@ -220,7 +223,7 @@ class x {
|
|
|
220
223
|
content: [
|
|
221
224
|
{
|
|
222
225
|
type: "fields",
|
|
223
|
-
fieldInfos:
|
|
226
|
+
fieldInfos: o
|
|
224
227
|
}
|
|
225
228
|
]
|
|
226
229
|
}
|
|
@@ -231,7 +234,7 @@ class x {
|
|
|
231
234
|
this.drawArea(r, !1);
|
|
232
235
|
const s = [];
|
|
233
236
|
e.crosses.forEach((r) => {
|
|
234
|
-
const
|
|
237
|
+
const a = {
|
|
235
238
|
type: "cross",
|
|
236
239
|
id: r.id,
|
|
237
240
|
name: r.name,
|
|
@@ -242,14 +245,14 @@ class x {
|
|
|
242
245
|
subDistrictId: t ? "" : e.id,
|
|
243
246
|
subDistrictName: t ? "" : e.name,
|
|
244
247
|
isKey: r.isKey
|
|
245
|
-
},
|
|
248
|
+
}, o = new y({
|
|
246
249
|
geometry: {
|
|
247
250
|
type: "point",
|
|
248
251
|
x: r.longitude,
|
|
249
252
|
y: r.latitude
|
|
250
253
|
},
|
|
251
|
-
symbol: this.getCrossGraphicSymbol(
|
|
252
|
-
attributes:
|
|
254
|
+
symbol: this.getCrossGraphicSymbol(a, "marker"),
|
|
255
|
+
attributes: a,
|
|
253
256
|
popupTemplate: {
|
|
254
257
|
title: r.name,
|
|
255
258
|
content: [
|
|
@@ -277,7 +280,7 @@ class x {
|
|
|
277
280
|
]
|
|
278
281
|
}
|
|
279
282
|
});
|
|
280
|
-
s.push(
|
|
283
|
+
s.push(o);
|
|
281
284
|
}), this.crossLayer.addMany(s);
|
|
282
285
|
}
|
|
283
286
|
getCrossGraphicInSubDistrict() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("@arcgis/core/core/reactiveUtils.js"),y=require("@arcgis/core/Graphic"),h=require("@arcgis/core/layers/GraphicsLayer"),b=require("@turf/buffer"),f=require("@turf/convex"),C=require("@turf/helpers"),v=require("concaveman"),L=require("./district-controller.js");function m(
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("@arcgis/core/core/reactiveUtils.js"),y=require("@arcgis/core/Graphic"),h=require("@arcgis/core/layers/GraphicsLayer"),b=require("@turf/buffer"),f=require("@turf/convex"),C=require("@turf/helpers"),v=require("concaveman"),L=require("./district-controller.js");function m(o){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const t in o)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(o,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:()=>o[t]})}}return e.default=o,Object.freeze(e)}const S=m(d),n=m(C);class I{constructor(e){this.crossScale=5e3,this.view=e,this.districtControllerLayer=new h({id:"districtControllerLayer"}),this.subDistrictControllerLayer=new h({id:"subDistrictControllerLayer",visible:!1}),this.crossLayer=new h({id:"crossLayer",visible:!1}),this.highlightLayer=new h({id:"highlightLayer"}),this.view.map.addMany([this.districtControllerLayer,this.subDistrictControllerLayer,this.crossLayer,this.highlightLayer])}showSignalControlArea(e){this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),this.districtControllerLayer.visible=!0;for(const t of e){const r=new L.default(t);this.drawArea(r,!0)}return this.watchHandle=S.watch(()=>this.view.scale,(t,r)=>{t>this.crossScale&&r<=this.crossScale?(this.crossLayer.graphics.forEach(s=>{s.symbol=this.getCrossGraphicSymbol(s.attributes,"marker")}),this.highlightLayer.graphics.forEach(s=>{s.getAttribute("type")==="cross"&&(s.symbol=this.getCrossGraphicSymbol(s.attributes,"marker"))})):t<=this.crossScale&&r>this.crossScale&&(this.crossLayer.graphics.forEach(s=>{s.symbol=this.getCrossGraphicSymbol(s.attributes,"picture")}),this.highlightLayer.graphics.forEach(s=>{s.getAttribute("type")==="cross"&&(s.symbol=this.getCrossGraphicSymbol(s.attributes,"picture"))}))}),{status:0,message:"ok"}}clearSignalControlArea(){var e;return this.districtControllerLayer.removeAll(),this.subDistrictControllerLayer.removeAll(),this.crossLayer.removeAll(),this.highlightLayer.removeAll(),(e=this.watchHandle)==null||e.remove(),this.view.closePopup(),{status:0,message:"ok"}}async locateSignalControlArea(e){const t=this.findAreaGraphic(e.id);return t?(t.attributes.type==="cross"?await this.view.goTo({target:t.geometry,scale:1500}):await this.view.goTo(t.geometry),{status:0,message:"ok"}):{status:1,message:"未找到"}}async highlightSignalControlArea(e){if(!e.id||e.id==="")return{status:1,message:"请输入id"};this.highlightLayer.removeAll(),this.districtControllerLayer.visible=!1;const t=this.districtControllerLayer.graphics.filter(i=>i.getAttribute("id")===e.id).toArray().map(i=>{const a=i.clone();return a.symbol.style="none",a}),r=this.subDistrictControllerLayer.graphics.filter(i=>i.getAttribute("id")===e.id||i.getAttribute("parentId")===e.id).toArray().map(i=>i.clone()),s=this.crossLayer.graphics.filter(i=>i.getAttribute("id")===e.id||i.getAttribute("districtId")===e.id||i.getAttribute("subDistrictId")===e.id).toArray().map(i=>i.clone());if(t.length>0&&this.highlightLayer.addMany(t),r.length>0&&this.highlightLayer.addMany(r),s.length>0&&this.highlightLayer.addMany(s),this.highlightLayer.graphics.length===0)return{status:1,message:"未找到"};if(t.length>0)await this.view.goTo(t);else if(r.length>0){const i=r[0].geometry.centroid;await this.view.goTo({target:i,scale:this.crossScale-500})}else s.length>1?await this.view.goTo(s):await this.view.goTo({target:s[0].geometry,scale:1500});return{status:0,message:"ok"}}resetHighlight(){return this.highlightLayer.removeAll(),this.view.closePopup(),this.districtControllerLayer.visible=!0,{status:0,message:"ok"}}showSubSignalControlArea(e){const t=e.children;console.log(t);const r=t.map(s=>new y({geometry:{type:"point",x:s.longitude,y:s.latitude},symbol:this.getCrossGraphicInSubDistrict(),attributes:{id:s.id,name:s.name,signalId:s.signalId}}));return this.crossLayer.addMany(r),this.view.goTo(r),{status:0,message:"ok"}}editSubSignalArea(){return{status:0,message:"ok"}}findAreaGraphic(e){let t=this.districtControllerLayer.graphics.find(r=>r.attributes.id===e);return t||(t=this.subDistrictControllerLayer.graphics.find(r=>r.attributes.id===e)),t||(t=this.crossLayer.graphics.find(r=>r.attributes.id===e)),t}drawArea(e,t){const r=e.getAllCrossCoordinates();if(r.length>=2){let i=null;if(r.length===2)i=n.lineString(r);else{if(t){const c=n.featureCollection(r.map(p=>n.point(p)));i=f(c)}else{const c=v(r,.5);c.length>=4&&(i=n.polygon([c]))}i||(i=n.lineString(r))}const a=b(i.geometry,t?200:30,{units:"meters"});let l;t?l=[{fieldName:"id",label:"区控编号"},{fieldName:"crossCount",label:"路口数量"},{fieldName:"subDistrictCount",label:"子区数量"}]:l=[{fieldName:"parentName",label:"所属区控"},{fieldName:"crossCount",label:"路口数量"}];const g={type:"signalControlArea",id:e.id,name:e.name,parentId:e.parentId,parentName:e.parentName,crossCount:e.crossCount,subDistrictCount:e.subDistrictCount},u=new y({geometry:{type:"polygon",rings:a.geometry.coordinates},symbol:{type:"simple-fill",color:[...e.areaColor,.2],outline:{color:e.areaColor,width:3,style:t?"solid":"long-dash"}},attributes:g,popupTemplate:{title:`${t?"区控":"子区"} ${e.name}`,content:[{type:"fields",fieldInfos:l}]}});t?this.districtControllerLayer.add(u):this.subDistrictControllerLayer.add(u)}for(const i of e.subDistricts)this.drawArea(i,!1);const s=[];e.crosses.forEach(i=>{const a={type:"cross",id:i.id,name:i.name,color:e.areaColor,signalId:i.signalId,districtId:t?e.id:e.parentId,districtName:t?e.name:e.parentName,subDistrictId:t?"":e.id,subDistrictName:t?"":e.name,isKey:i.isKey},l=new y({geometry:{type:"point",x:i.longitude,y:i.latitude},symbol:this.getCrossGraphicSymbol(a,"marker"),attributes:a,popupTemplate:{title:i.name,content:[{type:"fields",fieldInfos:[{fieldName:"districtName",label:"区控名称"},{fieldName:"subDistrictName",label:"子区名称"},{fieldName:"id",label:"路口编号"},{fieldName:"signalId",label:"信号机编号"}]}]}});s.push(l)}),this.crossLayer.addMany(s)}getCrossGraphicInSubDistrict(){return{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:20,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:20,rotateClockwise:!0,textureFilter:"Picture",url:"/GisViewerAssets/Images/gis_lkcz_xz.png"}]}}}}getCrossGraphicSymbol(e,t){const{isKey:r,color:s}=e;if(t==="marker")return r?{type:"picture-marker",url:"/GisViewerAssets/Images/icon_star.png",width:"30px",height:"30px"}:{type:"simple-marker",style:"circle",color:s,size:8,outline:{color:"white",width:1}};if(t==="picture")return{type:"cim",data:{type:"CIMSymbolReference",primitiveOverrides:[{type:"CIMPrimitiveOverride",primitiveName:"textGraphic",propertyName:"TextString",valueExpressionInfo:{type:"CIMExpressionInfo",title:"Custom",expression:'Replace($feature.name, "与", "/") + " " + $feature.signalId',returnType:"Default"}}],symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",size:32,colorLocked:!0,anchorPointUnits:"Relative",frame:{xmin:-16,ymin:-16,xmax:16,ymax:16},markerGraphics:[{type:"CIMMarkerGraphic",primitiveName:"textGraphic",geometry:{x:0,y:0},symbol:{type:"CIMTextSymbol",height:12,horizontalAlignment:"Center",offsetX:0,offsetY:r?50:40,haloSize:1,haloSymbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[0,0,0,255]}]},verticalAlignment:"Center"},textString:""}],scaleSymbolsProportionally:!0,respectFrame:!0},{type:"CIMPictureMarker",enable:!0,anchorPoint:{x:0,y:0},anchorPointUnits:"Relative",size:r?45:30,rotateClockwise:!0,textureFilter:"Picture",url:`/GisViewerAssets/Images/xhj_${r?4:1}.png`,offsetY:r?22:15}]}}}}}exports.default=I;
|