csk-gis-frame-work 4.0.0
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/baseSetting/config/mapConfig.js +48 -0
- package/baseSetting/gis-data/examples-data/3DTile/Tileset/tileset.json +124 -0
- package/baseSetting/gis-data/examples-data/client-analysis/buffer-hash-4.json +1 -0
- package/baseSetting/gis-data/examples-data/client-analysis/point.json +47 -0
- package/baseSetting/gis-data/examples-data/echarts/griddata.js +3 -0
- package/baseSetting/gis-data/examples-data/echarts/line-bus.json +1 -0
- package/baseSetting/gis-data/examples-data/echarts/weibo.geojson +1 -0
- package/baseSetting/gis-data/examples-data/echarts/weibo.json +1 -0
- package/baseSetting/gis-data/examples-data/echartsgl/beijing/buildings.xml +1 -0
- package/baseSetting/gis-data/examples-data/echartsgl/newyork/buildings.json +17178 -0
- package/baseSetting/gis-data/examples-data/echartsgl/shenzhen//346/267/261/345/234/263/350/275/250/350/277/271/347/272/277.json +24 -0
- package/baseSetting/gis-data/examples-data/echartsgl/shenzhen//351/201/223/350/267/25703.json +1949 -0
- package/baseSetting/gis-data/examples-data/geojson/animate-marker.json +15007 -0
- package/baseSetting/gis-data/examples-data/geojson/arc.js +256 -0
- package/baseSetting/gis-data/examples-data/geojson/chiacgo_bounds.geojson +9 -0
- package/baseSetting/gis-data/examples-data/geojson/china-city.geojson +355 -0
- package/baseSetting/gis-data/examples-data/geojson/china-xian.geojson +2428 -0
- package/baseSetting/gis-data/examples-data/geojson/china.geojson +42 -0
- package/baseSetting/gis-data/examples-data/geojson/countries.geojson +181 -0
- package/baseSetting/gis-data/examples-data/geojson/line-string.json +1020 -0
- package/baseSetting/gis-data/examples-data/geojson/washington_bounds.geojson +6 -0
- package/baseSetting/gis-data/examples-data/geojson/washington_point.geojson +153 -0
- package/baseSetting/gis-data/examples-data/geojson/wuhan_bounds.geojson +29 -0
- package/baseSetting/gis-data/examples-data/kml/Earthquake_2012.js +203 -0
- package/baseSetting/gis-data/examples-data/kml/KML_Samples.kml +915 -0
- package/baseSetting/gis-data/examples-data/mapbox/changestyle.json +2980 -0
- package/baseSetting/gis-data/examples-data/mapbox/sprite.json +3634 -0
- package/baseSetting/gis-data/examples-data/mapv/china-point.geojson +2 -0
- package/baseSetting/gis-data/examples-data/mapv/china-point.json +2 -0
- package/baseSetting/gis-data/examples-data/mapv/china.geojson +40 -0
- package/baseSetting/gis-data/examples-data/mapv/china.json +40 -0
- package/baseSetting/gis-data/examples-data/model/Airplane/Airplane.dae +333 -0
- package/baseSetting/gis-data/examples-data/model/Airplane/Airplane.gltf +802 -0
- package/baseSetting/gis-data/examples-data/model/fireExtinguisher.gltf +455 -0
- package/baseSetting/gis-data/sources_layers.js +2002 -0
- package/baseSetting/images/map/done.png +0 -0
- package/baseSetting/images/map/error.png +0 -0
- package/baseSetting/images/map/invalid.png +0 -0
- package/baseSetting/images/map/map.png +0 -0
- package/baseSetting/images/map/point.png +0 -0
- package/baseSetting/images/map/todo.png +0 -0
- package/baseSetting/style/DevMapConfig.js +33 -0
- package/baseSetting/style/getDefaultFonts.py +23 -0
- package/baseSetting/utils/TokenUtils.js +15 -0
- package/index.js +42 -0
- package/mapboxgl/js/common/AnnotationLayer.js +341 -0
- package/mapboxgl/js/common/BoundaryLayer.js +271 -0
- package/mapboxgl/js/common/ClusterLayer.js +498 -0
- package/mapboxgl/js/common/FlowLayer.js +234 -0
- package/mapboxgl/js/common/FlowingLayer.js +325 -0
- package/mapboxgl/js/common/HeatmapLayer.js +280 -0
- package/mapboxgl/js/common/ILayer.js +89 -0
- package/mapboxgl/js/common/LocationLayer.js +791 -0
- package/mapboxgl/js/common/PulserLayer.js +244 -0
- package/mapboxgl/js/common/SelectionLayer.js +315 -0
- package/mapboxgl/js/common/SimpleCircleLayer.js +465 -0
- package/mapboxgl/js/common/SimpleFillLayer.js +475 -0
- package/mapboxgl/js/common/SimpleLineLayer.js +430 -0
- package/mapboxgl/js/common/SimpleMarkerLayer.js +468 -0
- package/mapboxgl/js/common/StatsCircleLayer.js +351 -0
- package/mapboxgl/js/common/TrackingLayer.js +845 -0
- package/mapboxgl/js/common/VideoClusterLayer.js +539 -0
- package/mapboxgl/js/common/VideoLayer.js +334 -0
- package/mapboxgl/js/drainer/DrainEntityAnalystProvider.js +550 -0
- package/mapboxgl/js/drainer/DrainEntityProvider.js +557 -0
- package/mapboxgl/js/drainer/DrainEntityStatsLayer.js +144 -0
- package/mapboxgl/js/drainer/DrainUnitLayer.js +130 -0
- package/mapboxgl/js/drainer/DrainageEntityLayer.js +145 -0
- package/mapboxgl/js/drainer/DrainageEntityProvider.js +222 -0
- package/mapboxgl/js/drainer/DrainageUnitFlowLayer.js +137 -0
- package/mapboxgl/js/drainer/DrainageUnitlineLayer.js +154 -0
- package/mapboxgl/js/drainer/DrainageUnitlineProvider.js +140 -0
- package/mapboxgl/js/drainer/DrainerSearchProvider.js +274 -0
- package/mapboxgl/js/draw/CircleDrawing.js +238 -0
- package/mapboxgl/js/draw/DrawingProvider.js +533 -0
- package/mapboxgl/js/draw/DynamicBuffer.js +220 -0
- package/mapboxgl/js/draw/PointDrawing.js +189 -0
- package/mapboxgl/js/draw/PolygonDrawing.js +538 -0
- package/mapboxgl/js/draw/PolylineDrawing.js +597 -0
- package/mapboxgl/js/draw/RectangleDrawing.js +217 -0
- package/mapboxgl/js/draw/SplitPoylgon.js +214 -0
- package/mapboxgl/js/draw/mapConfig.js +240 -0
- package/mapboxgl/js/dynamic/BuildingsiteLayer.js +179 -0
- package/mapboxgl/js/dynamic/BusinessProvider.js +547 -0
- package/mapboxgl/js/dynamic/DefectLayer.js +137 -0
- package/mapboxgl/js/dynamic/EventLayer.js +151 -0
- package/mapboxgl/js/dynamic/StaffLayer.js +233 -0
- package/mapboxgl/js/dynamic/StoreLayer.js +143 -0
- package/mapboxgl/js/dynamic/VehicleLayer.js +236 -0
- package/mapboxgl/js/dynamic/WorkorderLayer.js +110 -0
- package/mapboxgl/js/editor/DeleteMarkerLayer.js +184 -0
- package/mapboxgl/js/editor/EditorProvider.js +2270 -0
- package/mapboxgl/js/editor/SurveyProvider.js +253 -0
- package/mapboxgl/js/equipment/AlarmLayer.js +117 -0
- package/mapboxgl/js/equipment/EquipCODLayer.js +119 -0
- package/mapboxgl/js/equipment/EquipDoorLayer.js +119 -0
- package/mapboxgl/js/equipment/EquipFloodedLayer.js +118 -0
- package/mapboxgl/js/equipment/EquipFlowLayer.js +119 -0
- package/mapboxgl/js/equipment/EquipFlowingLayer.js +103 -0
- package/mapboxgl/js/equipment/EquipLiquidLayer.js +121 -0
- package/mapboxgl/js/equipment/EquipNh3Layer.js +119 -0
- package/mapboxgl/js/equipment/EquipOtherLayer.js +123 -0
- package/mapboxgl/js/equipment/EquipPumpLayer.js +119 -0
- package/mapboxgl/js/equipment/EquipRaingaugeLayer.js +116 -0
- package/mapboxgl/js/equipment/EquipSpeedLayer.js +119 -0
- package/mapboxgl/js/equipment/EquipWellLayer.js +119 -0
- package/mapboxgl/js/equipment/EquipmentLayer.js +116 -0
- package/mapboxgl/js/equipment/EquipmentProvider.js +545 -0
- package/mapboxgl/js/equipment/EquippHLayer.js +119 -0
- package/mapboxgl/js/equipment/OverflowLayer.js +167 -0
- package/mapboxgl/js/equipment/WarnLayer.js +120 -0
- package/mapboxgl/js/event/EventBranchPipeLayer.js +108 -0
- package/mapboxgl/js/event/EventDefectLayer.js +119 -0
- package/mapboxgl/js/event/EventDrainerLayer.js +119 -0
- package/mapboxgl/js/event/EventLayer.js +123 -0
- package/mapboxgl/js/event/EventMixLayer.js +119 -0
- package/mapboxgl/js/event/EventOtherLayer.js +119 -0
- package/mapboxgl/js/event/EventOtherWaterLayer.js +109 -0
- package/mapboxgl/js/event/EventPolicyWaterLayer.js +119 -0
- package/mapboxgl/js/event/EventPourLayer.js +119 -0
- package/mapboxgl/js/event/EventProvider.js +426 -0
- package/mapboxgl/js/event/EventWaterLayer.js +108 -0
- package/mapboxgl/js/facility/DitchLayer.js +171 -0
- package/mapboxgl/js/facility/FacilityProvider.js +523 -0
- package/mapboxgl/js/facility/FlapLayer.js +196 -0
- package/mapboxgl/js/facility/GateLayer.js +166 -0
- package/mapboxgl/js/facility/InterceptionLayer.js +166 -0
- package/mapboxgl/js/facility/InterceptionsewLayer.js +166 -0
- package/mapboxgl/js/facility/OutfallLayer.js +166 -0
- package/mapboxgl/js/facility/PatrolareaLayer.js +177 -0
- package/mapboxgl/js/facility/RaininletLayer.js +166 -0
- package/mapboxgl/js/facility/StorageLayer.js +166 -0
- package/mapboxgl/js/geog/AreaBoundaryProvider.js +282 -0
- package/mapboxgl/js/geog/BoundaryProvider.js +266 -0
- package/mapboxgl/js/geog/GMLProvider.js +146 -0
- package/mapboxgl/js/geog/GeoJsonProvider.js +336 -0
- package/mapboxgl/js/geog/IconProvider.js +481 -0
- package/mapboxgl/js/geog/IndexedDBProvider.js +467 -0
- package/mapboxgl/js/geog/LayerProvider.js +275 -0
- package/mapboxgl/js/geog/LocationProvider.js +227 -0
- package/mapboxgl/js/geog/MapProvider.js +179 -0
- package/mapboxgl/js/geog/SelectionProvider.js +99 -0
- package/mapboxgl/js/geog/WKTProvider.js +180 -0
- package/mapboxgl/js/layers/CircleLayer.js +471 -0
- package/mapboxgl/js/layers/ClusterLayer.js +529 -0
- package/mapboxgl/js/layers/FillLayer.js +407 -0
- package/mapboxgl/js/layers/FlowingLayer.js +315 -0
- package/mapboxgl/js/layers/HeatmapLayer.js +263 -0
- package/mapboxgl/js/layers/IconClusterLayer.js +497 -0
- package/mapboxgl/js/layers/LineLayer.js +442 -0
- package/mapboxgl/js/layers/MarkerLayer.js +504 -0
- package/mapboxgl/js/layers/Pulser.js +84 -0
- package/mapboxgl/js/layers/PulserLayer.js +161 -0
- package/mapboxgl/js/layers/TextLayer.js +352 -0
- package/mapboxgl/js/pipe/BufferLayer.js +142 -0
- package/mapboxgl/js/pipe/DrainageAreaLayer.js +272 -0
- package/mapboxgl/js/pipe/DrainageAreaProvider.js +823 -0
- package/mapboxgl/js/pipe/DrainagePointLayer.js +258 -0
- package/mapboxgl/js/pipe/LayerManagerProvider.js +1499 -0
- package/mapboxgl/js/pipe/MapQueryProvider.js +879 -0
- package/mapboxgl/js/pipe/QueryResultsLayer.js +799 -0
- package/mapboxgl/js/pipeline/ConnholeLayer.js +134 -0
- package/mapboxgl/js/pipeline/LabelLayer.js +310 -0
- package/mapboxgl/js/pipeline/ManholeLayer.js +563 -0
- package/mapboxgl/js/pipeline/PipeflowLayer.js +490 -0
- package/mapboxgl/js/pipeline/PipelineErrorLayer.js +180 -0
- package/mapboxgl/js/pipeline/PipelineFlowLayer.js +213 -0
- package/mapboxgl/js/pipeline/PipelineLayer.js +509 -0
- package/mapboxgl/js/pipeline/PipenetErrorProvider.js +352 -0
- package/mapboxgl/js/pipeline/PipenetFaultProvider.js +219 -0
- package/mapboxgl/js/pipeline/PipenetInProvider.js +514 -0
- package/mapboxgl/js/pipeline/PipenetMixingFlowLayer.js +329 -0
- package/mapboxgl/js/pipeline/PipenetMixingLayer.js +155 -0
- package/mapboxgl/js/pipeline/PipenetMixingProvider.js +163 -0
- package/mapboxgl/js/pipeline/PipenetProvider.js +1042 -0
- package/mapboxgl/js/pipenet/PipenetAnalystProvider.js +393 -0
- package/mapboxgl/js/pipenet/PipenetConnectivityProvider.js +166 -0
- package/mapboxgl/js/pipenet/PipenetDownstreamProvider.js +276 -0
- package/mapboxgl/js/pipenet/PipenetFlowingLayer.js +312 -0
- package/mapboxgl/js/pipenet/PipenetServiceRangeProvider.js +386 -0
- package/mapboxgl/js/pipenet/PipenetUpdownstreamProvider.js +507 -0
- package/mapboxgl/js/pipenet/PipenetUpstreamProvider.js +311 -0
- package/mapboxgl/js/pipenet/PipenetWhereaboutsProvider.js +342 -0
- package/mapboxgl/js/plant/FlylineLayer.js +304 -0
- package/mapboxgl/js/plant/PlantLayer.js +166 -0
- package/mapboxgl/js/plant/PlantPumpProvider.js +788 -0
- package/mapboxgl/js/plant/PumpLayer.js +166 -0
- package/mapboxgl/js/plant/RuralSewageLayer.js +166 -0
- package/mapboxgl/js/plant/ServiceRangeLayer.js +130 -0
- package/mapboxgl/js/plant/VideoProvider.js +145 -0
- package/mapboxgl/js/three/ThreeGltfProvider.js +245 -0
- package/mapboxgl/js/utils/CesiumUtils.js +109 -0
- package/mapboxgl/js/utils/ColorUtils.js +48 -0
- package/mapboxgl/js/utils/CommonUtils.js +65 -0
- package/mapboxgl/js/utils/DataUtils.js +138 -0
- package/mapboxgl/js/utils/GeoJsonUtils.js +357 -0
- package/mapboxgl/js/utils/GeogUtils.js +300 -0
- package/mapboxgl/js/utils/LayerUtils.js +160 -0
- package/mapboxgl/js/utils/MapUtils.js +128 -0
- package/mapboxgl/js/utils/NetworkUtils.js +21 -0
- package/mapboxgl/js/utils/PipenetUtils.js +100 -0
- package/mapboxgl/js/utils/ProjUtils.js +32 -0
- package/mapboxgl/js/utils/SpatialRefUtils.js +198 -0
- package/mapboxgl/js/utils/SvgUtils.js +133 -0
- package/mapboxgl/js/utils/VerifyUtils.js +73 -0
- package/mapboxgl/js/widget/Pulser.js +88 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/0-255.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/1024-1279.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/10240-10495.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/10496-10751.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/10752-11007.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/11008-11263.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/11264-11519.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/11520-11775.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/11776-12031.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/12032-12287.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/12288-12543.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/12544-12799.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/1280-1535.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/12800-13055.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/13056-13311.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/13312-13567.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/13568-13823.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/13824-14079.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/14080-14335.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/14336-14591.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/14592-14847.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/14848-15103.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/15104-15359.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/1536-1791.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/15360-15615.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/15616-15871.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/15872-16127.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/16128-16383.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/16384-16639.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/16640-16895.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/16896-17151.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/17152-17407.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/17408-17663.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/17664-17919.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/1792-2047.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/17920-18175.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/18176-18431.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/18432-18687.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/18688-18943.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/18944-19199.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/19200-19455.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/19456-19711.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/19712-19967.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/19968-20223.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/20224-20479.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/2048-2303.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/20480-20735.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/20736-20991.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/20992-21247.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/21248-21503.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/21504-21759.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/21760-22015.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/22016-22271.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/22272-22527.pbf +154 -9
- package/mapboxgl/style/fonts/Microsoft YaHei/22528-22783.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/22784-23039.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/2304-2559.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/23040-23295.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/23296-23551.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/23552-23807.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/23808-24063.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/24064-24319.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/24320-24575.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/24576-24831.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/24832-25087.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/25088-25343.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/25344-25599.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/256-511.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/2560-2815.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/25600-25855.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/25856-26111.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/26112-26367.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/26368-26623.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/26624-26879.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/26880-27135.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/27136-27391.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/27392-27647.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/27648-27903.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/27904-28159.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/2816-3071.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/28160-28415.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/28416-28671.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/28672-28927.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/28928-29183.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/29184-29439.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/29440-29695.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/29696-29951.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/29952-30207.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/30208-30463.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/30464-30719.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/3072-3327.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/30720-30975.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/30976-31231.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/31232-31487.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/31488-31743.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/31744-31999.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/32000-32255.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/32256-32511.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/32512-32767.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/32768-33023.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/33024-33279.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/3328-3583.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/33280-33535.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/33536-33791.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/33792-34047.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/34048-34303.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/34304-34559.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/34560-34815.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/34816-35071.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/35072-35327.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/35328-35583.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/35584-35839.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/3584-3839.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/35840-36095.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/36096-36351.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/36352-36607.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/36608-36863.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/36864-37119.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/37120-37375.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/37376-37631.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/37632-37887.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/37888-38143.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/38144-38399.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/3840-4095.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/38400-38655.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/38656-38911.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/38912-39167.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/39168-39423.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/39424-39679.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/39680-39935.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/39936-40191.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/40192-40447.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/40448-40703.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/40704-40959.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/4096-4351.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/40960-41215.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/41216-41471.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/41472-41727.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/41728-41983.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/41984-42239.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/42240-42495.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/42496-42751.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/42752-43007.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/43008-43263.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/43264-43519.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/4352-4607.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/43520-43775.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/43776-44031.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/44032-44287.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/44288-44543.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/44544-44799.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/44800-45055.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/45056-45311.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/45312-45567.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/45568-45823.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/45824-46079.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/4608-4863.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/46080-46335.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/46336-46591.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/46592-46847.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/46848-47103.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/47104-47359.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/47360-47615.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/47616-47871.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/47872-48127.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/48128-48383.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/48384-48639.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/4864-5119.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/48640-48895.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/48896-49151.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/49152-49407.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/49408-49663.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/49664-49919.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/49920-50175.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/50176-50431.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/50432-50687.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/50688-50943.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/50944-51199.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/512-767.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/5120-5375.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/51200-51455.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/51456-51711.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/51712-51967.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/51968-52223.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/52224-52479.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/52480-52735.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/52736-52991.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/52992-53247.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/53248-53503.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/53504-53759.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/5376-5631.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/53760-54015.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/54016-54271.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/54272-54527.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/54528-54783.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/54784-55039.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/55040-55295.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/55296-55551.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/55552-55807.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/55808-56063.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/56064-56319.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/5632-5887.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/56320-56575.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/56576-56831.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/56832-57087.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/57088-57343.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/57344-57599.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/57600-57855.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/57856-58111.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/58112-58367.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/58368-58623.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/58624-58879.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/5888-6143.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/58880-59135.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/59136-59391.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/59392-59647.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/59648-59903.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/59904-60159.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/60160-60415.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/60416-60671.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/60672-60927.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/60928-61183.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/61184-61439.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/6144-6399.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/61440-61695.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/61696-61951.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/61952-62207.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/62208-62463.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/62464-62719.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/62720-62975.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/62976-63231.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/63232-63487.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/63488-63743.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/63744-63999.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/6400-6655.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/64000-64255.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/64256-64511.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/64512-64767.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/64768-65023.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/65024-65279.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/65280-65535.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/6656-6911.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/6912-7167.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/7168-7423.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/7424-7679.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/768-1023.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/7680-7935.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/7936-8191.pbf +3 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/8192-8447.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/8448-8703.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/8704-8959.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/8960-9215.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/9216-9471.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/9472-9727.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/9728-9983.pbf +0 -0
- package/mapboxgl/style/fonts/Microsoft YaHei/9984-10239.pbf +4 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/0-255.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/1024-1279.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/10240-10495.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/10496-10751.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/10752-11007.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/11008-11263.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/11264-11519.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/11520-11775.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/11776-12031.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/12032-12287.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/12288-12543.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/12544-12799.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/1280-1535.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/12800-13055.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/13056-13311.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/13312-13567.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/13568-13823.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/13824-14079.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/14080-14335.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/14336-14591.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/14592-14847.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/14848-15103.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/16384-16639.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/16640-16895.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/16896-17151.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/17152-17407.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/1792-2047.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/18432-18687.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/19968-20223.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/20224-20479.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/2048-2303.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/20736-20991.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/21248-21503.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/21504-21759.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/21760-22015.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/22016-22271.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/22272-22527.pbf +118 -19
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/22528-22783.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/22784-23039.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/2304-2559.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/23040-23295.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/23552-23807.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/24064-24319.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/24320-24575.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/24576-24831.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/24832-25087.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/25088-25343.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/25344-25599.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/256-511.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/2560-2815.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/25600-25855.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/25856-26111.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/26112-26367.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/26368-26623.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/2816-3071.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/3072-3327.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/31744-31999.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/32000-32255.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/32256-32511.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/32512-32767.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/32768-33023.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/33024-33279.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/3328-3583.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/33536-33791.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/33792-34047.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/34048-34303.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/34304-34559.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/34560-34815.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/34816-35071.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/35072-35327.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/35328-35583.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/3584-3839.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/35840-36095.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/36096-36351.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/36352-36607.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/36608-36863.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/37120-37375.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/37376-37631.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/37888-38143.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/38144-38399.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/38400-38655.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/38656-38911.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/38912-39167.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/39168-39423.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/39424-39679.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/39680-39935.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/39936-40191.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/40448-40703.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/40704-40959.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/40960-41215.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/41216-41471.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/41472-41727.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/41728-41983.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/41984-42239.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/42240-42495.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/42496-42751.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/42752-43007.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/43008-43263.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/43264-43519.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/43776-44031.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/44032-44287.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/44288-44543.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/44544-44799.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/44800-45055.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/45056-45311.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/45312-45567.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/45568-45823.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/46080-46335.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/46336-46591.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/46592-46847.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/46848-47103.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/47104-47359.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/47360-47615.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/47872-48127.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/48128-48383.pbf +78 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/48384-48639.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/49664-49919.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/50176-50431.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/50432-50687.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/50688-50943.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/50944-51199.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/512-767.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/5120-5375.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/51200-51455.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/51456-51711.pbf +117 -4
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/51712-51967.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/51968-52223.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/52480-52735.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/52736-52991.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/52992-53247.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/5376-5631.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/5632-5887.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/5888-6143.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/6144-6399.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/6400-6655.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/6656-6911.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/6912-7167.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/7168-7423.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/7424-7679.pbf +3 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/7680-7935.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/8192-8447.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/8448-8703.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/8704-8959.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/8960-9215.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/9216-9471.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/9472-9727.pbf +0 -0
- package/mapboxgl/style/fonts/Open Sans Regular,Arial Unicode MS Regular/9984-10239.pbf +0 -0
- package/mapboxgl/style/sprite/dark/sprite.json +1 -0
- package/mapboxgl/style/sprite/dark/sprite.png +0 -0
- package/mapboxgl/style/sprite/dark/sprite@2x.json +1 -0
- package/mapboxgl/style/sprite/dark/sprite@2x.png +0 -0
- package/mapboxgl/utils/mapbox.js +3821 -0
- package/mapboxgl/utils/mapbox_native.js +2037 -0
- package/mapboxgl/utils/mapboxgl.md +138 -0
- package/mapgis/js/datalayer/arcgis-layer/ArcGISMapImageLayer.js +586 -0
- package/mapgis/js/datalayer/arcgis-layer/ArcGISTileLayer.js +515 -0
- package/mapgis/js/datalayer/arcgis-layer/ArcGISVectorTileLayer.js +907 -0
- package/mapgis/js/datalayer/common-layer/Cesium3DTilesCacheLayer.js +1036 -0
- package/mapgis/js/datalayer/common-layer/EchartsLayer.js +861 -0
- package/mapgis/js/datalayer/igs-layer/IGSFeatureLayer.js +863 -0
- package/mapgis/js/datalayer/igs-layer/IGSImageryLayer.js +460 -0
- package/mapgis/js/datalayer/igs-layer/IGSImageryTileLayer.js +404 -0
- package/mapgis/js/datalayer/igs-layer/IGSMapImageLayer.js +607 -0
- package/mapgis/js/datalayer/igs-layer/IGSTileLayer.js +397 -0
- package/mapgis/js/datalayer/igs-layer/IGSVectorTileLayer.js +580 -0
- package/mapgis/js/datalayer/igs-layer/ISSceneLayer.js +328 -0
- package/mapgis/js/datalayer/igs-layer/ImageryLayer.js +463 -0
- package/mapgis/js/datalayer/igs-layer/ImageryTileLayer.js +413 -0
- package/mapgis/js/datalayer/index.js +206 -0
- package/mapgis/js/datalayer/ogc-layer/wfsLayer.js +670 -0
- package/mapgis/js/datalayer/ogc-layer/wmsLayer.js +418 -0
- package/mapgis/js/datalayer/ogc-layer/wmtsLayer.js +419 -0
- package/mapgis/utils/mapgis-common.js +2945 -0
- package/package.json +31 -0
|
@@ -0,0 +1,2270 @@
|
|
|
1
|
+
import DataUtils from "../utils/DataUtils";
|
|
2
|
+
import GeogUtils from "../utils/GeogUtils";
|
|
3
|
+
import VerifyUtils from "../utils/VerifyUtils";
|
|
4
|
+
import WKTProvider from "../geog/WKTProvider";
|
|
5
|
+
import GeoJsonProvider from "../geog/GeoJsonProvider";
|
|
6
|
+
import LayerProvider from "../geog/LayerProvider";
|
|
7
|
+
import MapProvider from "../geog/MapProvider";
|
|
8
|
+
import SimpleMarkerLayer from "../common/SimpleMarkerLayer";
|
|
9
|
+
import SimpleLineLayer from "../common/SimpleLineLayer";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 编辑提供类
|
|
13
|
+
*
|
|
14
|
+
* @alias EditorProvider
|
|
15
|
+
*
|
|
16
|
+
* @summary <用于编辑管网设施>
|
|
17
|
+
*/
|
|
18
|
+
export default class EditorProvider {
|
|
19
|
+
/**
|
|
20
|
+
* 构造函数
|
|
21
|
+
* @param {Object} options -图层选项
|
|
22
|
+
*/
|
|
23
|
+
constructor(options) {
|
|
24
|
+
/**
|
|
25
|
+
* 地图对象
|
|
26
|
+
* @type {Object}
|
|
27
|
+
*/
|
|
28
|
+
this._map = options.map;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* 最小缩放层级
|
|
32
|
+
* @type {Number}
|
|
33
|
+
*/
|
|
34
|
+
this._minzoom = DataUtils.default(options.minzoom, 10);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* 图标(表达式)
|
|
38
|
+
* @type {String|Object}
|
|
39
|
+
*/
|
|
40
|
+
this._icon = DataUtils.default(options.icon, undefined);
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 线颜色(表达式)
|
|
44
|
+
* @type {String|Object}
|
|
45
|
+
*/
|
|
46
|
+
this._lineColor = DataUtils.default(options.lineColor, undefined);
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* 线宽
|
|
50
|
+
* @type {Number}
|
|
51
|
+
*/
|
|
52
|
+
this._lineWidth = DataUtils.default(options.lineWidth, 10.5);
|
|
53
|
+
|
|
54
|
+
/** 图层样式 **/
|
|
55
|
+
// 点图标
|
|
56
|
+
this._markerAddIcon = 'editor_add'; // 添加
|
|
57
|
+
this._markerAddSelIcon = 'editor_add-sel'; // 选中添加
|
|
58
|
+
this._markerAddEditIcon = 'editor_add-edit'; // 编辑添加
|
|
59
|
+
this._markerSelIcon = 'editor_sel'; // 选中
|
|
60
|
+
this._markerEditIcon = 'editor_edit'; // 编辑
|
|
61
|
+
this._markerDelIcon = 'editor_del'; // 删除
|
|
62
|
+
this._arrowIcon = 'icon_directionred'; // 方向
|
|
63
|
+
// 线颜色
|
|
64
|
+
this._lineAddColor = '#176BC9'; // 添加
|
|
65
|
+
this._lineSelColor = '#87CEFA'; // 选中
|
|
66
|
+
this._lineDelColor = '#8C8C8C'; // 删除 #DC143C
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* 编辑日志
|
|
70
|
+
* @summery <[
|
|
71
|
+
* {index: 1, edit_state: 'add', fid: fid, layer_code: code, type: 'marker', feature: null},
|
|
72
|
+
* {index: 2, edit_state: 'edit', fid: fid, layer_code: code, type: 'line', feature: null},
|
|
73
|
+
* {index: 3, edit_state: 'delete', fid: fid, layer_code: code, type: 'line', feature: null},
|
|
74
|
+
* ]>
|
|
75
|
+
*/
|
|
76
|
+
this._editingLog = [];
|
|
77
|
+
/**
|
|
78
|
+
* 编辑日志
|
|
79
|
+
* @summery <[
|
|
80
|
+
* {index: 1, edit_state: 'add', type: 'marker', features: []},
|
|
81
|
+
* {index: 2, edit_state: 'edit', type: 'line', features: []},
|
|
82
|
+
* {index: 3, edit_state: 'delete', type: 'line', features: []},
|
|
83
|
+
* ]>
|
|
84
|
+
*/
|
|
85
|
+
this._editLog = [];
|
|
86
|
+
// 已编辑的数据
|
|
87
|
+
this._editedData = [];
|
|
88
|
+
|
|
89
|
+
/** 要素集 **/
|
|
90
|
+
// 点要素集
|
|
91
|
+
this._pointFC = GeoJsonProvider.getEmptyFC();
|
|
92
|
+
// 线要素集
|
|
93
|
+
this._polylineFC = GeoJsonProvider.getEmptyFC();
|
|
94
|
+
// 线中心点要素集
|
|
95
|
+
this._centerPointFC = GeoJsonProvider.getEmptyFC();
|
|
96
|
+
|
|
97
|
+
/** 图层 **/
|
|
98
|
+
this._addedFaciMarkerLayer = null; // 添加的设施点图层
|
|
99
|
+
this._addedMarkerLayer = null; // 添加的点图层
|
|
100
|
+
this._selectedMarkerLayer = null; // 选中的点图层
|
|
101
|
+
this._editedMarkerLayer = null; // 编辑的点图层
|
|
102
|
+
this._deletedMarkerLayer = null; // 删除的点图层
|
|
103
|
+
|
|
104
|
+
this._lineCenterMarkerLayer = null; // 线中心点图层
|
|
105
|
+
this._lineDirectionMarkerLayer = null; // 线方向点图层
|
|
106
|
+
this._addedFaciLineLayer = null; // 添加的设施线图层
|
|
107
|
+
this._addedLineLayer = null; // 添加的线图层
|
|
108
|
+
this._selectedLineLayer = null; // 选中的线图层
|
|
109
|
+
this._editedLineLayer = null; // 编辑的线图层
|
|
110
|
+
this._deletedLineLayer = null; // 删除的线图层
|
|
111
|
+
// 线图层是否已移动
|
|
112
|
+
this._isAddedLineLayerMoved = false;
|
|
113
|
+
this._isSelectedLineLayerMoved = false;
|
|
114
|
+
this._isEditedLineLayerMoved = false;
|
|
115
|
+
this._isDeletedLineLayerMoved = false;
|
|
116
|
+
|
|
117
|
+
// 初始化图层
|
|
118
|
+
this._initLayers();
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** 公有方法 **/
|
|
122
|
+
/**
|
|
123
|
+
* 设置数据
|
|
124
|
+
* @param {Array} data -GeoJSON要素集合
|
|
125
|
+
*/
|
|
126
|
+
setData(data) {
|
|
127
|
+
if (!data ||
|
|
128
|
+
!VerifyUtils.isArray(data) || data.length === 0 ||
|
|
129
|
+
(VerifyUtils.isArray(data) && !VerifyUtils.isGeoJsonFeature(data[0]))) return;
|
|
130
|
+
|
|
131
|
+
this._editingLog = [];
|
|
132
|
+
this._editLog = [];
|
|
133
|
+
this._editedData = data;
|
|
134
|
+
|
|
135
|
+
// 更新数据
|
|
136
|
+
this._updateData(data);
|
|
137
|
+
// 缩放到要素范围
|
|
138
|
+
this._fitBounds();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* 添加数据
|
|
143
|
+
* @param {String} type -编辑类型(add、select、edit、reverse、delete)
|
|
144
|
+
* @param {Object|Array} data -GeoJSON要素/要素集合
|
|
145
|
+
*/
|
|
146
|
+
appendData(type, data) {
|
|
147
|
+
let features = null;
|
|
148
|
+
if (VerifyUtils.isArray(data)) {
|
|
149
|
+
if (data.length === 0 || !VerifyUtils.isGeoJsonFeature(data[0])) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
features = data;
|
|
153
|
+
} else if (VerifyUtils.isGeoJsonFeature(data)) {
|
|
154
|
+
features = [data];
|
|
155
|
+
}
|
|
156
|
+
if (!features || features.length === 0) return;
|
|
157
|
+
|
|
158
|
+
// 添加操作日志
|
|
159
|
+
if (type !== 'select') {
|
|
160
|
+
this._appendLog(type, features);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (type !== 'reverse') { // 非反转图形
|
|
164
|
+
// 获取点要素列表
|
|
165
|
+
const pointFeatures = features.filter((fea) => {
|
|
166
|
+
return fea.geometry.type.toLowerCase() === 'point';
|
|
167
|
+
});
|
|
168
|
+
if (pointFeatures.length > 0) {
|
|
169
|
+
// 更新点数据
|
|
170
|
+
this._updateMarkerData(type, pointFeatures);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// 获取线要素列表
|
|
175
|
+
let lineFeatures = features.filter((fea) => {
|
|
176
|
+
return fea.geometry.type.toLowerCase() === 'linestring' ||
|
|
177
|
+
fea.geometry.type.toLowerCase() === 'multilinestring';
|
|
178
|
+
});
|
|
179
|
+
if (type === 'reverse') {
|
|
180
|
+
// 去除掉添加/反转的数据
|
|
181
|
+
lineFeatures = lineFeatures.filter((fea) => {
|
|
182
|
+
let editState = fea.properties.edit_state;
|
|
183
|
+
return !editState || (
|
|
184
|
+
editState.indexOf('add') < 0 &&
|
|
185
|
+
editState.indexOf('edit-reverse') < 0
|
|
186
|
+
);
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
if (lineFeatures.length > 0) {
|
|
190
|
+
// 更新线数据
|
|
191
|
+
this._updateLineData(type, lineFeatures);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* 选择数据
|
|
197
|
+
* @param {Object|Array} data -GeoJSON要素/要素集合
|
|
198
|
+
*/
|
|
199
|
+
selectData(data) {
|
|
200
|
+
let features = null;
|
|
201
|
+
|
|
202
|
+
if (VerifyUtils.isArray(data)) {
|
|
203
|
+
if (data.length === 0 || !VerifyUtils.isGeoJsonFeature(data[0])) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
features = data;
|
|
207
|
+
} else if (VerifyUtils.isGeoJsonFeature(data)) {
|
|
208
|
+
features = [data];
|
|
209
|
+
}
|
|
210
|
+
if (!features || features.length === 0) return;
|
|
211
|
+
|
|
212
|
+
const editType = 'select';
|
|
213
|
+
|
|
214
|
+
let pointFeatures = features.filter((fea) => {
|
|
215
|
+
return fea.geometry.type.toLowerCase() === 'point'
|
|
216
|
+
});
|
|
217
|
+
let lineFeatures = features.filter((fea) => {
|
|
218
|
+
return (
|
|
219
|
+
fea.geometry.type.toLowerCase() === 'linestring' ||
|
|
220
|
+
fea.geometry.type.toLowerCase() === 'multilinestring'
|
|
221
|
+
)
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
// 更新点数据源
|
|
225
|
+
if (pointFeatures.length > 0) {
|
|
226
|
+
// 过滤该类型的要素集合
|
|
227
|
+
this._pointFC.features = this._pointFC.features.filter((fea) => {
|
|
228
|
+
return fea.properties.edit_state !== editType;
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
this._updateMarkerData(editType, pointFeatures);
|
|
232
|
+
}
|
|
233
|
+
// 更新线数据源
|
|
234
|
+
if (lineFeatures.length > 0) {
|
|
235
|
+
// 过滤该类型的要素集合
|
|
236
|
+
this._polylineFC.features = this._polylineFC.features.filter((fea) => {
|
|
237
|
+
return fea.properties.edit_state !== editType;
|
|
238
|
+
});
|
|
239
|
+
this._centerPointFC.features = this._centerPointFC.features.filter((fea) => {
|
|
240
|
+
return fea.properties.edit_state !== editType;
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
this._updateLineData(editType, lineFeatures);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/*
|
|
247
|
+
if (!VerifyUtils.isGeoJsonFeature(data)) return;
|
|
248
|
+
|
|
249
|
+
const editType = 'select';
|
|
250
|
+
const feature = data;
|
|
251
|
+
|
|
252
|
+
const geomType = feature.geometry.type.toLowerCase();
|
|
253
|
+
switch (geomType) {
|
|
254
|
+
case 'point': {
|
|
255
|
+
// 过滤该类型的要素集合
|
|
256
|
+
this._pointFC.features = this._pointFC.features.filter((fea) => {
|
|
257
|
+
return fea.properties.edit_state !== editType;
|
|
258
|
+
});
|
|
259
|
+
// 更新点数据
|
|
260
|
+
this._updateMarkerData(editType, [feature]);
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
case 'linestring':
|
|
264
|
+
case 'multilinestring': {
|
|
265
|
+
// 过滤该类型的要素集合
|
|
266
|
+
this._polylineFC.features = this._polylineFC.features.filter((fea) => {
|
|
267
|
+
return fea.properties.edit_state !== editType;
|
|
268
|
+
});
|
|
269
|
+
this._centerPointFC.features = this._centerPointFC.features.filter((fea) => {
|
|
270
|
+
return fea.properties.edit_state !== editType;
|
|
271
|
+
});
|
|
272
|
+
// 更新线数据
|
|
273
|
+
this._updateLineData(editType, [feature]);
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
case 'polygon':
|
|
277
|
+
case 'multipolygon': {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
default:
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
*/
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* 撤销
|
|
288
|
+
* @param {Function} callback -回调
|
|
289
|
+
*/
|
|
290
|
+
undo_old(callback) {
|
|
291
|
+
let log = this._editingLog;
|
|
292
|
+
if (log.length === 0) {
|
|
293
|
+
callback(false, null);
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// 获取最后一个序号的日志列表
|
|
298
|
+
let currIndex = log[log.length - 1].index;
|
|
299
|
+
let logItems = log.filter((item) => {
|
|
300
|
+
return item.index === currIndex;
|
|
301
|
+
});
|
|
302
|
+
// 去除最后一个序号的日志列表
|
|
303
|
+
this._editingLog = log.filter((item) => {
|
|
304
|
+
return item.index !== currIndex;
|
|
305
|
+
});
|
|
306
|
+
log = this._editingLog;
|
|
307
|
+
const canUndo = log.length > 0;
|
|
308
|
+
|
|
309
|
+
let logItem = logItems[0];
|
|
310
|
+
if (logItem.type === 'marker') { // 点图层
|
|
311
|
+
const fc = this._pointFC;
|
|
312
|
+
|
|
313
|
+
switch (logItem.edit_state) {
|
|
314
|
+
case 'add': { // 添加
|
|
315
|
+
fc.features = fc.features.filter((fea) => {
|
|
316
|
+
let editState = fea.properties.edit_state;
|
|
317
|
+
let isAddState = editState === 'add' || editState === 'add-select';
|
|
318
|
+
return !isAddState || (isAddState && fea.properties.fid !== logItem.fid);
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
// 更新数据源
|
|
322
|
+
this._addedFaciMarkerLayer.setData(fc);
|
|
323
|
+
this._addedMarkerLayer.setData(fc);
|
|
324
|
+
|
|
325
|
+
// 回调
|
|
326
|
+
callback(canUndo, null);
|
|
327
|
+
break;
|
|
328
|
+
}
|
|
329
|
+
case 'edit': { // 编辑
|
|
330
|
+
let found = findPrevLogFeatures(logItem, log, fc.features);
|
|
331
|
+
if (!found) {
|
|
332
|
+
// 去除编辑的要素
|
|
333
|
+
fc.features = fc.features.filter((fea) => {
|
|
334
|
+
let isEditState = fea.properties.edit_state.indexOf('edit') === 0;
|
|
335
|
+
return !isEditState ||
|
|
336
|
+
(isEditState && fea.properties.fid !== logItem.fid);
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
// 更新数据源
|
|
341
|
+
this._editedMarkerLayer.setData(fc);
|
|
342
|
+
this._selectedMarkerLayer.setData(fc);
|
|
343
|
+
this._addedFaciMarkerLayer.setData(fc);
|
|
344
|
+
this._addedMarkerLayer.setData(fc);
|
|
345
|
+
|
|
346
|
+
// 回调
|
|
347
|
+
let tmpFeas = [];
|
|
348
|
+
if (found) {
|
|
349
|
+
tmpFeas = fc.features.filter((fea) => {
|
|
350
|
+
return fea.properties.fid === logItem.fid;
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
callback(canUndo, tmpFeas.length > 0 ? tmpFeas[0] : null);
|
|
354
|
+
break;
|
|
355
|
+
}
|
|
356
|
+
case 'delete': {
|
|
357
|
+
let found = findPrevLogFeatures(logItem, log, fc.features);
|
|
358
|
+
if (!found) {
|
|
359
|
+
// 去除删除的要素
|
|
360
|
+
fc.features = fc.features.filter((fea) => {
|
|
361
|
+
let isDelState = fea.properties.edit_state === 'delete';
|
|
362
|
+
return !isDelState ||
|
|
363
|
+
(isDelState && fea.properties.fid !== logItem.fid);
|
|
364
|
+
});
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
// 更新数据源
|
|
368
|
+
this._deletedMarkerLayer.setData(fc);
|
|
369
|
+
this._editedMarkerLayer.setData(fc);
|
|
370
|
+
this._selectedMarkerLayer.setData(fc);
|
|
371
|
+
this._addedFaciMarkerLayer.setData(fc);
|
|
372
|
+
this._addedMarkerLayer.setData(fc);
|
|
373
|
+
|
|
374
|
+
let tmpFeas = [];
|
|
375
|
+
if (found) {
|
|
376
|
+
tmpFeas = fc.features.filter((fea) => {
|
|
377
|
+
return fea.properties.fid === logItem.fid;
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
callback(canUndo, tmpFeas.length > 0 ? tmpFeas[0] : null);
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
383
|
+
default:
|
|
384
|
+
break;
|
|
385
|
+
}
|
|
386
|
+
} else if (logItem.type === 'line') { // 线图层
|
|
387
|
+
const fc = this._polylineFC;
|
|
388
|
+
const centerFC = this._centerPointFC;
|
|
389
|
+
|
|
390
|
+
switch (logItem.edit_state) {
|
|
391
|
+
case 'add': { // 添加
|
|
392
|
+
fc.features = fc.features.filter((fea) => {
|
|
393
|
+
let editState = fea.properties.edit_state;
|
|
394
|
+
let isAddState = editState === 'add' || editState === 'add-select';
|
|
395
|
+
|
|
396
|
+
return !isAddState || (isAddState && fea.properties.fid !== logItem.fid);
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
centerFC.features = centerFC.features.filter((fea) => {
|
|
400
|
+
let editState = fea.properties.edit_state;
|
|
401
|
+
let isAddState = editState === 'add' || editState === 'add-select';
|
|
402
|
+
|
|
403
|
+
return !isAddState || (isAddState && fea.properties.fid !== logItem.fid);
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
// 更新数据源
|
|
407
|
+
this._addedLineLayer.setData(fc);
|
|
408
|
+
this._addedFaciLineLayer.setData(fc);
|
|
409
|
+
this._lineCenterMarkerLayer.setData(centerFC);
|
|
410
|
+
|
|
411
|
+
// 回调
|
|
412
|
+
callback(canUndo, null);
|
|
413
|
+
break;
|
|
414
|
+
}
|
|
415
|
+
case 'edit': { // 编辑
|
|
416
|
+
let found = findPrevLogFeatures(logItem, log, fc.features, centerFC.features);
|
|
417
|
+
if (!found) {
|
|
418
|
+
// 去除编辑的要素
|
|
419
|
+
fc.features = fc.features.filter((fea) => {
|
|
420
|
+
let isEditState = fea.properties.edit_state.indexOf('edit') === 0;
|
|
421
|
+
return !isEditState ||
|
|
422
|
+
(isEditState && fea.properties.fid !== logItem.fid);
|
|
423
|
+
});
|
|
424
|
+
|
|
425
|
+
centerFC.features = centerFC.features.filter((fea) => {
|
|
426
|
+
let isEditState = fea.properties.edit_state.indexOf('edit') === 0;
|
|
427
|
+
return !isEditState ||
|
|
428
|
+
(isEditState && fea.properties.fid !== logItem.fid);
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// 更新数据源
|
|
433
|
+
this._editedLineLayer.setData(fc);
|
|
434
|
+
this._selectedLineLayer.setData(fc);
|
|
435
|
+
this._addedLineLayer.setData(fc);
|
|
436
|
+
this._addedFaciLineLayer.setData(fc);
|
|
437
|
+
this._lineCenterMarkerLayer.setData(centerFC);
|
|
438
|
+
this._lineDirectionMarkerLayer.setData(centerFC);
|
|
439
|
+
|
|
440
|
+
// 回调
|
|
441
|
+
let tmpFeas = [];
|
|
442
|
+
if (found) {
|
|
443
|
+
tmpFeas = fc.features.filter((fea) => {
|
|
444
|
+
return fea.properties.fid === logItem.fid;
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
callback(canUndo, tmpFeas.length > 0 ? tmpFeas[0] : null);
|
|
448
|
+
break;
|
|
449
|
+
}
|
|
450
|
+
case 'delete': { // 删除
|
|
451
|
+
let found = findPrevLogFeatures(logItem, log, fc.features, centerFC.features);
|
|
452
|
+
if (!found) {
|
|
453
|
+
// 去除编辑的要素
|
|
454
|
+
fc.features = fc.features.filter((fea) => {
|
|
455
|
+
let isDelState = fea.properties.edit_state === 'delete';
|
|
456
|
+
return !isDelState ||
|
|
457
|
+
(isDelState && fea.properties.fid !== logItem.fid);
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
centerFC.features = centerFC.features.filter((fea) => {
|
|
461
|
+
let isDelState = fea.properties.edit_state === 'delete';
|
|
462
|
+
return !isDelState ||
|
|
463
|
+
(isDelState && fea.properties.fid !== logItem.fid);
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// 更新数据源
|
|
468
|
+
this._deletedLineLayer.setData(fc);
|
|
469
|
+
this._editedLineLayer.setData(fc);
|
|
470
|
+
this._selectedLineLayer.setData(fc);
|
|
471
|
+
this._addedLineLayer.setData(fc);
|
|
472
|
+
this._addedFaciLineLayer.setData(fc);
|
|
473
|
+
this._lineCenterMarkerLayer.setData(centerFC);
|
|
474
|
+
|
|
475
|
+
// 回调
|
|
476
|
+
let tmpFeas = [];
|
|
477
|
+
if (found) {
|
|
478
|
+
tmpFeas = fc.features.filter((fea) => {
|
|
479
|
+
return fea.properties.fid === logItem.fid;
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
callback(canUndo, tmpFeas.length > 0 ? tmpFeas[0] : null);
|
|
483
|
+
break;
|
|
484
|
+
}
|
|
485
|
+
default:
|
|
486
|
+
break;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
// 处理台账跳转过来的情况
|
|
491
|
+
if (!canUndo && this._editedData.length > 0) {
|
|
492
|
+
this._updateData(this._editedData);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* 查找之前的日志项
|
|
497
|
+
* @param {Object} item -当前日志项
|
|
498
|
+
* @param {Array} log -日志列表
|
|
499
|
+
* @param {Array} features -要素集合
|
|
500
|
+
*
|
|
501
|
+
* @returns {Boolean}
|
|
502
|
+
*/
|
|
503
|
+
function findPrevLogFeatures(item, log, features, centerFeatures = null) {
|
|
504
|
+
// 查找日志项
|
|
505
|
+
for (let i = log.length - 1; i >= 0; i--) {
|
|
506
|
+
if (log[i].fid === item.fid) {
|
|
507
|
+
let prevFea = log[i].feature;
|
|
508
|
+
|
|
509
|
+
// 处理要素集合为空的情况
|
|
510
|
+
if (features.length === 0) {
|
|
511
|
+
features.push(prevFea);
|
|
512
|
+
}
|
|
513
|
+
if (centerFeatures && centerFeatures.length === 0) {
|
|
514
|
+
// 计算线中点
|
|
515
|
+
let center = GeogUtils.calcCenter(prevFea);
|
|
516
|
+
|
|
517
|
+
let centerFea = GeoJsonProvider.getPointFeature(center, prevFea.properties);
|
|
518
|
+
centerFeatures.push(centerFea);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
// 查找要素
|
|
522
|
+
let itemFeas = features.filter((fea) => {
|
|
523
|
+
return fea.properties.fid === item.fid;
|
|
524
|
+
});
|
|
525
|
+
if (itemFeas.length === 0) {
|
|
526
|
+
return false;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// 更新要素坐标、属性
|
|
530
|
+
itemFeas.forEach((fea) => {
|
|
531
|
+
fea.geometry.coordinates = prevFea.geometry.coordinates;
|
|
532
|
+
fea.properties = prevFea.properties;
|
|
533
|
+
});
|
|
534
|
+
|
|
535
|
+
// 更新线中点的编辑状态
|
|
536
|
+
if (centerFeatures && centerFeatures.length > 0) {
|
|
537
|
+
let tmpFeas = centerFeatures.filter((fea) => {
|
|
538
|
+
return fea.properties.fid === item.fid;
|
|
539
|
+
});
|
|
540
|
+
tmpFeas.forEach((fea) => {
|
|
541
|
+
fea.properties.edit_state = prevFea.properties.edit_state;
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
return true;
|
|
546
|
+
}
|
|
547
|
+
} // end of for (...)
|
|
548
|
+
|
|
549
|
+
return false;
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* 撤销
|
|
555
|
+
* @param {Function} callback -回调
|
|
556
|
+
*/
|
|
557
|
+
undo(callback) {
|
|
558
|
+
let editLog = this._editLog;
|
|
559
|
+
if (editLog.length === 0) {
|
|
560
|
+
callback(false, null);
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
// 获取最后一个序号的日志列表
|
|
565
|
+
let currIndex = editLog[editLog.length - 1].index;
|
|
566
|
+
let logItems = editLog.filter(item => item.index === currIndex);
|
|
567
|
+
let logItem = logItems[0];
|
|
568
|
+
|
|
569
|
+
// 去除最后一个序号的日志列表
|
|
570
|
+
this._editLog = editLog.filter(item => item.index !== currIndex);
|
|
571
|
+
editLog = this._editLog;
|
|
572
|
+
const canUndo = editLog.length > 0;
|
|
573
|
+
|
|
574
|
+
if (logItem.type === 'marker') { // 点图层
|
|
575
|
+
const fc = this._pointFC;
|
|
576
|
+
|
|
577
|
+
switch (logItem.edit_state) {
|
|
578
|
+
case 'add': { // 添加
|
|
579
|
+
// 过滤添加的点要素
|
|
580
|
+
fc.features = fc.features.filter((feature) => {
|
|
581
|
+
let isAddState = (
|
|
582
|
+
feature.properties.edit_state === 'add' ||
|
|
583
|
+
feature.properties.edit_state === 'add-select'
|
|
584
|
+
);
|
|
585
|
+
|
|
586
|
+
return (
|
|
587
|
+
!isAddState ||
|
|
588
|
+
(isAddState && !logItem.features.some((itemFea) => {
|
|
589
|
+
return itemFea.properties.fid === feature.properties.fid
|
|
590
|
+
}))
|
|
591
|
+
);
|
|
592
|
+
});
|
|
593
|
+
|
|
594
|
+
// 更新数据源
|
|
595
|
+
this._addedFaciMarkerLayer.setData(fc);
|
|
596
|
+
this._addedMarkerLayer.setData(fc);
|
|
597
|
+
|
|
598
|
+
// 回调
|
|
599
|
+
callback(canUndo, null);
|
|
600
|
+
break;
|
|
601
|
+
}
|
|
602
|
+
case 'edit':
|
|
603
|
+
case 'delete': { // 编辑/删除
|
|
604
|
+
let resFeas = [];
|
|
605
|
+
// 查找之前日志要素
|
|
606
|
+
const found = findPrevFeatures(logItem, editLog, fc.features);
|
|
607
|
+
if (found) {
|
|
608
|
+
resFeas = fc.features.filter((feature) => {
|
|
609
|
+
return logItem.features.some((itemFea) => {
|
|
610
|
+
return itemFea.properties.fid = feature.properties.fid
|
|
611
|
+
})
|
|
612
|
+
});
|
|
613
|
+
} else {
|
|
614
|
+
const state = logItem.edit_state;
|
|
615
|
+
// 过滤编辑/删除的要素
|
|
616
|
+
fc.features = fc.features.filter((feature) => {
|
|
617
|
+
let isEditState = feature.properties.edit_state.indexOf(state) === 0;
|
|
618
|
+
|
|
619
|
+
return (
|
|
620
|
+
!isEditState ||
|
|
621
|
+
(isEditState && !logItem.features.some((itemFea) => {
|
|
622
|
+
return itemFea.properties.fid === feature.properties.fid
|
|
623
|
+
}))
|
|
624
|
+
);
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
// 更新数据源
|
|
629
|
+
this._deletedMarkerLayer.setData(fc);
|
|
630
|
+
this._editedMarkerLayer.setData(fc);
|
|
631
|
+
this._selectedMarkerLayer.setData(fc);
|
|
632
|
+
this._addedFaciMarkerLayer.setData(fc);
|
|
633
|
+
this._addedMarkerLayer.setData(fc);
|
|
634
|
+
|
|
635
|
+
// 回调
|
|
636
|
+
callback(canUndo, resFeas.length > 0 ? resFeas[0] : null);
|
|
637
|
+
break;
|
|
638
|
+
}
|
|
639
|
+
default:
|
|
640
|
+
break;
|
|
641
|
+
}
|
|
642
|
+
} else if (logItem.type === 'line') { // 线图层
|
|
643
|
+
const fc = this._polylineFC;
|
|
644
|
+
const centerFC = this._centerPointFC;
|
|
645
|
+
|
|
646
|
+
switch (logItem.edit_state) {
|
|
647
|
+
case 'add': { // 添加
|
|
648
|
+
// 过滤添加的线要素
|
|
649
|
+
fc.features = fc.features.filter((feature) => {
|
|
650
|
+
let isAddState = (
|
|
651
|
+
feature.properties.edit_state === 'add' ||
|
|
652
|
+
feature.properties.edit_state === 'add-select'
|
|
653
|
+
);
|
|
654
|
+
|
|
655
|
+
return (
|
|
656
|
+
!isAddState ||
|
|
657
|
+
(isAddState && !logItem.features.some((itemFea) => {
|
|
658
|
+
return itemFea.properties.fid === feature.properties.fid
|
|
659
|
+
}))
|
|
660
|
+
);
|
|
661
|
+
});
|
|
662
|
+
// 过滤添加的线中点要素
|
|
663
|
+
centerFC.features = centerFC.features.filter((feature) => {
|
|
664
|
+
let isAddState = (
|
|
665
|
+
feature.properties.edit_state === 'add' ||
|
|
666
|
+
feature.properties.edit_state === 'add-select'
|
|
667
|
+
);
|
|
668
|
+
|
|
669
|
+
return (
|
|
670
|
+
!isAddState ||
|
|
671
|
+
(isAddState && !logItem.features.some((itemFea) => {
|
|
672
|
+
return itemFea.properties.fid === feature.properties.fid
|
|
673
|
+
}))
|
|
674
|
+
);
|
|
675
|
+
});
|
|
676
|
+
|
|
677
|
+
// 更新数据源
|
|
678
|
+
this._addedLineLayer.setData(fc);
|
|
679
|
+
this._addedFaciLineLayer.setData(fc);
|
|
680
|
+
this._lineCenterMarkerLayer.setData(centerFC);
|
|
681
|
+
|
|
682
|
+
// 回调
|
|
683
|
+
callback(canUndo, null);
|
|
684
|
+
break;
|
|
685
|
+
}
|
|
686
|
+
case 'edit':
|
|
687
|
+
case 'delete': { // 编辑/删除
|
|
688
|
+
let resFeas = [];
|
|
689
|
+
// 查找之前日志要素
|
|
690
|
+
const found = findPrevFeatures(logItem, editLog, fc.features, centerFC.features);
|
|
691
|
+
if (found) {
|
|
692
|
+
resFeas = fc.features.filter((feature) => {
|
|
693
|
+
return logItem.features.some((itemFea) => {
|
|
694
|
+
return itemFea.properties.fid = feature.properties.fid
|
|
695
|
+
})
|
|
696
|
+
});
|
|
697
|
+
} else {
|
|
698
|
+
const state = logItem.edit_state;
|
|
699
|
+
// 过滤编辑/删除的线要素
|
|
700
|
+
fc.features = fc.features.filter((feature) => {
|
|
701
|
+
let isEditState = feature.properties.edit_state.indexOf(state) === 0;
|
|
702
|
+
|
|
703
|
+
return (
|
|
704
|
+
!isEditState ||
|
|
705
|
+
(isEditState && !logItem.features.some((itemFea) => {
|
|
706
|
+
return itemFea.properties.fid === feature.properties.fid
|
|
707
|
+
}))
|
|
708
|
+
);
|
|
709
|
+
});
|
|
710
|
+
|
|
711
|
+
// 过滤编辑/删除的线中点要素
|
|
712
|
+
centerFC.features = centerFC.features.filter((feature) => {
|
|
713
|
+
let isEditState = feature.properties.edit_state.indexOf(state) === 0;
|
|
714
|
+
|
|
715
|
+
return (
|
|
716
|
+
!isEditState ||
|
|
717
|
+
(isEditState && !logItem.features.some((itemFea) => {
|
|
718
|
+
return itemFea.properties.fid === feature.properties.fid
|
|
719
|
+
}))
|
|
720
|
+
);
|
|
721
|
+
});
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
// 更新数据源
|
|
725
|
+
this._deletedLineLayer.setData(fc);
|
|
726
|
+
this._editedLineLayer.setData(fc);
|
|
727
|
+
this._selectedLineLayer.setData(fc);
|
|
728
|
+
this._addedLineLayer.setData(fc);
|
|
729
|
+
this._addedFaciLineLayer.setData(fc);
|
|
730
|
+
this._lineCenterMarkerLayer.setData(centerFC);
|
|
731
|
+
this._lineDirectionMarkerLayer.setData(centerFC);
|
|
732
|
+
|
|
733
|
+
// 回调
|
|
734
|
+
callback(canUndo, resFeas.length > 0 ? resFeas[0] : null);
|
|
735
|
+
break;
|
|
736
|
+
}
|
|
737
|
+
default:
|
|
738
|
+
break;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
// 处理台账跳转过来的情况
|
|
743
|
+
if (!canUndo && this._editedData.length > 0) {
|
|
744
|
+
this._updateData(this._editedData);
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* 查找之前的日志项要素
|
|
749
|
+
* @param {Object} logItem -当前日志项
|
|
750
|
+
* @param {Array} editLog -编辑日志(除去当前日志项)
|
|
751
|
+
* @param {Array} features -要素集合
|
|
752
|
+
* @param {Array} centerFeatures -线终点要素集合
|
|
753
|
+
*
|
|
754
|
+
* @returns {Boolean}
|
|
755
|
+
*/
|
|
756
|
+
function findPrevFeatures(logItem, editLog, features, centerFeatures = null) {
|
|
757
|
+
let foundCount = 0;
|
|
758
|
+
|
|
759
|
+
for (let i = 0; i < logItem.features.length; i++) {
|
|
760
|
+
const itemFea = logItem.features[i];
|
|
761
|
+
const itemProps = itemFea.properties;
|
|
762
|
+
|
|
763
|
+
// 查找日志项
|
|
764
|
+
for (let j = editLog.length - 1; j >= 0; j--) {
|
|
765
|
+
const prevFeas = editLog[j].features.filter((fea) => {
|
|
766
|
+
return fea.properties.fid === itemProps.fid
|
|
767
|
+
});
|
|
768
|
+
if (prevFeas.length === 0) continue;
|
|
769
|
+
|
|
770
|
+
let prevFea = prevFeas[0];
|
|
771
|
+
|
|
772
|
+
// 处理要素集合为空的情况
|
|
773
|
+
if (features.length === 0) {
|
|
774
|
+
features.push(prevFea);
|
|
775
|
+
}
|
|
776
|
+
if (centerFeatures && centerFeatures.length === 0) {
|
|
777
|
+
// 计算线中点
|
|
778
|
+
let center = GeogUtils.calcCenter(prevFea);
|
|
779
|
+
|
|
780
|
+
let centerFea = GeoJsonProvider.getPointFeature(center, prevFea.properties);
|
|
781
|
+
centerFeatures.push(centerFea);
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
// 查找要素
|
|
785
|
+
let itemFeas = features.filter((fea) => {
|
|
786
|
+
return fea.properties.fid === itemProps.fid;
|
|
787
|
+
});
|
|
788
|
+
if (itemFeas.length === 0) continue;
|
|
789
|
+
|
|
790
|
+
// 更新要素坐标、属性
|
|
791
|
+
itemFeas.forEach((fea) => {
|
|
792
|
+
fea.geometry.coordinates = prevFea.geometry.coordinates;
|
|
793
|
+
fea.properties = prevFea.properties;
|
|
794
|
+
});
|
|
795
|
+
|
|
796
|
+
// 更新线中点的编辑状态
|
|
797
|
+
if (centerFeatures && centerFeatures.length > 0) {
|
|
798
|
+
let tmpFeas = centerFeatures.filter((fea) => {
|
|
799
|
+
return fea.properties.fid === itemProps.fid;
|
|
800
|
+
});
|
|
801
|
+
tmpFeas.forEach((fea) => {
|
|
802
|
+
fea.properties.edit_state = prevFea.properties.edit_state;
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
foundCount++;
|
|
807
|
+
} // end of for (...)
|
|
808
|
+
};
|
|
809
|
+
|
|
810
|
+
return foundCount > 0;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
/**
|
|
815
|
+
* 清除日志
|
|
816
|
+
*/
|
|
817
|
+
clearLog() {
|
|
818
|
+
this._editingLog = [];
|
|
819
|
+
this._editLog = [];
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
/**
|
|
823
|
+
* 清除选中的数据
|
|
824
|
+
*/
|
|
825
|
+
clearSelectedData() {
|
|
826
|
+
// 点数据
|
|
827
|
+
this._clearSelectedMarkerData();
|
|
828
|
+
|
|
829
|
+
// 线数据
|
|
830
|
+
this._clearSelectedLineData();
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* 获取数据
|
|
835
|
+
*
|
|
836
|
+
* @return {Array}
|
|
837
|
+
*/
|
|
838
|
+
getData() {
|
|
839
|
+
let data = [];
|
|
840
|
+
|
|
841
|
+
// 点要素集
|
|
842
|
+
this._pointFC.features.forEach((fea) => {
|
|
843
|
+
if (fea.properties.edit_state !== 'select') {
|
|
844
|
+
const properties = DataUtils.clone(fea.properties);
|
|
845
|
+
switch (properties.edit_state) {
|
|
846
|
+
case 'add-select':
|
|
847
|
+
case 'add-edit':
|
|
848
|
+
case 'add-edit-select': {
|
|
849
|
+
properties.edit_state = 'add';
|
|
850
|
+
break;
|
|
851
|
+
}
|
|
852
|
+
case 'edit-select': {
|
|
853
|
+
properties.edit_state = 'edit';
|
|
854
|
+
break;
|
|
855
|
+
}
|
|
856
|
+
default:
|
|
857
|
+
break;
|
|
858
|
+
}
|
|
859
|
+
// 获取WKT格式几何图形
|
|
860
|
+
properties.geom = WKTProvider.fromGeometry(fea.geometry);
|
|
861
|
+
|
|
862
|
+
data.push(properties);
|
|
863
|
+
}
|
|
864
|
+
});
|
|
865
|
+
|
|
866
|
+
// 线要素集
|
|
867
|
+
this._polylineFC.features.forEach((fea) => {
|
|
868
|
+
if (fea.properties.edit_state !== 'select') {
|
|
869
|
+
const properties = DataUtils.clone(fea.properties);
|
|
870
|
+
switch (properties.edit_state) {
|
|
871
|
+
case 'add-select':
|
|
872
|
+
case 'add-edit':
|
|
873
|
+
case 'add-edit-select': {
|
|
874
|
+
properties.edit_state = 'add';
|
|
875
|
+
break;
|
|
876
|
+
}
|
|
877
|
+
case 'edit-select':
|
|
878
|
+
case 'edit-reverse':
|
|
879
|
+
case 'edit-reverse-select': {
|
|
880
|
+
properties.edit_state = 'edit';
|
|
881
|
+
break;
|
|
882
|
+
}
|
|
883
|
+
default:
|
|
884
|
+
break;
|
|
885
|
+
}
|
|
886
|
+
// 获取WKT格式几何图形
|
|
887
|
+
properties.geom = WKTProvider.fromGeometry(fea.geometry);
|
|
888
|
+
|
|
889
|
+
data.push(properties);
|
|
890
|
+
}
|
|
891
|
+
});
|
|
892
|
+
|
|
893
|
+
return data;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
/**
|
|
897
|
+
* 获取记录要素
|
|
898
|
+
* @param {Object} data -记录对象
|
|
899
|
+
*/
|
|
900
|
+
getRecordFeature(data) {
|
|
901
|
+
let fc = null;
|
|
902
|
+
switch (data.layerCode) {
|
|
903
|
+
case 'ditch':
|
|
904
|
+
case 'pipelinerain':
|
|
905
|
+
case 'pipelinewaste':
|
|
906
|
+
case 'pipelineindustry': { // 折线
|
|
907
|
+
fc = this._polylineFC;
|
|
908
|
+
break;
|
|
909
|
+
}
|
|
910
|
+
default: { // 点
|
|
911
|
+
fc = this._pointFC
|
|
912
|
+
break;
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
const features = fc.features.filter((fea) => {
|
|
916
|
+
return (
|
|
917
|
+
fea.properties.layer_code === data.layerCode &&
|
|
918
|
+
fea.properties.fid === data.faciId
|
|
919
|
+
)
|
|
920
|
+
});
|
|
921
|
+
|
|
922
|
+
return features.length > 0 ? features[0] : null;
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* 移除所有图层
|
|
927
|
+
*/
|
|
928
|
+
removeAllLayers() {
|
|
929
|
+
// 添加的点图层
|
|
930
|
+
if (this._addedMarkerLayer) {
|
|
931
|
+
this._addedFaciMarkerLayer.removeLayer();
|
|
932
|
+
this._addedMarkerLayer.removeLayer();
|
|
933
|
+
|
|
934
|
+
this._addedMarkerLayer.removeSource();
|
|
935
|
+
}
|
|
936
|
+
// 编辑的点图层
|
|
937
|
+
if (this._editedMarkerLayer) {
|
|
938
|
+
this._editedMarkerLayer.removeLayer();
|
|
939
|
+
this._editedMarkerLayer.removeSource();
|
|
940
|
+
}
|
|
941
|
+
// 删除的点图层
|
|
942
|
+
if (this._deletedMarkerLayer) {
|
|
943
|
+
this._deletedMarkerLayer.removeLayer();
|
|
944
|
+
this._deletedMarkerLayer.removeSource();
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
// 添加的线图层
|
|
948
|
+
if (this._addedLineLayer) {
|
|
949
|
+
this._addedFaciLineLayer.removeLayer();
|
|
950
|
+
this._addedLineLayer.removeLayer();
|
|
951
|
+
|
|
952
|
+
this._addedLineLayer.removeSource();
|
|
953
|
+
}
|
|
954
|
+
// 编辑的线图层
|
|
955
|
+
if (this._editedLineLayer) {
|
|
956
|
+
this._editedLineLayer.removeLayer();
|
|
957
|
+
this._editedLineLayer.removeSource();
|
|
958
|
+
}
|
|
959
|
+
// 删除的线图层
|
|
960
|
+
if (this._deletedLineLayer) {
|
|
961
|
+
this._deletedLineLayer.removeLayer();
|
|
962
|
+
this._deletedLineLayer.removeSource();
|
|
963
|
+
}
|
|
964
|
+
// 线中心点图层
|
|
965
|
+
if (this._lineCenterMarkerLayer) {
|
|
966
|
+
this._lineCenterMarkerLayer.removeLayer();
|
|
967
|
+
this._lineCenterMarkerLayer.removeSource();
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
/**
|
|
972
|
+
* 绑定单击事件
|
|
973
|
+
* @param {Fcuntion} event -事件
|
|
974
|
+
*/
|
|
975
|
+
onClick(event) {
|
|
976
|
+
// 点图层
|
|
977
|
+
this._addedFaciMarkerLayer.onClick(event);
|
|
978
|
+
this._addedMarkerLayer.onClick(event);
|
|
979
|
+
this._selectedMarkerLayer.onClick(event);
|
|
980
|
+
this._editedMarkerLayer.onClick(event);
|
|
981
|
+
|
|
982
|
+
// 线图层
|
|
983
|
+
this._addedLineLayer.onClick(event);
|
|
984
|
+
this._selectedLineLayer.onClick(event);
|
|
985
|
+
this._editedLineLayer.onClick(event);
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
/**
|
|
989
|
+
* 绑定事件
|
|
990
|
+
* @param {Fcuntion} event -事件
|
|
991
|
+
*/
|
|
992
|
+
onEvent(name, event) {
|
|
993
|
+
// 点图层
|
|
994
|
+
this._addedFaciMarkerLayer.onEvent(name, event);
|
|
995
|
+
this._addedMarkerLayer.onEvent(name, event);
|
|
996
|
+
this._editedMarkerLayer.onEvent(name, event);
|
|
997
|
+
|
|
998
|
+
// 线图层
|
|
999
|
+
this._addedLineLayer.onEvent(name, event);
|
|
1000
|
+
this._editedLineLayer.onEvent(name, event);
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
/** 私有方法 **/
|
|
1004
|
+
/**
|
|
1005
|
+
* 初始化图层
|
|
1006
|
+
*/
|
|
1007
|
+
_initLayers() {
|
|
1008
|
+
// 点图层
|
|
1009
|
+
this._initMarkerLayer('add');
|
|
1010
|
+
this._initMarkerLayer('select');
|
|
1011
|
+
this._initMarkerLayer('edit');
|
|
1012
|
+
this._initMarkerLayer('delete');
|
|
1013
|
+
// 线图层
|
|
1014
|
+
this._initLineLayer('add');
|
|
1015
|
+
this._initLineLayer('select');
|
|
1016
|
+
this._initLineLayer('edit');
|
|
1017
|
+
this._initLineLayer('delete');
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
/**
|
|
1021
|
+
* 初始化点图层
|
|
1022
|
+
* @param {String} editType -编辑类型
|
|
1023
|
+
*/
|
|
1024
|
+
_initMarkerLayer(editType) {
|
|
1025
|
+
const map = this._map;
|
|
1026
|
+
const minZoom = this._minzoom;
|
|
1027
|
+
|
|
1028
|
+
let markerLayer = null;
|
|
1029
|
+
let icon = null;
|
|
1030
|
+
let filter = null;
|
|
1031
|
+
|
|
1032
|
+
switch (editType) {
|
|
1033
|
+
case 'add': { // 添加
|
|
1034
|
+
markerLayer = this._addedMarkerLayer;
|
|
1035
|
+
icon = {
|
|
1036
|
+
type: 'categorical',
|
|
1037
|
+
property: 'edit_state',
|
|
1038
|
+
stops: [
|
|
1039
|
+
['add', this._markerAddIcon],
|
|
1040
|
+
['add-select', this._markerAddSelIcon],
|
|
1041
|
+
['add-edit', this._markerAddEditIcon],
|
|
1042
|
+
['add-edit-select', this._markerAddSelIcon]
|
|
1043
|
+
],
|
|
1044
|
+
default: this._markerAddIcon
|
|
1045
|
+
};
|
|
1046
|
+
filter = [
|
|
1047
|
+
'in',
|
|
1048
|
+
'edit_state',
|
|
1049
|
+
'add', 'add-select', 'add-edit', 'add-edit-select'
|
|
1050
|
+
];
|
|
1051
|
+
|
|
1052
|
+
// 添加的设施点图层
|
|
1053
|
+
if (!this._addedFaciMarkerLayer) {
|
|
1054
|
+
this._addedFaciMarkerLayer = new SimpleMarkerLayer({
|
|
1055
|
+
map: map,
|
|
1056
|
+
minzoom: minZoom,
|
|
1057
|
+
icon: {
|
|
1058
|
+
type: 'categorical',
|
|
1059
|
+
property: 'layer_code',
|
|
1060
|
+
stops: [
|
|
1061
|
+
['waterplant', 'wp_sew'],
|
|
1062
|
+
['industryplant', 'wp_ind'],
|
|
1063
|
+
['pumprain', 'ps_rain'],
|
|
1064
|
+
['pumpwaste', 'ps_sew'],
|
|
1065
|
+
['pumpcombine', 'ps_com'],
|
|
1066
|
+
['pumpindustry', 'ps_ind'],
|
|
1067
|
+
['agricwaste', 'rural_sew2'],
|
|
1068
|
+
['manholerain', 'well_rain1x'],
|
|
1069
|
+
['manholewaste', 'well_sew1x'],
|
|
1070
|
+
['manholeindustry', 'well_ind1x'],
|
|
1071
|
+
['interceptionsew', 'faci_intersew'],
|
|
1072
|
+
['interception', 'faci_inter'],
|
|
1073
|
+
['raininlet', 'faci_raininlet'],
|
|
1074
|
+
['storage', 'faci_storage'],
|
|
1075
|
+
['outfall', 'faci_outfall'],
|
|
1076
|
+
['flap', 'faci_outfall'],
|
|
1077
|
+
['gate', 'faci_gate']
|
|
1078
|
+
],
|
|
1079
|
+
default: 'marker'
|
|
1080
|
+
},
|
|
1081
|
+
filter: filter,
|
|
1082
|
+
sourceId: 'editor_marker-' + editType,
|
|
1083
|
+
layerId: 'editor_marker-' + editType + '-faci'
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1086
|
+
break;
|
|
1087
|
+
}
|
|
1088
|
+
case 'select': { // 选中
|
|
1089
|
+
markerLayer = this._selectedMarkerLayer;
|
|
1090
|
+
icon = this._markerSelIcon;
|
|
1091
|
+
filter = ['==', 'edit_state', editType];
|
|
1092
|
+
break;
|
|
1093
|
+
}
|
|
1094
|
+
case 'edit': { // 编辑
|
|
1095
|
+
markerLayer = this._editedMarkerLayer;
|
|
1096
|
+
icon = {
|
|
1097
|
+
type: 'categorical',
|
|
1098
|
+
property: 'edit_state',
|
|
1099
|
+
stops: [
|
|
1100
|
+
['edit', this._markerEditIcon],
|
|
1101
|
+
['edit-select', this._markerSelIcon]
|
|
1102
|
+
],
|
|
1103
|
+
default: this._markerEditIcon
|
|
1104
|
+
};
|
|
1105
|
+
filter = ['in', 'edit_state', 'edit', 'edit-select'];
|
|
1106
|
+
break;
|
|
1107
|
+
}
|
|
1108
|
+
case 'delete': { // 删除
|
|
1109
|
+
markerLayer = this._deletedMarkerLayer;
|
|
1110
|
+
icon = this._markerDelIcon;
|
|
1111
|
+
filter = ['==', 'edit_state', editType];
|
|
1112
|
+
break;
|
|
1113
|
+
}
|
|
1114
|
+
default:
|
|
1115
|
+
return;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
// 点图层
|
|
1119
|
+
if (!markerLayer) {
|
|
1120
|
+
markerLayer = new SimpleMarkerLayer({
|
|
1121
|
+
map: map,
|
|
1122
|
+
minzoom: minZoom,
|
|
1123
|
+
icon: icon,
|
|
1124
|
+
offset: [0, -20],
|
|
1125
|
+
filter: filter,
|
|
1126
|
+
sourceId: 'editor_marker-' + editType,
|
|
1127
|
+
});
|
|
1128
|
+
|
|
1129
|
+
switch (editType) {
|
|
1130
|
+
case 'add': { // 添加
|
|
1131
|
+
this._addedMarkerLayer = markerLayer;
|
|
1132
|
+
break;
|
|
1133
|
+
}
|
|
1134
|
+
case 'select': { // 选中
|
|
1135
|
+
this._selectedMarkerLayer = markerLayer;
|
|
1136
|
+
break;
|
|
1137
|
+
}
|
|
1138
|
+
case 'edit': { // 编辑
|
|
1139
|
+
this._editedMarkerLayer = markerLayer;
|
|
1140
|
+
break;
|
|
1141
|
+
}
|
|
1142
|
+
case 'delete': { // 删除
|
|
1143
|
+
this._deletedMarkerLayer = markerLayer;
|
|
1144
|
+
break;
|
|
1145
|
+
}
|
|
1146
|
+
default:
|
|
1147
|
+
break;
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
/**
|
|
1153
|
+
* 初始化线图层
|
|
1154
|
+
* @param {String} editType -编辑类型
|
|
1155
|
+
*/
|
|
1156
|
+
_initLineLayer(editType) {
|
|
1157
|
+
const map = this._map;
|
|
1158
|
+
const minZoom = this._minzoom;
|
|
1159
|
+
|
|
1160
|
+
let lineLayer = null;
|
|
1161
|
+
let lineColor = null;
|
|
1162
|
+
let lineWidth = this._lineWidth;
|
|
1163
|
+
let lineOpacity = 0.75;
|
|
1164
|
+
let filter = null;
|
|
1165
|
+
|
|
1166
|
+
switch (editType) {
|
|
1167
|
+
case 'add': { // 添加
|
|
1168
|
+
lineLayer = this._addedLineLayer;
|
|
1169
|
+
lineColor = {
|
|
1170
|
+
type: 'categorical',
|
|
1171
|
+
property: 'edit_state',
|
|
1172
|
+
stops: [
|
|
1173
|
+
['add', this._lineAddColor],
|
|
1174
|
+
['add-select', this._lineSelColor],
|
|
1175
|
+
['add-edit', this._lineSelColor],
|
|
1176
|
+
['add-edit-select', this._lineSelColor],
|
|
1177
|
+
],
|
|
1178
|
+
default: this._lineAddColor
|
|
1179
|
+
},
|
|
1180
|
+
lineOpacity = {
|
|
1181
|
+
type: 'categorical',
|
|
1182
|
+
property: 'edit_state',
|
|
1183
|
+
stops: [
|
|
1184
|
+
['add', 0.01],
|
|
1185
|
+
['add-edit', 0.01]
|
|
1186
|
+
],
|
|
1187
|
+
default: 0.75
|
|
1188
|
+
},
|
|
1189
|
+
filter = [
|
|
1190
|
+
'in',
|
|
1191
|
+
'edit_state',
|
|
1192
|
+
'add', 'add-select', 'add-edit', 'add-edit-select'
|
|
1193
|
+
];
|
|
1194
|
+
|
|
1195
|
+
// 添加的设施线图层
|
|
1196
|
+
if (!this._addedFaciLineLayer) {
|
|
1197
|
+
this._addedFaciLineLayer = new SimpleLineLayer({
|
|
1198
|
+
map: map,
|
|
1199
|
+
minzoom: minZoom,
|
|
1200
|
+
color: {
|
|
1201
|
+
type: 'categorical',
|
|
1202
|
+
property: 'layer_code',
|
|
1203
|
+
stops: [
|
|
1204
|
+
['pipelinerain', '#13B55C'],
|
|
1205
|
+
['pipelinewaste', '#FF4500'],
|
|
1206
|
+
['pipelineindustry', '#FF00FF'],
|
|
1207
|
+
['ditch', '#138585'],
|
|
1208
|
+
],
|
|
1209
|
+
default: '#FF4500'
|
|
1210
|
+
},
|
|
1211
|
+
width: this._lineWidth,
|
|
1212
|
+
opacity: 0.75,
|
|
1213
|
+
filter: filter,
|
|
1214
|
+
sourceId: 'editor_line-' + editType,
|
|
1215
|
+
layerId: 'editor_line-' + editType + '-faci'
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
break;
|
|
1219
|
+
}
|
|
1220
|
+
case 'select': { // 选中
|
|
1221
|
+
lineLayer = this._selectedLineLayer;
|
|
1222
|
+
lineColor = this._lineSelColor;
|
|
1223
|
+
filter = ['==', 'edit_state', editType];
|
|
1224
|
+
break;
|
|
1225
|
+
}
|
|
1226
|
+
case 'edit': { // 编辑
|
|
1227
|
+
lineLayer = this._editedLineLayer;
|
|
1228
|
+
lineColor = this._lineSelColor;
|
|
1229
|
+
filter = ['in', 'edit_state', 'edit', 'edit-select', 'edit-reverse', 'edit-reverse-select'];
|
|
1230
|
+
break;
|
|
1231
|
+
}
|
|
1232
|
+
case 'delete': { // 删除
|
|
1233
|
+
lineLayer = this._deletedLineLayer;
|
|
1234
|
+
lineColor = this._lineDelColor;
|
|
1235
|
+
lineWidth = 11.5;
|
|
1236
|
+
lineOpacity = 0.95;
|
|
1237
|
+
filter = ['==', 'edit_state', editType];
|
|
1238
|
+
break;
|
|
1239
|
+
}
|
|
1240
|
+
default:
|
|
1241
|
+
return;
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
// 线图层
|
|
1245
|
+
if (!lineLayer) {
|
|
1246
|
+
lineLayer = new SimpleLineLayer({
|
|
1247
|
+
map: map,
|
|
1248
|
+
minzoom: minZoom,
|
|
1249
|
+
color: lineColor,
|
|
1250
|
+
width: lineWidth,
|
|
1251
|
+
opacity: lineOpacity,
|
|
1252
|
+
filter: filter,
|
|
1253
|
+
sourceId: 'editor_line-' + editType
|
|
1254
|
+
});
|
|
1255
|
+
|
|
1256
|
+
switch (editType) {
|
|
1257
|
+
case 'add': { // 添加
|
|
1258
|
+
this._addedLineLayer = lineLayer;
|
|
1259
|
+
break;
|
|
1260
|
+
}
|
|
1261
|
+
case 'select': { // 选中
|
|
1262
|
+
this._selectedLineLayer = lineLayer;
|
|
1263
|
+
break;
|
|
1264
|
+
}
|
|
1265
|
+
case 'edit': { // 编辑
|
|
1266
|
+
this._editedLineLayer = lineLayer;
|
|
1267
|
+
break;
|
|
1268
|
+
}
|
|
1269
|
+
case 'delete': { // 删除
|
|
1270
|
+
this._deletedLineLayer = lineLayer;
|
|
1271
|
+
break;
|
|
1272
|
+
}
|
|
1273
|
+
default:
|
|
1274
|
+
break;
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
|
|
1278
|
+
// 线中心点图层
|
|
1279
|
+
if (!this._lineCenterMarkerLayer) {
|
|
1280
|
+
this._lineCenterMarkerLayer = new SimpleMarkerLayer({
|
|
1281
|
+
map: map,
|
|
1282
|
+
minzoom: minZoom,
|
|
1283
|
+
icon: {
|
|
1284
|
+
type: 'categorical',
|
|
1285
|
+
property: 'edit_state',
|
|
1286
|
+
stops: [
|
|
1287
|
+
['add', this._markerAddIcon],
|
|
1288
|
+
['add-select', this._markerAddSelIcon],
|
|
1289
|
+
['add-edit', this._markerAddEditIcon],
|
|
1290
|
+
['add-edit-select', this._markerAddSelIcon],
|
|
1291
|
+
['edit', this._markerEditIcon],
|
|
1292
|
+
['edit-select', this._markerSelIcon],
|
|
1293
|
+
['edit-reverse', this._markerEditIcon],
|
|
1294
|
+
['edit-reverse-select', this._markerSelIcon],
|
|
1295
|
+
['delete', this._markerDelIcon]
|
|
1296
|
+
],
|
|
1297
|
+
default: this._markerSelIcon
|
|
1298
|
+
},
|
|
1299
|
+
offset: [0, -15],
|
|
1300
|
+
filter: [
|
|
1301
|
+
'in',
|
|
1302
|
+
'edit_state',
|
|
1303
|
+
'add', 'add-select', 'add-edit', 'add-edit-select', 'edit', 'edit-select', 'edit-reverse', 'edit-reverse-select', 'delete'
|
|
1304
|
+
],
|
|
1305
|
+
sourceId: 'editor_line_center',
|
|
1306
|
+
});
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
// 线流向点图层
|
|
1310
|
+
if (!this._lineDirectionMarkerLayer) {
|
|
1311
|
+
this._lineDirectionMarkerLayer = new SimpleMarkerLayer({
|
|
1312
|
+
map: map,
|
|
1313
|
+
minzoom: minZoom,
|
|
1314
|
+
icon: this._arrowIcon,
|
|
1315
|
+
filter: [
|
|
1316
|
+
'in',
|
|
1317
|
+
'edit_state',
|
|
1318
|
+
'edit-reverse', 'edit-reverse-select'
|
|
1319
|
+
],
|
|
1320
|
+
sourceId: 'editor_line_direction',
|
|
1321
|
+
});
|
|
1322
|
+
// 设置图标旋转的角度
|
|
1323
|
+
this._lineDirectionMarkerLayer.setLayoutProperty('icon-rotate', ['get', 'bearing']);
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
/**
|
|
1328
|
+
* 更新数据
|
|
1329
|
+
* @param {Array} data -GeoJSON要素集合
|
|
1330
|
+
*/
|
|
1331
|
+
_updateData(data) {
|
|
1332
|
+
// 点数据
|
|
1333
|
+
this._pointFC.features = data.filter((fea) => {
|
|
1334
|
+
return fea.geometry.type.toLowerCase() === 'point';
|
|
1335
|
+
});
|
|
1336
|
+
// 更新编辑状态
|
|
1337
|
+
this._pointFC.features.forEach((fea) => {
|
|
1338
|
+
if (fea.properties.edit_state.indexOf('add') === 0) {
|
|
1339
|
+
fea.properties.edit_state = 'add';
|
|
1340
|
+
} else if (fea.properties.edit_state.indexOf('edit') === 0) {
|
|
1341
|
+
fea.properties.edit_state = 'edit';
|
|
1342
|
+
}
|
|
1343
|
+
});
|
|
1344
|
+
const pointFC = this._pointFC;
|
|
1345
|
+
|
|
1346
|
+
// 线数据
|
|
1347
|
+
this._polylineFC.features = data.filter((fea) => {
|
|
1348
|
+
return fea.geometry.type.toLowerCase() === 'linestring' ||
|
|
1349
|
+
fea.geometry.type.toLowerCase() === 'multilinestring';
|
|
1350
|
+
});
|
|
1351
|
+
// 更新编辑状态
|
|
1352
|
+
this._polylineFC.features.forEach((fea) => {
|
|
1353
|
+
if (fea.properties.edit_state.indexOf('add') === 0) {
|
|
1354
|
+
fea.properties.edit_state = 'add';
|
|
1355
|
+
} else if (fea.properties.edit_state.indexOf('edit') === 0) {
|
|
1356
|
+
fea.properties.edit_state = 'edit';
|
|
1357
|
+
}
|
|
1358
|
+
});
|
|
1359
|
+
this._centerPointFC.features = [];
|
|
1360
|
+
|
|
1361
|
+
const lineFC = this._polylineFC;
|
|
1362
|
+
const centerFC = this._centerPointFC;
|
|
1363
|
+
|
|
1364
|
+
// 更新点数据
|
|
1365
|
+
this._addedFaciMarkerLayer.setData(pointFC);
|
|
1366
|
+
this._addedMarkerLayer.setData(pointFC);
|
|
1367
|
+
this._selectedMarkerLayer.setData(pointFC);
|
|
1368
|
+
this._editedMarkerLayer.setData(pointFC);
|
|
1369
|
+
this._deletedMarkerLayer.setData(pointFC);
|
|
1370
|
+
|
|
1371
|
+
// 更新线数据
|
|
1372
|
+
this._addedLineLayer.setData(lineFC);
|
|
1373
|
+
this._addedFaciLineLayer.setData(lineFC);
|
|
1374
|
+
this._selectedLineLayer.setData(lineFC);
|
|
1375
|
+
this._editedLineLayer.setData(lineFC);
|
|
1376
|
+
this._deletedLineLayer.setData(lineFC);
|
|
1377
|
+
|
|
1378
|
+
centerFC.features = lineFC.features.map((fea) => {
|
|
1379
|
+
// 获取线中点要素
|
|
1380
|
+
const coordinates = GeogUtils.calcCenter(fea);
|
|
1381
|
+
|
|
1382
|
+
// 计算线的方位角
|
|
1383
|
+
if (fea.properties.edit_state === 'edit') {
|
|
1384
|
+
let coordsLen = fea.geometry.coordinates.length;
|
|
1385
|
+
let startLonLat = fea.geometry.coordinates[0];
|
|
1386
|
+
let endLonLat = fea.geometry.coordinates[coordsLen - 1];
|
|
1387
|
+
|
|
1388
|
+
// 计算方位角
|
|
1389
|
+
fea.properties.bearing = GeogUtils.bearing(startLonLat, endLonLat);
|
|
1390
|
+
// 更新编辑状态
|
|
1391
|
+
fea.properties.edit_state = 'edit-reverse';
|
|
1392
|
+
}
|
|
1393
|
+
return GeoJsonProvider.getPointFeature(coordinates, fea.properties);
|
|
1394
|
+
});
|
|
1395
|
+
// 更新线中点数据
|
|
1396
|
+
this._lineCenterMarkerLayer.setData(centerFC);
|
|
1397
|
+
this._lineDirectionMarkerLayer.setData(centerFC);
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
/**
|
|
1401
|
+
* 更新点数据
|
|
1402
|
+
* @param {String} editType -编辑类型
|
|
1403
|
+
* @param {Array} data -GeoJSON要素集合
|
|
1404
|
+
*/
|
|
1405
|
+
_updateMarkerData(editType, data) {
|
|
1406
|
+
const fc = this._pointFC;
|
|
1407
|
+
|
|
1408
|
+
switch (editType) {
|
|
1409
|
+
case 'add': { // 添加
|
|
1410
|
+
// 更新编辑状态
|
|
1411
|
+
data.forEach((fea) => {
|
|
1412
|
+
fea.properties.edit_state = editType;
|
|
1413
|
+
});
|
|
1414
|
+
// 合并数据
|
|
1415
|
+
fc.features = fc.features.concat(data);
|
|
1416
|
+
|
|
1417
|
+
// 更新数据源
|
|
1418
|
+
this._addedFaciMarkerLayer.setData(fc);
|
|
1419
|
+
this._addedMarkerLayer.setData(fc);
|
|
1420
|
+
break;
|
|
1421
|
+
}
|
|
1422
|
+
case 'select': { // 选中
|
|
1423
|
+
let isSelAdd = false; // 是否选中添加的要素
|
|
1424
|
+
let isSelEdit = false; // 是否选中编辑的要素
|
|
1425
|
+
|
|
1426
|
+
// 去掉添加、编辑的选中状态
|
|
1427
|
+
fc.features.forEach((feature) => {
|
|
1428
|
+
switch (feature.properties.edit_state) {
|
|
1429
|
+
case 'add-select': {
|
|
1430
|
+
feature.properties.edit_state = 'add';
|
|
1431
|
+
isSelAdd = true;
|
|
1432
|
+
break;
|
|
1433
|
+
}
|
|
1434
|
+
case 'add-edit-select': {
|
|
1435
|
+
feature.properties.edit_state = 'add-edit';
|
|
1436
|
+
isSelAdd = true;
|
|
1437
|
+
break;
|
|
1438
|
+
}
|
|
1439
|
+
case 'edit-select': {
|
|
1440
|
+
feature.properties.edit_state = 'edit';
|
|
1441
|
+
isSelEdit = true;
|
|
1442
|
+
break;
|
|
1443
|
+
}
|
|
1444
|
+
default:
|
|
1445
|
+
break;
|
|
1446
|
+
}
|
|
1447
|
+
});
|
|
1448
|
+
|
|
1449
|
+
for (let i = 0; i < data.length; i++) {
|
|
1450
|
+
const item = data[i];
|
|
1451
|
+
item.properties.edit_state = item.properties.edit_state || 'select';
|
|
1452
|
+
|
|
1453
|
+
const existFeas = fc.features.filter((fea) => {
|
|
1454
|
+
return fea.properties.fid === item.properties.fid;
|
|
1455
|
+
});
|
|
1456
|
+
if (existFeas.length > 0) {
|
|
1457
|
+
// 要素存在, 更新添加、删除的选中
|
|
1458
|
+
existFeas.forEach((fea) => {
|
|
1459
|
+
switch (fea.properties.edit_state) {
|
|
1460
|
+
case 'add': {
|
|
1461
|
+
fea.properties.edit_state = 'add-select';
|
|
1462
|
+
isSelAdd = true;
|
|
1463
|
+
break;
|
|
1464
|
+
}
|
|
1465
|
+
case 'add-edit': {
|
|
1466
|
+
fea.properties.edit_state = 'add-edit-select';
|
|
1467
|
+
isSelAdd = true;
|
|
1468
|
+
break;
|
|
1469
|
+
}
|
|
1470
|
+
case 'edit': {
|
|
1471
|
+
fea.properties.edit_state = 'edit-select';
|
|
1472
|
+
isSelEdit = true;
|
|
1473
|
+
break;
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
});
|
|
1477
|
+
} else {
|
|
1478
|
+
// 要素不存在, 添加/更新选中要素
|
|
1479
|
+
let selectedFeas = fc.features.filter((feature) => {
|
|
1480
|
+
// heyukun mod 2023-5-30
|
|
1481
|
+
//return feature.properties.edit_state === 'select'
|
|
1482
|
+
return (
|
|
1483
|
+
feature.properties.edit_state === 'select' &&
|
|
1484
|
+
feature.properties.fid === item.properties.fid
|
|
1485
|
+
)
|
|
1486
|
+
});
|
|
1487
|
+
if (selectedFeas.length === 0) {
|
|
1488
|
+
fc.features.push(item);
|
|
1489
|
+
} else {
|
|
1490
|
+
selectedFeas[0].geometry = item.geometry;
|
|
1491
|
+
selectedFeas[0].properties = item.properties;
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
} // end of for (...)
|
|
1495
|
+
|
|
1496
|
+
// 更新数据源
|
|
1497
|
+
this._selectedMarkerLayer.setData(fc);
|
|
1498
|
+
if (isSelAdd) {
|
|
1499
|
+
this._addedMarkerLayer.setData(fc);
|
|
1500
|
+
}
|
|
1501
|
+
if (isSelEdit) {
|
|
1502
|
+
this._editedMarkerLayer.setData(fc);
|
|
1503
|
+
}
|
|
1504
|
+
break;
|
|
1505
|
+
}
|
|
1506
|
+
case 'edit': { // 编辑
|
|
1507
|
+
let isEditAdd = false; // 是否编辑添加的要素
|
|
1508
|
+
|
|
1509
|
+
for (let i = 0; i < data.length; i++) {
|
|
1510
|
+
const item = data[i];
|
|
1511
|
+
|
|
1512
|
+
const existFeas = fc.features.filter((fea) => {
|
|
1513
|
+
return fea.properties.fid === item.properties.fid;
|
|
1514
|
+
});
|
|
1515
|
+
if (existFeas.length === 0) continue;
|
|
1516
|
+
|
|
1517
|
+
existFeas.forEach((fea) => {
|
|
1518
|
+
// 更新状态
|
|
1519
|
+
let editState = fea.properties.edit_state;
|
|
1520
|
+
|
|
1521
|
+
fea.properties = item.properties;
|
|
1522
|
+
fea.properties.hasProperty = true;
|
|
1523
|
+
|
|
1524
|
+
switch (editState) {
|
|
1525
|
+
case 'add':
|
|
1526
|
+
case 'add-select':
|
|
1527
|
+
case 'add-edit-select': {
|
|
1528
|
+
fea.properties.edit_state = 'add-edit';
|
|
1529
|
+
isEditAdd = true;
|
|
1530
|
+
break;
|
|
1531
|
+
}
|
|
1532
|
+
case 'select':
|
|
1533
|
+
case 'edit-select': {
|
|
1534
|
+
fea.properties.edit_state = 'edit';
|
|
1535
|
+
break;
|
|
1536
|
+
}
|
|
1537
|
+
default:
|
|
1538
|
+
break;
|
|
1539
|
+
}
|
|
1540
|
+
});
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
// 更新数据源
|
|
1544
|
+
this._editedMarkerLayer.setData(fc);
|
|
1545
|
+
this._selectedMarkerLayer.setData(fc);
|
|
1546
|
+
if (isEditAdd) {
|
|
1547
|
+
this._addedMarkerLayer.setData(fc);
|
|
1548
|
+
}
|
|
1549
|
+
break;
|
|
1550
|
+
}
|
|
1551
|
+
case 'delete': { // 删除
|
|
1552
|
+
let isDelAdd = false; // 是否删除添加的要素
|
|
1553
|
+
let isDelSel = false; // 是否删除选中的要素
|
|
1554
|
+
let isDelEdit = false; // 是否删除编辑的要素
|
|
1555
|
+
|
|
1556
|
+
for (let i = 0; i < data.length; i++) {
|
|
1557
|
+
const item = data[i];
|
|
1558
|
+
|
|
1559
|
+
const existFeas = fc.features.filter((fea) => {
|
|
1560
|
+
return fea.properties.fid === item.properties.fid;
|
|
1561
|
+
});
|
|
1562
|
+
if (existFeas.length === 0) continue;
|
|
1563
|
+
|
|
1564
|
+
existFeas.forEach((fea) => {
|
|
1565
|
+
let editState = fea.properties.edit_state;
|
|
1566
|
+
isDelAdd = editState.indexOf('add') === 0;
|
|
1567
|
+
isDelEdit = editState.indexOf('edit') === 0;
|
|
1568
|
+
|
|
1569
|
+
if (editState === 'select') {
|
|
1570
|
+
fea.properties.edit_state = 'delete';
|
|
1571
|
+
isDelSel = true;
|
|
1572
|
+
} else if (isDelEdit) {
|
|
1573
|
+
fea.properties.edit_state = 'delete';
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
});
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
if (isDelAdd) {
|
|
1580
|
+
// 过滤非添加的数据
|
|
1581
|
+
fc.features = fc.features.filter((fea) => {
|
|
1582
|
+
const found = data.find((item) => item.properties.fid === fea.properties.fid);
|
|
1583
|
+
return (
|
|
1584
|
+
!found ||
|
|
1585
|
+
(found && fea.properties.edit_state.indexOf('add') < 0)
|
|
1586
|
+
);
|
|
1587
|
+
});
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
// 更新数据源
|
|
1591
|
+
this._deletedMarkerLayer.setData(fc);
|
|
1592
|
+
if (isDelSel) {
|
|
1593
|
+
this._selectedMarkerLayer.setData(fc);
|
|
1594
|
+
}
|
|
1595
|
+
if (isDelEdit) {
|
|
1596
|
+
this._editedMarkerLayer.setData(fc);
|
|
1597
|
+
}
|
|
1598
|
+
if (isDelAdd) {
|
|
1599
|
+
this._addedMarkerLayer.setData(fc);
|
|
1600
|
+
this._addedFaciMarkerLayer.setData(fc);
|
|
1601
|
+
}
|
|
1602
|
+
break;
|
|
1603
|
+
}
|
|
1604
|
+
default:
|
|
1605
|
+
return;
|
|
1606
|
+
}
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
/**
|
|
1610
|
+
* 更新线数据
|
|
1611
|
+
* @param {String} editType -编辑类型
|
|
1612
|
+
* @param {Array} data -GeoJSON要素集合
|
|
1613
|
+
*/
|
|
1614
|
+
_updateLineData(editType, data) {
|
|
1615
|
+
const fc = this._polylineFC;
|
|
1616
|
+
const centerFC = this._centerPointFC;
|
|
1617
|
+
|
|
1618
|
+
switch (editType) {
|
|
1619
|
+
case 'add': { // 添加
|
|
1620
|
+
// 更新编辑状态
|
|
1621
|
+
data.forEach((fea) => {
|
|
1622
|
+
fea.properties.edit_state = editType;
|
|
1623
|
+
|
|
1624
|
+
const coordinates = GeogUtils.calcCenter(fea);
|
|
1625
|
+
let centerFea = GeoJsonProvider.getPointFeature(coordinates, fea.properties);
|
|
1626
|
+
centerFC.features.push(centerFea);
|
|
1627
|
+
});
|
|
1628
|
+
// 合并数据
|
|
1629
|
+
fc.features = fc.features.concat(data);
|
|
1630
|
+
|
|
1631
|
+
// 更新数据源
|
|
1632
|
+
this._addedLineLayer.setData(fc);
|
|
1633
|
+
this._addedFaciLineLayer.setData(fc);
|
|
1634
|
+
this._lineCenterMarkerLayer.setData(centerFC);
|
|
1635
|
+
|
|
1636
|
+
// 移动线图层
|
|
1637
|
+
this._moveLineLayer('add');
|
|
1638
|
+
break;
|
|
1639
|
+
}
|
|
1640
|
+
case 'select': { // 选中
|
|
1641
|
+
let isSelAdd = false; // 是否选中添加的要素
|
|
1642
|
+
let isSelEdit = false; // 是否选中编辑的要素
|
|
1643
|
+
|
|
1644
|
+
// 去掉添加、编辑的选中状态
|
|
1645
|
+
fc.features.forEach((feature) => {
|
|
1646
|
+
switch (feature.properties.edit_state) {
|
|
1647
|
+
case 'add-select': {
|
|
1648
|
+
feature.properties.edit_state = 'add';
|
|
1649
|
+
isSelAdd = true;
|
|
1650
|
+
break;
|
|
1651
|
+
}
|
|
1652
|
+
case 'add-edit-select': {
|
|
1653
|
+
feature.properties.edit_state = 'add-edit';
|
|
1654
|
+
isSelAdd = true;
|
|
1655
|
+
break;
|
|
1656
|
+
}
|
|
1657
|
+
case 'edit-select': {
|
|
1658
|
+
feature.properties.edit_state = 'edit';
|
|
1659
|
+
isSelEdit = true;
|
|
1660
|
+
break;
|
|
1661
|
+
}
|
|
1662
|
+
case 'edit-reverse-select': {
|
|
1663
|
+
feature.properties.edit_state = 'edit-reverse';
|
|
1664
|
+
isSelEdit = true;
|
|
1665
|
+
break;
|
|
1666
|
+
}
|
|
1667
|
+
default:
|
|
1668
|
+
break;
|
|
1669
|
+
}
|
|
1670
|
+
});
|
|
1671
|
+
|
|
1672
|
+
for (let i = 0; i < data.length; i++) {
|
|
1673
|
+
const item = data[i];
|
|
1674
|
+
item.properties.edit_state = item.properties.edit_state || 'select';
|
|
1675
|
+
|
|
1676
|
+
const existFeas = fc.features.filter((fea) => {
|
|
1677
|
+
return fea.properties.fid === item.properties.fid;
|
|
1678
|
+
});
|
|
1679
|
+
if (existFeas.length > 0) {
|
|
1680
|
+
// 要素存在, 更新添加、编辑的选中
|
|
1681
|
+
existFeas.forEach((fea) => {
|
|
1682
|
+
switch (fea.properties.edit_state) {
|
|
1683
|
+
case 'add': {
|
|
1684
|
+
fea.properties.edit_state = 'add-select';
|
|
1685
|
+
isSelAdd = true;
|
|
1686
|
+
break;
|
|
1687
|
+
}
|
|
1688
|
+
case 'add-edit': {
|
|
1689
|
+
fea.properties.edit_state = 'add-edit-select';
|
|
1690
|
+
isSelAdd = true;
|
|
1691
|
+
break;
|
|
1692
|
+
}
|
|
1693
|
+
case 'edit': {
|
|
1694
|
+
fea.properties.edit_state = 'edit-select';
|
|
1695
|
+
isSelEdit = true;
|
|
1696
|
+
break;
|
|
1697
|
+
}
|
|
1698
|
+
case 'edit-reverse': {
|
|
1699
|
+
fea.properties.edit_state = 'edit-reverse-select';
|
|
1700
|
+
isSelEdit = true;
|
|
1701
|
+
break;
|
|
1702
|
+
}
|
|
1703
|
+
default:
|
|
1704
|
+
break;
|
|
1705
|
+
}
|
|
1706
|
+
});
|
|
1707
|
+
} else {
|
|
1708
|
+
// 要素不存在, 添加/更新选中要素
|
|
1709
|
+
let selectedFeas = fc.features.filter((feature) => {
|
|
1710
|
+
// heyukun mod 2023-5-30
|
|
1711
|
+
//return feature.properties.edit_state === 'select';
|
|
1712
|
+
return (
|
|
1713
|
+
feature.properties.edit_state === 'select' &&
|
|
1714
|
+
feature.properties.fid === item.properties.fid
|
|
1715
|
+
)
|
|
1716
|
+
});
|
|
1717
|
+
if (selectedFeas.length === 0) {
|
|
1718
|
+
fc.features.push(item);
|
|
1719
|
+
} else {
|
|
1720
|
+
selectedFeas[0].geometry = item.geometry;
|
|
1721
|
+
selectedFeas[0].properties = item.properties;
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
} // end of for (...)
|
|
1725
|
+
|
|
1726
|
+
// 更新数据源
|
|
1727
|
+
this._selectedLineLayer.setData(fc);
|
|
1728
|
+
if (isSelAdd) {
|
|
1729
|
+
this._addedLineLayer.setData(fc);
|
|
1730
|
+
// 移动线图层
|
|
1731
|
+
this._moveLineLayer('add');
|
|
1732
|
+
}
|
|
1733
|
+
if (isSelEdit) {
|
|
1734
|
+
this._editedLineLayer.setData(fc);
|
|
1735
|
+
// 移动线图层
|
|
1736
|
+
this._moveLineLayer('edit');
|
|
1737
|
+
}
|
|
1738
|
+
if (isSelAdd || isSelEdit) {
|
|
1739
|
+
this._lineCenterMarkerLayer.setData(centerFC);
|
|
1740
|
+
}
|
|
1741
|
+
break;
|
|
1742
|
+
}
|
|
1743
|
+
case 'edit': { // 编辑
|
|
1744
|
+
let isEditAdd = false; // 是否编辑添加的要素
|
|
1745
|
+
let isEditSel = false; // 是否编辑选中的要素
|
|
1746
|
+
let isEditEdit = false; // 是否编辑编辑的要素
|
|
1747
|
+
|
|
1748
|
+
for (let i = 0; i < data.length; i++) {
|
|
1749
|
+
const item = data[i];
|
|
1750
|
+
|
|
1751
|
+
// 更新线要素属性
|
|
1752
|
+
const existFeas = fc.features.filter((fea) => {
|
|
1753
|
+
return fea.properties.fid === item.properties.fid;
|
|
1754
|
+
});
|
|
1755
|
+
if (existFeas.length === 0) continue;
|
|
1756
|
+
|
|
1757
|
+
existFeas.forEach((fea) => {
|
|
1758
|
+
// 更新状态
|
|
1759
|
+
let editState = fea.properties.edit_state;
|
|
1760
|
+
|
|
1761
|
+
fea.properties = item.properties;
|
|
1762
|
+
fea.properties.hasProperty = true;
|
|
1763
|
+
|
|
1764
|
+
if (editState === 'select') {
|
|
1765
|
+
fea.properties.edit_state = 'edit';
|
|
1766
|
+
isEditSel = true;
|
|
1767
|
+
|
|
1768
|
+
// 添加线中点要素
|
|
1769
|
+
const coordinates = GeogUtils.calcCenter(fea);
|
|
1770
|
+
const centerFea = GeoJsonProvider.getPointFeature(coordinates, fea.properties);
|
|
1771
|
+
centerFC.features.push(centerFea);
|
|
1772
|
+
} else {
|
|
1773
|
+
switch (editState) {
|
|
1774
|
+
case 'add':
|
|
1775
|
+
case 'add-select':
|
|
1776
|
+
case 'add-edit-select': {
|
|
1777
|
+
fea.properties.edit_state = 'add-edit';
|
|
1778
|
+
isEditAdd = true;
|
|
1779
|
+
break;
|
|
1780
|
+
}
|
|
1781
|
+
case 'edit-select': {
|
|
1782
|
+
fea.properties.edit_state = 'edit';
|
|
1783
|
+
isEditEdit = true;
|
|
1784
|
+
break;
|
|
1785
|
+
}
|
|
1786
|
+
case 'edit-reverse-select': {
|
|
1787
|
+
fea.properties.edit_state = 'edit-reverse';
|
|
1788
|
+
isEditEdit = true;
|
|
1789
|
+
}
|
|
1790
|
+
default:
|
|
1791
|
+
break;
|
|
1792
|
+
}
|
|
1793
|
+
if (isEditAdd || isEditEdit) {
|
|
1794
|
+
// 更新线中点要素属性
|
|
1795
|
+
let existCenterFeas = centerFC.features.filter((centerFea) => {
|
|
1796
|
+
return centerFea.properties.fid === fea.properties.fid;
|
|
1797
|
+
});
|
|
1798
|
+
if (existCenterFeas.length > 0) {
|
|
1799
|
+
existCenterFeas[0].properties = fea.properties;
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
});
|
|
1804
|
+
} // end of for (...)
|
|
1805
|
+
|
|
1806
|
+
// 更新数据源
|
|
1807
|
+
this._editedLineLayer.setData(fc);
|
|
1808
|
+
if (isEditSel) {
|
|
1809
|
+
this._selectedLineLayer.setData(fc);
|
|
1810
|
+
// 移动线图层
|
|
1811
|
+
this._moveLineLayer('edit');
|
|
1812
|
+
}
|
|
1813
|
+
if (isEditAdd || isEditEdit || isEditSel) {
|
|
1814
|
+
this._lineCenterMarkerLayer.setData(centerFC);
|
|
1815
|
+
}
|
|
1816
|
+
break;
|
|
1817
|
+
}
|
|
1818
|
+
case 'reverse': { // 编辑-反转
|
|
1819
|
+
for (let i = 0; i < data.length; i++) {
|
|
1820
|
+
const item = data[i];
|
|
1821
|
+
|
|
1822
|
+
const existFeas = fc.features.filter((fea) => {
|
|
1823
|
+
return fea.properties.fid === item.properties.fid;
|
|
1824
|
+
});
|
|
1825
|
+
if (existFeas.length === 0) continue;
|
|
1826
|
+
|
|
1827
|
+
existFeas.forEach((fea) => {
|
|
1828
|
+
let editState = fea.properties.edit_state;
|
|
1829
|
+
if (editState !== 'edit-reverse-select' &&
|
|
1830
|
+
editState.indexOf('select') >= 0) { // 选中/编辑选中
|
|
1831
|
+
// 反转图形
|
|
1832
|
+
GeogUtils.reverse(fea);
|
|
1833
|
+
|
|
1834
|
+
let coordsLen = fea.geometry.coordinates.length;
|
|
1835
|
+
let startLonLat = fea.geometry.coordinates[0];
|
|
1836
|
+
let endLonLat = fea.geometry.coordinates[coordsLen - 1];
|
|
1837
|
+
|
|
1838
|
+
// 更新属性
|
|
1839
|
+
let inNodeId = fea.properties.in_nodeid;
|
|
1840
|
+
fea.properties.in_nodeid = fea.properties.out_nodeid;
|
|
1841
|
+
fea.properties.out_nodeid = inNodeId;
|
|
1842
|
+
// 计算方位角
|
|
1843
|
+
fea.properties.bearing = GeogUtils.bearing(startLonLat, endLonLat);
|
|
1844
|
+
// 更新编辑状态
|
|
1845
|
+
fea.properties.edit_state = 'edit-reverse';
|
|
1846
|
+
|
|
1847
|
+
// 添加线中点要素
|
|
1848
|
+
const coordinates = GeogUtils.calcCenter(fea);
|
|
1849
|
+
const centerFea = GeoJsonProvider.getPointFeature(coordinates, fea.properties);
|
|
1850
|
+
centerFC.features.push(centerFea);
|
|
1851
|
+
}
|
|
1852
|
+
});
|
|
1853
|
+
} // end of for (...)
|
|
1854
|
+
|
|
1855
|
+
// 更新数据源
|
|
1856
|
+
this._editedLineLayer.setData(fc);
|
|
1857
|
+
this._lineCenterMarkerLayer.setData(centerFC);
|
|
1858
|
+
this._lineDirectionMarkerLayer.setData(centerFC);
|
|
1859
|
+
|
|
1860
|
+
// 移动线图层
|
|
1861
|
+
this._moveLineLayer('edit');
|
|
1862
|
+
break;
|
|
1863
|
+
}
|
|
1864
|
+
case 'delete': { // 删除
|
|
1865
|
+
let isDelAdd = false; // 是否删除添加的要素
|
|
1866
|
+
let isDelSel = false; // 是否删除选中的要素
|
|
1867
|
+
let isDelEdit = false; // 是否删除编辑的要素
|
|
1868
|
+
|
|
1869
|
+
for (let i = 0; i < data.length; i++) {
|
|
1870
|
+
const item = data[i];
|
|
1871
|
+
|
|
1872
|
+
const existFeas = fc.features.filter((fea) => {
|
|
1873
|
+
return fea.properties.fid === item.properties.fid;
|
|
1874
|
+
});
|
|
1875
|
+
if (existFeas.length === 0) continue;
|
|
1876
|
+
|
|
1877
|
+
existFeas.forEach((fea) => {
|
|
1878
|
+
let editState = fea.properties.edit_state;
|
|
1879
|
+
isDelAdd = editState.indexOf('add') === 0;
|
|
1880
|
+
isDelEdit = editState.indexOf('edit') === 0;
|
|
1881
|
+
|
|
1882
|
+
if (editState === 'select') {
|
|
1883
|
+
fea.properties.edit_state = 'delete';
|
|
1884
|
+
isDelSel = true;
|
|
1885
|
+
|
|
1886
|
+
// 添加线中点
|
|
1887
|
+
const coordinates = GeogUtils.calcCenter(fea);
|
|
1888
|
+
const centerFea = GeoJsonProvider.getPointFeature(coordinates, fea.properties);
|
|
1889
|
+
centerFC.features.push(centerFea);
|
|
1890
|
+
} else if (isDelEdit) {
|
|
1891
|
+
fea.properties.edit_state = 'delete';
|
|
1892
|
+
}
|
|
1893
|
+
});
|
|
1894
|
+
} // end of for (...)
|
|
1895
|
+
|
|
1896
|
+
if (isDelAdd) {
|
|
1897
|
+
// 过滤非添加的数据
|
|
1898
|
+
fc.features = fc.features.filter((fea) => {
|
|
1899
|
+
const found = data.find((item) => item.properties.fid === fea.properties.fid);
|
|
1900
|
+
return (
|
|
1901
|
+
!found ||
|
|
1902
|
+
(found && fea.properties.edit_state.indexOf('add') < 0)
|
|
1903
|
+
);
|
|
1904
|
+
});
|
|
1905
|
+
// 过滤非添加的线中点数据
|
|
1906
|
+
centerFC.features = centerFC.features.filter((fea) => {
|
|
1907
|
+
const found = data.find((item) => item.properties.fid === fea.properties.fid);
|
|
1908
|
+
return (
|
|
1909
|
+
!found ||
|
|
1910
|
+
(found && fea.properties.edit_state.indexOf('add') < 0)
|
|
1911
|
+
);
|
|
1912
|
+
});
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
// 更新数据源
|
|
1916
|
+
this._deletedLineLayer.setData(fc);
|
|
1917
|
+
// 移动线图层
|
|
1918
|
+
this._moveLineLayer('delete');
|
|
1919
|
+
|
|
1920
|
+
if (isDelEdit) {
|
|
1921
|
+
this._editedLineLayer.setData(fc);
|
|
1922
|
+
// 移动线图层
|
|
1923
|
+
this._moveLineLayer('edit');
|
|
1924
|
+
}
|
|
1925
|
+
if (isDelSel) {
|
|
1926
|
+
this._selectedLineLayer.setData(fc);
|
|
1927
|
+
}
|
|
1928
|
+
if (isDelAdd) {
|
|
1929
|
+
this._addedLineLayer.setData(fc);
|
|
1930
|
+
this._addedFaciLineLayer.setData(fc);
|
|
1931
|
+
// 移动线图层
|
|
1932
|
+
this._moveLineLayer('add');
|
|
1933
|
+
}
|
|
1934
|
+
if (isDelAdd || isDelEdit || isDelSel) {
|
|
1935
|
+
this._lineCenterMarkerLayer.setData(centerFC);
|
|
1936
|
+
}
|
|
1937
|
+
break;
|
|
1938
|
+
}
|
|
1939
|
+
default:
|
|
1940
|
+
return;
|
|
1941
|
+
}
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
/**
|
|
1945
|
+
* 缩放到要素范围
|
|
1946
|
+
*/
|
|
1947
|
+
_fitBounds() {
|
|
1948
|
+
const map = this._map;
|
|
1949
|
+
const pointFC = this._pointFC;
|
|
1950
|
+
const lineFC = this._polylineFC;
|
|
1951
|
+
|
|
1952
|
+
// 计算包围盒
|
|
1953
|
+
let bboxP = [], bboxL = [];
|
|
1954
|
+
if (pointFC.features.length > 0) {
|
|
1955
|
+
let pntFea = pointFC.features[0]
|
|
1956
|
+
bboxP = pointFC.features.length === 1
|
|
1957
|
+
? [pntFea.geometry.coordinates, pntFea.geometry.coordinates]
|
|
1958
|
+
: GeogUtils.calcBBox(pointFC);
|
|
1959
|
+
}
|
|
1960
|
+
if (lineFC.features.length > 0) {
|
|
1961
|
+
bboxL = GeogUtils.calcBBox(lineFC);
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
// 缩放至要素范围
|
|
1965
|
+
const zoom = 15.75;
|
|
1966
|
+
if (bboxP.length > 0 || bboxL.length > 0) {
|
|
1967
|
+
let bbox = [];
|
|
1968
|
+
let isJumpTo = false;
|
|
1969
|
+
if (bboxP.length === 1 && bboxL.length === 0) {
|
|
1970
|
+
isJumpTo = true;
|
|
1971
|
+
} else if (bboxP.length > 0 && bboxL.length === 0) {
|
|
1972
|
+
bbox = bboxP;
|
|
1973
|
+
} else if (bboxP.length === 0 && bboxL.length > 0) {
|
|
1974
|
+
bbox = bboxL;
|
|
1975
|
+
} else {
|
|
1976
|
+
bbox = [
|
|
1977
|
+
[Math.min(bboxP[0][0], bboxL[0][0]), Math.min(bboxP[0][1], bboxL[0][1])],
|
|
1978
|
+
[Math.max(bboxP[1][0], bboxL[1][0]), Math.max(bboxP[1][1], bboxL[1][1])]
|
|
1979
|
+
];
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
if (isJumpTo) {
|
|
1983
|
+
MapProvider.jumpTo(map, bboxP[0], zoom);
|
|
1984
|
+
} else {
|
|
1985
|
+
MapProvider.fitBounds(map, bbox, zoom, true);
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
/**
|
|
1991
|
+
* 添加日志
|
|
1992
|
+
* @param {String} editType -编辑类型
|
|
1993
|
+
* @param {Array} data -GeoJSON要素集合
|
|
1994
|
+
*/
|
|
1995
|
+
_appendLog(editType, data) {
|
|
1996
|
+
/*
|
|
1997
|
+
let log = this._editingLog;
|
|
1998
|
+
let newIndex = log.length;
|
|
1999
|
+
|
|
2000
|
+
let logItems = data.map((fea) => {
|
|
2001
|
+
const props = fea.properties;
|
|
2002
|
+
|
|
2003
|
+
let newEditState = null;
|
|
2004
|
+
if (editType !== 'delete' && log.length > 0) {
|
|
2005
|
+
let prevFea = null;
|
|
2006
|
+
for (let i = log.length - 1; i >= 0; i--) {
|
|
2007
|
+
if (log[i].feature.properties.fid === props.fid) {
|
|
2008
|
+
prevFea = log[i].feature;
|
|
2009
|
+
break;
|
|
2010
|
+
}
|
|
2011
|
+
}
|
|
2012
|
+
if (prevFea && prevFea.properties.edit_state.indexOf('add') === 0) {
|
|
2013
|
+
newEditState = 'add-edit';
|
|
2014
|
+
}
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
// 克隆要素
|
|
2018
|
+
let currFea = GeoJsonProvider.cloneFeature(fea);
|
|
2019
|
+
if (editType === 'reverse') {
|
|
2020
|
+
currFea.properties.edit_state = 'edit-reverse';
|
|
2021
|
+
} else {
|
|
2022
|
+
currFea.properties.edit_state = newEditState || editType;
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
let logItem = {
|
|
2026
|
+
index: newIndex,
|
|
2027
|
+
edit_state: editType === 'reverse' ? 'edit' : editType,
|
|
2028
|
+
fid: props.fid,
|
|
2029
|
+
layer_code: props.layer_code,
|
|
2030
|
+
type: getType(fea.geometry.type), // 类型
|
|
2031
|
+
enable: true, // 可操作
|
|
2032
|
+
feature: currFea
|
|
2033
|
+
};
|
|
2034
|
+
|
|
2035
|
+
return logItem;
|
|
2036
|
+
});
|
|
2037
|
+
// 合并日志项
|
|
2038
|
+
this._editingLog = log.concat(logItems);
|
|
2039
|
+
*/
|
|
2040
|
+
|
|
2041
|
+
// new
|
|
2042
|
+
let editLog = this._editLog;
|
|
2043
|
+
let startIndex = editLog.length;
|
|
2044
|
+
let geomType = null;
|
|
2045
|
+
|
|
2046
|
+
let itemFeatures = data.map((item) => {
|
|
2047
|
+
const props = item.properties;
|
|
2048
|
+
if (!geomType) {
|
|
2049
|
+
geomType = getType(item.geometry.type);
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
let newEditState = null;
|
|
2053
|
+
if (editType !== 'delete' && editLog.length > 0) {
|
|
2054
|
+
let prevFea = null;
|
|
2055
|
+
for (let i = editLog.length - 1; i >= 0; i--) {
|
|
2056
|
+
const prevFeas = editLog[i].features.filter((fea) => {
|
|
2057
|
+
return fea.properties.fid === props.fid
|
|
2058
|
+
});
|
|
2059
|
+
if (prevFeas.length > 0) {
|
|
2060
|
+
prevFea = prevFeas[i];
|
|
2061
|
+
break;
|
|
2062
|
+
}
|
|
2063
|
+
}
|
|
2064
|
+
if (prevFea && prevFea.properties.edit_state.indexOf('add') === 0) {
|
|
2065
|
+
newEditState = 'add-edit';
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
|
|
2069
|
+
// 克隆要素
|
|
2070
|
+
let currFea = GeoJsonProvider.cloneFeature(item);
|
|
2071
|
+
if (editType === 'reverse') {
|
|
2072
|
+
currFea.properties.edit_state = 'edit-reverse';
|
|
2073
|
+
} else {
|
|
2074
|
+
currFea.properties.edit_state = newEditState || editType;
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
return currFea;
|
|
2078
|
+
});
|
|
2079
|
+
|
|
2080
|
+
// 添加日志项
|
|
2081
|
+
this._editLog.push({
|
|
2082
|
+
index: startIndex,
|
|
2083
|
+
edit_state: editType === 'reverse' ? 'edit' : editType,
|
|
2084
|
+
type: geomType,
|
|
2085
|
+
features: itemFeatures
|
|
2086
|
+
});
|
|
2087
|
+
|
|
2088
|
+
/**
|
|
2089
|
+
* 获取图层类型
|
|
2090
|
+
* @param {String} geomType -几何图形类型
|
|
2091
|
+
*
|
|
2092
|
+
* @returns {String}
|
|
2093
|
+
*/
|
|
2094
|
+
function getType(geomType) {
|
|
2095
|
+
switch (geomType.toLowerCase()) {
|
|
2096
|
+
case 'point':
|
|
2097
|
+
case 'multipoint': { // 点/多点
|
|
2098
|
+
return 'marker';
|
|
2099
|
+
}
|
|
2100
|
+
case 'linestring':
|
|
2101
|
+
case 'multilinestring': { // 折线/多折线
|
|
2102
|
+
return 'line';
|
|
2103
|
+
}
|
|
2104
|
+
case 'polygon':
|
|
2105
|
+
case 'multipolygon': { // 多边形/多多边形
|
|
2106
|
+
return 'fill';
|
|
2107
|
+
}
|
|
2108
|
+
default:
|
|
2109
|
+
return null;
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
|
|
2114
|
+
/**
|
|
2115
|
+
* 清除选中的点数据
|
|
2116
|
+
*/
|
|
2117
|
+
_clearSelectedMarkerData() {
|
|
2118
|
+
const fc = this._pointFC;
|
|
2119
|
+
|
|
2120
|
+
let isSel = false; // 是否有选中的要素
|
|
2121
|
+
let isSelAdd = false; // 是否选中添加的要素
|
|
2122
|
+
let isSelEdit = false; // 是否选中编辑的要素
|
|
2123
|
+
|
|
2124
|
+
fc.features.forEach((fea) => {
|
|
2125
|
+
isSel = fea.properties.edit_state === 'select';
|
|
2126
|
+
|
|
2127
|
+
switch (fea.properties.edit_state) {
|
|
2128
|
+
case 'add-select': {
|
|
2129
|
+
fea.properties.edit_state = 'add';
|
|
2130
|
+
isSelAdd = true;
|
|
2131
|
+
break;
|
|
2132
|
+
}
|
|
2133
|
+
case 'add-edit-select': {
|
|
2134
|
+
fea.properties.edit_state = 'add-edit';
|
|
2135
|
+
isSelAdd = true;
|
|
2136
|
+
break;
|
|
2137
|
+
}
|
|
2138
|
+
case 'edit-select': {
|
|
2139
|
+
fea.properties.edit_state = 'edit';
|
|
2140
|
+
isSelEdit = true;
|
|
2141
|
+
break;
|
|
2142
|
+
}
|
|
2143
|
+
default:
|
|
2144
|
+
break;
|
|
2145
|
+
}
|
|
2146
|
+
});
|
|
2147
|
+
// 除去选中的要素
|
|
2148
|
+
fc.features = fc.features.filter((fea) => {
|
|
2149
|
+
return fea.properties.edit_state !== 'select';
|
|
2150
|
+
});
|
|
2151
|
+
|
|
2152
|
+
// 更新数据源
|
|
2153
|
+
if (isSel) {
|
|
2154
|
+
this._selectedMarkerLayer.setData(fc);
|
|
2155
|
+
}
|
|
2156
|
+
if (isSelAdd) {
|
|
2157
|
+
this._addedMarkerLayer.setData(fc);
|
|
2158
|
+
}
|
|
2159
|
+
if (isSelEdit) {
|
|
2160
|
+
this._editedMarkerLayer.setData(fc);
|
|
2161
|
+
}
|
|
2162
|
+
}
|
|
2163
|
+
|
|
2164
|
+
/**
|
|
2165
|
+
* 清除选中的线数据
|
|
2166
|
+
*/
|
|
2167
|
+
_clearSelectedLineData() {
|
|
2168
|
+
const fc = this._polylineFC;
|
|
2169
|
+
const centerFC = this._centerPointFC;
|
|
2170
|
+
|
|
2171
|
+
let isSel = false; // 是否有选中的要素
|
|
2172
|
+
let isSelAdd = false; // 是否选中添加的要素
|
|
2173
|
+
let isSelEdit = false; // 是否选中编辑的要素
|
|
2174
|
+
|
|
2175
|
+
fc.features.forEach((fea) => {
|
|
2176
|
+
isSel = fea.properties.edit_state === 'select';
|
|
2177
|
+
|
|
2178
|
+
switch (fea.properties.edit_state) {
|
|
2179
|
+
case 'add-select': {
|
|
2180
|
+
fea.properties.edit_state = 'add';
|
|
2181
|
+
isSelAdd = true;
|
|
2182
|
+
break;
|
|
2183
|
+
}
|
|
2184
|
+
case 'add-edit-select': {
|
|
2185
|
+
fea.properties.edit_state = 'add-edit';
|
|
2186
|
+
isSelAdd = true;
|
|
2187
|
+
break;
|
|
2188
|
+
}
|
|
2189
|
+
case 'edit-select': {
|
|
2190
|
+
fea.properties.edit_state = 'edit';
|
|
2191
|
+
isSelEdit = true;
|
|
2192
|
+
break;
|
|
2193
|
+
}
|
|
2194
|
+
case 'edit-reverse-select': {
|
|
2195
|
+
fea.properties.edit_state = 'edit-reverse';
|
|
2196
|
+
isSelEdit = true;
|
|
2197
|
+
break;
|
|
2198
|
+
}
|
|
2199
|
+
default:
|
|
2200
|
+
break;
|
|
2201
|
+
}
|
|
2202
|
+
});
|
|
2203
|
+
// 除去选中的要素
|
|
2204
|
+
fc.features = fc.features.filter((fea) => {
|
|
2205
|
+
return fea.properties.edit_state !== 'select';
|
|
2206
|
+
});
|
|
2207
|
+
|
|
2208
|
+
// 更新数据源
|
|
2209
|
+
if (isSel) {
|
|
2210
|
+
this._selectedLineLayer.setData(fc);
|
|
2211
|
+
}
|
|
2212
|
+
if (isSelAdd) {
|
|
2213
|
+
this._addedLineLayer.setData(fc);
|
|
2214
|
+
}
|
|
2215
|
+
if (isSelEdit) {
|
|
2216
|
+
this._editedLineLayer.setData(fc);
|
|
2217
|
+
}
|
|
2218
|
+
if (isSelAdd || isSelEdit) {
|
|
2219
|
+
this._lineCenterMarkerLayer.setData(centerFC);
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
/**
|
|
2224
|
+
* 移动线图层到中点图层下面
|
|
2225
|
+
* @param {String} editType -编辑类型
|
|
2226
|
+
*/
|
|
2227
|
+
_moveLineLayer(editType) {
|
|
2228
|
+
const map = this._map;
|
|
2229
|
+
const centerLayerId = this._lineCenterMarkerLayer._layerId;
|
|
2230
|
+
const directionLayerId = this._lineDirectionMarkerLayer._layerId
|
|
2231
|
+
|
|
2232
|
+
switch (editType) {
|
|
2233
|
+
case 'add': { // 添加
|
|
2234
|
+
if (!this._isAddedLineLayerMoved) {
|
|
2235
|
+
if (LayerProvider.hasLayer(map, centerLayerId)) {
|
|
2236
|
+
LayerProvider.moveLayer(map, this._addedLineLayer._layerId, centerLayerId);
|
|
2237
|
+
}
|
|
2238
|
+
this._isAddedLineLayerMoved = true;
|
|
2239
|
+
}
|
|
2240
|
+
break;
|
|
2241
|
+
}
|
|
2242
|
+
case 'edit': { // 编辑
|
|
2243
|
+
if (!this._isEditedLineLayerMoved) {
|
|
2244
|
+
if (LayerProvider.hasLayer(map, centerLayerId)) {
|
|
2245
|
+
LayerProvider.moveLayer(map, this._editedLineLayer._layerId, centerLayerId);
|
|
2246
|
+
}
|
|
2247
|
+
if (LayerProvider.hasLayer(map, directionLayerId)) {
|
|
2248
|
+
LayerProvider.moveLayer(map, this._editedLineLayer._layerId, directionLayerId);
|
|
2249
|
+
}
|
|
2250
|
+
this._isEditedLineLayerMoved = true;
|
|
2251
|
+
}
|
|
2252
|
+
break;
|
|
2253
|
+
}
|
|
2254
|
+
case 'delete': { // 删除
|
|
2255
|
+
if (!this._isDeletedLineLayerMoved) {
|
|
2256
|
+
if (LayerProvider.hasLayer(map, centerLayerId)) {
|
|
2257
|
+
LayerProvider.moveLayer(map, this._deletedLineLayer._layerId, centerLayerId);
|
|
2258
|
+
}
|
|
2259
|
+
if (LayerProvider.hasLayer(map, directionLayerId)) {
|
|
2260
|
+
LayerProvider.moveLayer(map, this._deletedLineLayer._layerId, directionLayerId);
|
|
2261
|
+
}
|
|
2262
|
+
this._isDeletedLineLayerMoved = true;
|
|
2263
|
+
}
|
|
2264
|
+
break;
|
|
2265
|
+
}
|
|
2266
|
+
default:
|
|
2267
|
+
break;
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2270
|
+
}
|