@vunk/form 1.1.77 → 1.1.80
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/components/_plugin-vue_export-helper.mjs +9 -0
- package/components/button/{index.js → index.mjs} +33 -29
- package/components/button/src/ctx.d.ts +30 -30
- package/components/button/src/index.vue.d.ts +69 -69
- package/components/cascader/index.css +0 -2
- package/components/cascader/{index.js → index.mjs} +22 -22
- package/components/cascader/src/ctx.d.ts +37 -45
- package/components/cascader/src/index.vue.d.ts +92 -92
- package/components/cascader/src/use.d.ts +1 -1
- package/components/checkbox/index.css +0 -9
- package/components/checkbox/{index.js → index.mjs} +45 -42
- package/components/checkbox/src/ctx.d.ts +29 -32
- package/components/checkbox/src/index.vue.d.ts +65 -65
- package/components/color-picker/{index.js → index.mjs} +23 -22
- package/components/color-picker/src/ctx.d.ts +29 -29
- package/components/color-picker/src/index.vue.d.ts +67 -67
- package/components/date-picker/index.d.ts +1 -0
- package/components/date-picker/{index.js → index.mjs} +46 -26
- package/components/date-picker/src/ctx.d.ts +51 -49
- package/components/date-picker/src/index.vue.d.ts +104 -104
- package/components/date-picker-range/index.css +18 -0
- package/components/date-picker-range/index.d.ts +4 -0
- package/components/date-picker-range/index.mjs +164 -0
- package/components/date-picker-range/src/ctx.d.ts +177 -0
- package/components/date-picker-range/src/index.vue.d.ts +398 -0
- package/components/date-picker-range/src/types.d.ts +12 -0
- package/components/download-plus/index.css +0 -6
- package/components/download-plus/{index.js → index.mjs} +119 -147
- package/components/download-plus/src/api.d.ts +1 -1
- package/components/download-plus/src/ctx.d.ts +27 -26
- package/components/download-plus/src/index.vue.d.ts +59 -59
- package/components/esri-input-geojson/index.css +0 -10
- package/components/esri-input-geojson/index.mjs +1109 -0
- package/components/esri-input-geojson/src/append.vue.d.ts +1 -1
- package/components/esri-input-geojson/src/ctx.d.ts +49 -72
- package/components/esri-input-geojson/src/index.vue.d.ts +138 -158
- package/components/esri-input-geojson/src/types.d.ts +0 -1
- package/components/esri-input-geojson/src/viewer.vue.d.ts +18 -19
- package/components/form/{index.js → index.mjs} +38 -36
- package/components/form/src/ctx.d.ts +13 -297
- package/components/form/src/index.vue.d.ts +97 -659
- package/components/form-item/index.css +0 -8
- package/components/form-item/{index.js → index.mjs} +22 -19
- package/components/form-item/src/ctx.d.ts +13 -11
- package/components/form-item/src/index.vue.d.ts +20 -20
- package/components/form-item-renderer/{index.js → index.mjs} +9 -7
- package/components/form-item-renderer/src/index.vue.d.ts +1 -1
- package/components/form-item-renderer-template/{index.js → index.mjs} +7 -7
- package/components/geoinput/{index.js → index.mjs} +10 -17
- package/components/geoinput/src/ctx.d.ts +48 -60
- package/components/geoinput/src/index.vue.d.ts +114 -132
- package/components/geoinput-read/index.css +0 -2
- package/components/geoinput-read/{index.js → index.mjs} +101 -109
- package/components/geoinput-read/src/core.vue.d.ts +123 -142
- package/components/geoinput-read/src/ctx.d.ts +50 -74
- package/components/geoinput-read/src/index.vue.d.ts +102 -120
- package/components/geoinput-update/index.css +0 -6
- package/components/geoinput-update/index.mjs +399 -0
- package/components/geoinput-update/src/ctx.d.ts +49 -69
- package/components/geoinput-update/src/index.vue.d.ts +126 -141
- package/components/index.mjs +11 -0
- package/components/index2.mjs +306 -0
- package/components/index3.mjs +484 -0
- package/components/input/{index.js → index.mjs} +31 -27
- package/components/input/src/ctx.d.ts +47 -66
- package/components/input/src/index.vue.d.ts +101 -113
- package/components/input-link/index.css +0 -2
- package/components/input-link/index.mjs +151 -0
- package/components/input-link/src/ctx.d.ts +40 -56
- package/components/input-link/src/index.vue.d.ts +89 -101
- package/components/input-number/index.css +0 -2
- package/components/input-number/{index.js → index.mjs} +25 -25
- package/components/input-number/src/ctx.d.ts +31 -37
- package/components/input-number/src/index.vue.d.ts +71 -71
- package/components/radio/index.css +0 -6
- package/components/radio/{index.js → index.mjs} +50 -47
- package/components/radio/src/ctx.d.ts +29 -29
- package/components/radio/src/index.vue.d.ts +64 -64
- package/components/select/index.css +0 -2
- package/components/select/{index.js → index.mjs} +49 -48
- package/components/select/src/ctx.d.ts +31 -85
- package/components/select/src/index.vue.d.ts +121 -230
- package/components/slider/{index.js → index.mjs} +28 -24
- package/components/slider/src/ctx.d.ts +35 -35
- package/components/slider/src/index.vue.d.ts +93 -93
- package/components/switch/index.css +0 -2
- package/components/switch/{index.js → index.mjs} +29 -24
- package/components/switch/src/ctx.d.ts +40 -40
- package/components/switch/src/index.vue.d.ts +91 -91
- package/components/templates-default/index.mjs +302 -0
- package/components/templates-default/src/ctx.d.ts +2 -4
- package/components/templates-default/src/index.vue.d.ts +2 -8
- package/components/templates-element-plus/index.mjs +106 -0
- package/components/templates-esri/index.mjs +59 -0
- package/components/templates-layout/index.css +0 -3
- package/components/templates-layout/index.mjs +131 -0
- package/components/templates-mapbox/index.mjs +59 -0
- package/components/templates-variant/index.d.ts +4 -0
- package/components/templates-variant/index.mjs +64 -0
- package/components/templates-variant/src/ctx.d.ts +11 -0
- package/components/templates-variant/src/index.vue.d.ts +20 -0
- package/components/templates-variant/src/types.d.ts +2 -0
- package/components/upload/index.css +0 -7
- package/components/upload/index.mjs +501 -0
- package/components/upload/src/ctx.d.ts +36 -38
- package/components/upload/src/file.vue.d.ts +22 -21
- package/components/upload/src/index.vue.d.ts +78 -78
- package/components/upload-plus/index.css +4 -8
- package/components/upload-plus/{index.js → index.mjs} +9497 -926
- package/components/upload-plus/src/api.d.ts +1 -1
- package/components/upload-plus/src/ctx.d.ts +25 -28
- package/components/upload-plus/src/index.vue.d.ts +58 -58
- package/components/van-cascader/index.css +0 -2
- package/components/van-cascader/{index.js → index.mjs} +41 -44
- package/components/van-cascader/src/ctx.d.ts +35 -35
- package/components/van-cascader/src/index.vue.d.ts +82 -82
- package/components/var-datetime-picker/index.css +0 -2
- package/components/var-datetime-picker/index.mjs +324 -0
- package/components/var-datetime-picker/src/ctx.d.ts +27 -26
- package/components/var-datetime-picker/src/index.vue.d.ts +57 -57
- package/components/vditor/{index.js → index.mjs} +9 -14
- package/components/vditor/src/ctx.d.ts +2 -1
- package/components/vditor/src/index.vue.d.ts +2 -3
- package/composables/index.mjs +85 -0
- package/composables/useSourceManager.d.ts +2 -2
- package/defaults.d.ts +1 -1
- package/index.css +22 -168
- package/index.d.ts +1 -1
- package/index.esm.js +44 -1
- package/package.json +257 -2
- package/shared/const/index.d.ts +1 -1
- package/shared/const/index.mjs +56 -0
- package/shared/element-plus/ctx.d.ts +26 -94
- package/shared/element-plus/index.mjs +285 -0
- package/shared/element-plus/instances.d.ts +29 -28
- package/shared/form/index.mjs +30 -0
- package/shared/helper/index.mjs +9 -0
- package/shared/index.mjs +1 -0
- package/shared/infer-prop/index.mjs +34 -0
- package/shared/progress-it/index.mjs +38 -0
- package/shared/rules/index.mjs +53 -0
- package/shared/types/source/index.d.ts +2 -1
- package/shared/upload/index.mjs +771 -0
- package/components/button/src/ctx.js +0 -1
- package/components/cascader/src/ctx.js +0 -1
- package/components/cascader/src/types.js +0 -1
- package/components/cascader/src/use.js +0 -1
- package/components/checkbox/src/ctx.js +0 -1
- package/components/checkbox/src/index.css +0 -1
- package/components/checkbox/src/types.js +0 -1
- package/components/color-picker/index.css +0 -1
- package/components/color-picker/src/ctx.js +0 -1
- package/components/color-picker/src/index.css +0 -1
- package/components/color-picker/src/types.js +0 -1
- package/components/date-picker/index.css +0 -1
- package/components/date-picker/src/ctx.js +0 -1
- package/components/date-picker/src/index.css +0 -1
- package/components/date-picker/src/types.js +0 -1
- package/components/download-plus/src/api.js +0 -1
- package/components/download-plus/src/const.js +0 -1
- package/components/download-plus/src/ctx.js +0 -1
- package/components/download-plus/src/index.css +0 -1
- package/components/download-plus/src/types.js +0 -1
- package/components/esri-input-geojson/index.js +0 -1563
- package/components/esri-input-geojson/src/const.js +0 -1
- package/components/esri-input-geojson/src/ctx.js +0 -1
- package/components/esri-input-geojson/src/index.css +0 -1
- package/components/esri-input-geojson/src/types.js +0 -1
- package/components/form/index.css +0 -1
- package/components/form/src/ctx.js +0 -1
- package/components/form/src/index.css +0 -1
- package/components/form/src/types.js +0 -1
- package/components/form/src/utils.js +0 -1
- package/components/form-item/src/ctx.js +0 -1
- package/components/form-item/src/index.css +0 -1
- package/components/form-item/src/types.js +0 -1
- package/components/form-item-renderer/index.css +0 -1
- package/components/form-item-renderer/src/ctx.js +0 -1
- package/components/form-item-renderer/src/index.css +0 -1
- package/components/form-item-renderer/src/symbols.js +0 -1
- package/components/form-item-renderer/src/types.js +0 -1
- package/components/form-item-renderer-template/index.css +0 -1
- package/components/form-item-renderer-template/src/ctx.js +0 -1
- package/components/form-item-renderer-template/src/index.css +0 -1
- package/components/form-item-renderer-template/src/types.js +0 -1
- package/components/geoinput/index.css +0 -1
- package/components/geoinput/src/ctx.js +0 -1
- package/components/geoinput/src/index.css +0 -1
- package/components/geoinput/src/types.js +0 -1
- package/components/geoinput-read/src/ctx.js +0 -1
- package/components/geoinput-read/src/index.css +0 -1
- package/components/geoinput-read/src/types.js +0 -1
- package/components/geoinput-update/index.js +0 -930
- package/components/geoinput-update/src/ctx.js +0 -1
- package/components/geoinput-update/src/index.css +0 -1
- package/components/geoinput-update/src/types.js +0 -1
- package/components/input/index.css +0 -1
- package/components/input/src/ctx.js +0 -1
- package/components/input/src/index.css +0 -1
- package/components/input/src/types.js +0 -1
- package/components/input-link/index.js +0 -163
- package/components/input-link/src/ctx.js +0 -1
- package/components/input-link/src/index.css +0 -1
- package/components/input-link/src/types.js +0 -1
- package/components/input-number/src/ctx.js +0 -1
- package/components/input-number/src/index.css +0 -1
- package/components/input-number/src/types.js +0 -1
- package/components/radio/src/ctx.js +0 -1
- package/components/radio/src/index.css +0 -1
- package/components/radio/src/types.js +0 -1
- package/components/select/src/ctx.js +0 -1
- package/components/select/src/index.css +0 -1
- package/components/select/src/types.js +0 -1
- package/components/slider/index.css +0 -1
- package/components/slider/src/ctx.js +0 -1
- package/components/slider/src/index.css +0 -1
- package/components/slider/src/types.js +0 -1
- package/components/switch/src/ctx.js +0 -1
- package/components/switch/src/index.css +0 -1
- package/components/switch/src/types.js +0 -1
- package/components/templates-default/index.css +0 -1
- package/components/templates-default/index.js +0 -347
- package/components/templates-default/src/ctx.js +0 -1
- package/components/templates-default/src/index.css +0 -1
- package/components/templates-default/src/types.js +0 -1
- package/components/templates-element-plus/index.css +0 -1
- package/components/templates-element-plus/index.js +0 -110
- package/components/templates-element-plus/src/ctx.js +0 -1
- package/components/templates-element-plus/src/index.css +0 -1
- package/components/templates-element-plus/src/types.js +0 -1
- package/components/templates-esri/index.css +0 -1
- package/components/templates-esri/index.js +0 -65
- package/components/templates-esri/src/ctx.js +0 -1
- package/components/templates-esri/src/index.css +0 -1
- package/components/templates-esri/src/types.js +0 -1
- package/components/templates-layout/index.js +0 -141
- package/components/templates-layout/src/ctx.js +0 -1
- package/components/templates-layout/src/index.css +0 -1
- package/components/templates-layout/src/types.js +0 -1
- package/components/templates-mapbox/index.css +0 -1
- package/components/templates-mapbox/index.js +0 -65
- package/components/templates-mapbox/src/ctx.js +0 -1
- package/components/templates-mapbox/src/index.css +0 -1
- package/components/templates-mapbox/src/types.js +0 -1
- package/components/upload/index.js +0 -565
- package/components/upload/src/ctx.js +0 -1
- package/components/upload/src/index.css +0 -1
- package/components/upload/src/types.js +0 -1
- package/components/upload-plus/src/api.js +0 -28
- package/components/upload-plus/src/const.js +0 -1
- package/components/upload-plus/src/ctx.js +0 -1
- package/components/upload-plus/src/index.css +0 -1
- package/components/upload-plus/src/types.js +0 -1
- package/components/van-cascader/src/ctx.js +0 -1
- package/components/van-cascader/src/index.css +0 -1
- package/components/van-cascader/src/types.js +0 -1
- package/components/var-datetime-picker/index.js +0 -299
- package/components/var-datetime-picker/src/const.js +0 -1
- package/components/var-datetime-picker/src/ctx.js +0 -1
- package/components/var-datetime-picker/src/index.css +0 -1
- package/components/var-datetime-picker/src/types.js +0 -1
- package/components/vditor/index.css +0 -1
- package/components/vditor/src/ctx.js +0 -1
- package/components/vditor/src/index.css +0 -1
- package/components/vditor/src/types.js +0 -1
- package/composables/index.css +0 -1
- package/composables/index.js +0 -1
- package/shared/const/index.css +0 -1
- package/shared/const/index.js +0 -1
- package/shared/element-plus/index.css +0 -1
- package/shared/element-plus/index.js +0 -1
- package/shared/form/index.css +0 -1
- package/shared/form/index.js +0 -1
- package/shared/helper/index.css +0 -1
- package/shared/helper/index.js +0 -1
- package/shared/index.css +0 -1
- package/shared/index.js +0 -1
- package/shared/infer-prop/index.css +0 -1
- package/shared/infer-prop/index.js +0 -1
- package/shared/progress-it/index.css +0 -1
- package/shared/progress-it/index.js +0 -1
- package/shared/rules/index.css +0 -1
- package/shared/rules/index.js +0 -1
- package/shared/types/form/index.css +0 -1
- package/shared/types/form/index.js +0 -1
- package/shared/types/index.css +0 -1
- package/shared/types/index.js +0 -1
- package/shared/types/source/index.css +0 -1
- package/shared/types/source/index.js +0 -1
- package/shared/types/source-manager/index.css +0 -1
- package/shared/types/source-manager/index.js +0 -1
- package/shared/upload/index.css +0 -1
- package/shared/upload/index.js +0 -1
- /package/{components/button/index.css → shared/types/form/index.mjs} +0 -0
- /package/{components/button/src/index.css → shared/types/index.mjs} +0 -0
- /package/{components/cascader/src/index.css → shared/types/source/index.mjs} +0 -0
- /package/{components/button/src/types.js → shared/types/source-manager/index.mjs} +0 -0
|
@@ -1,1563 +0,0 @@
|
|
|
1
|
-
import { defineComponent, openBlock, createElementBlock, createElementVNode, resolveComponent, createBlock, withCtx, createVNode, createCommentVNode, unref, renderSlot, provide, resolveDynamicComponent, normalizeProps, mergeProps, ref, shallowRef, computed, watch, onMounted, nextTick, toHandlers, withDirectives, vShow } from 'vue';
|
|
2
|
-
import { _VkfInputCtx, VkfInput } from '@vunk/form/components/input';
|
|
3
|
-
import { bindPropsFactory, onEmitsFactory } from '@vunk/core/shared/utils-vue';
|
|
4
|
-
import { ElButton, ElIcon, ElButtonGroup, ElUpload, ElMessage } from 'element-plus';
|
|
5
|
-
import { VaMapView, VaTdtBasemap, VaSketch, VaGraphicsLayer } from '@vuesri/core';
|
|
6
|
-
import MapView from '@arcgis/core/views/MapView';
|
|
7
|
-
import SceneView from '@arcgis/core/views/SceneView';
|
|
8
|
-
import { VkAsyncTeleport } from '@vunk/core';
|
|
9
|
-
import Graphic from '@arcgis/core/Graphic';
|
|
10
|
-
import { useComputedReadonly } from '@vunk/form/composables';
|
|
11
|
-
import { Deferred } from '@vunk/core/shared/utils-promise';
|
|
12
|
-
|
|
13
|
-
var EDIT_TYPE = /* @__PURE__ */ ((EDIT_TYPE2) => {
|
|
14
|
-
EDIT_TYPE2["POINT"] = "point";
|
|
15
|
-
EDIT_TYPE2["POLYGON"] = "polygon";
|
|
16
|
-
EDIT_TYPE2["LINE_STRING"] = "line_string";
|
|
17
|
-
return EDIT_TYPE2;
|
|
18
|
-
})(EDIT_TYPE || {});
|
|
19
|
-
const EDIT_TYPE_OPTIONS = [{
|
|
20
|
-
label: "\u70B9",
|
|
21
|
-
value: "point" /* POINT */,
|
|
22
|
-
availableCreatureTools: ["point"]
|
|
23
|
-
}, {
|
|
24
|
-
label: "\u7EBF",
|
|
25
|
-
value: "line_string" /* LINE_STRING */,
|
|
26
|
-
availableCreatureTools: ["polyline"]
|
|
27
|
-
}, {
|
|
28
|
-
label: "\u9762",
|
|
29
|
-
value: "polygon" /* POLYGON */,
|
|
30
|
-
availableCreatureTools: ["polygon", "circle", "rectangle"]
|
|
31
|
-
}];
|
|
32
|
-
const EDIT_TYPE_REFLECT = EDIT_TYPE_OPTIONS.reduce((acc, cur) => {
|
|
33
|
-
acc[cur.value] = cur;
|
|
34
|
-
return acc;
|
|
35
|
-
}, {});
|
|
36
|
-
const EMPTY_FEATURE_COLLECTION = {
|
|
37
|
-
type: "FeatureCollection",
|
|
38
|
-
features: []
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const props = {
|
|
42
|
-
..._VkfInputCtx.props,
|
|
43
|
-
viewComponent: null,
|
|
44
|
-
viewComponentAttrs: null,
|
|
45
|
-
readonly: {
|
|
46
|
-
type: Boolean,
|
|
47
|
-
default: void 0
|
|
48
|
-
},
|
|
49
|
-
view: {
|
|
50
|
-
type: Object
|
|
51
|
-
},
|
|
52
|
-
editTypes: {
|
|
53
|
-
type: [Array, String],
|
|
54
|
-
default: () => "polygon"
|
|
55
|
-
},
|
|
56
|
-
viewModelActiveFillSymbol: {
|
|
57
|
-
type: Object,
|
|
58
|
-
default: () => ({
|
|
59
|
-
// 红色虚线,无色填充
|
|
60
|
-
type: "simple-fill",
|
|
61
|
-
color: [0, 0, 0, 0],
|
|
62
|
-
style: "solid",
|
|
63
|
-
outline: {
|
|
64
|
-
color: [255, 0, 0, 1],
|
|
65
|
-
width: 2,
|
|
66
|
-
style: "dash"
|
|
67
|
-
}
|
|
68
|
-
})
|
|
69
|
-
},
|
|
70
|
-
viewModelActiveLineSymbol: null,
|
|
71
|
-
viewModelActivePointSymbol: null,
|
|
72
|
-
modelValue: {
|
|
73
|
-
type: Object,
|
|
74
|
-
default: () => EMPTY_FEATURE_COLLECTION
|
|
75
|
-
},
|
|
76
|
-
multiple: {
|
|
77
|
-
type: Boolean,
|
|
78
|
-
default: true
|
|
79
|
-
},
|
|
80
|
-
skipSave: {
|
|
81
|
-
type: Boolean,
|
|
82
|
-
default: false
|
|
83
|
-
},
|
|
84
|
-
showMap: {
|
|
85
|
-
type: Boolean,
|
|
86
|
-
default: false
|
|
87
|
-
},
|
|
88
|
-
dialogEdit: {
|
|
89
|
-
type: Boolean,
|
|
90
|
-
default: true
|
|
91
|
-
},
|
|
92
|
-
dialogEditFullscreen: {
|
|
93
|
-
type: Boolean,
|
|
94
|
-
default: true
|
|
95
|
-
},
|
|
96
|
-
dialogEditTitle: {
|
|
97
|
-
type: String,
|
|
98
|
-
default: "\u7ED8\u5236\u56FE\u6591"
|
|
99
|
-
},
|
|
100
|
-
flying: {
|
|
101
|
-
type: Boolean,
|
|
102
|
-
default: false
|
|
103
|
-
},
|
|
104
|
-
layerIndex: {
|
|
105
|
-
type: Number,
|
|
106
|
-
default: 100
|
|
107
|
-
},
|
|
108
|
-
visibleElements: {
|
|
109
|
-
type: Object,
|
|
110
|
-
default: void 0
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
const createBindProps = bindPropsFactory(props);
|
|
114
|
-
const emits = {
|
|
115
|
-
..._VkfInputCtx.emits,
|
|
116
|
-
"update:modelValue": (e) => e,
|
|
117
|
-
"update:flying": null,
|
|
118
|
-
/**
|
|
119
|
-
* 点击地图定位按钮
|
|
120
|
-
*/
|
|
121
|
-
"appendFly": null,
|
|
122
|
-
appendEdit: null
|
|
123
|
-
};
|
|
124
|
-
const createOnEmits = onEmitsFactory(emits);
|
|
125
|
-
|
|
126
|
-
var ctx = /*#__PURE__*/Object.freeze({
|
|
127
|
-
__proto__: null,
|
|
128
|
-
createBindProps: createBindProps,
|
|
129
|
-
createOnEmits: createOnEmits,
|
|
130
|
-
emits: emits,
|
|
131
|
-
props: props
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
/*! Element Plus Icons Vue v2.3.1 */
|
|
135
|
-
|
|
136
|
-
var document_checked_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */defineComponent({
|
|
137
|
-
name: "DocumentChecked",
|
|
138
|
-
__name: "document-checked",
|
|
139
|
-
setup(__props) {
|
|
140
|
-
return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
|
|
141
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
142
|
-
viewBox: "0 0 1024 1024"
|
|
143
|
-
}, [createElementVNode("path", {
|
|
144
|
-
fill: "currentColor",
|
|
145
|
-
d: "M805.504 320 640 154.496V320zM832 384H576V128H192v768h640zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m318.4 582.144 180.992-180.992L704.64 510.4 478.4 736.64 320 578.304l45.248-45.312z"
|
|
146
|
-
})]));
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
// src/components/document-checked.vue
|
|
151
|
-
var document_checked_default = document_checked_vue_vue_type_script_setup_true_lang_default;
|
|
152
|
-
var edit_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */defineComponent({
|
|
153
|
-
name: "Edit",
|
|
154
|
-
__name: "edit",
|
|
155
|
-
setup(__props) {
|
|
156
|
-
return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
|
|
157
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
158
|
-
viewBox: "0 0 1024 1024"
|
|
159
|
-
}, [createElementVNode("path", {
|
|
160
|
-
fill: "currentColor",
|
|
161
|
-
d: "M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"
|
|
162
|
-
}), createElementVNode("path", {
|
|
163
|
-
fill: "currentColor",
|
|
164
|
-
d: "m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"
|
|
165
|
-
})]));
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
// src/components/edit.vue
|
|
170
|
-
var edit_default = edit_vue_vue_type_script_setup_true_lang_default;
|
|
171
|
-
var map_location_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */defineComponent({
|
|
172
|
-
name: "MapLocation",
|
|
173
|
-
__name: "map-location",
|
|
174
|
-
setup(__props) {
|
|
175
|
-
return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
|
|
176
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
177
|
-
viewBox: "0 0 1024 1024"
|
|
178
|
-
}, [createElementVNode("path", {
|
|
179
|
-
fill: "currentColor",
|
|
180
|
-
d: "M800 416a288 288 0 1 0-576 0c0 118.144 94.528 272.128 288 456.576C705.472 688.128 800 534.144 800 416M512 960C277.312 746.688 160 565.312 160 416a352 352 0 0 1 704 0c0 149.312-117.312 330.688-352 544"
|
|
181
|
-
}), createElementVNode("path", {
|
|
182
|
-
fill: "currentColor",
|
|
183
|
-
d: "M512 448a64 64 0 1 0 0-128 64 64 0 0 0 0 128m0 64a128 128 0 1 1 0-256 128 128 0 0 1 0 256m345.6 192L960 960H672v-64H352v64H64l102.4-256zm-68.928 0H235.328l-76.8 192h706.944z"
|
|
184
|
-
})]));
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
// src/components/map-location.vue
|
|
189
|
-
var map_location_default = map_location_vue_vue_type_script_setup_true_lang_default;
|
|
190
|
-
var upload_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */defineComponent({
|
|
191
|
-
name: "Upload",
|
|
192
|
-
__name: "upload",
|
|
193
|
-
setup(__props) {
|
|
194
|
-
return (_ctx, _cache) => (openBlock(), createElementBlock("svg", {
|
|
195
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
196
|
-
viewBox: "0 0 1024 1024"
|
|
197
|
-
}, [createElementVNode("path", {
|
|
198
|
-
fill: "currentColor",
|
|
199
|
-
d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248z"
|
|
200
|
-
})]));
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
// src/components/upload.vue
|
|
205
|
-
var upload_default = upload_vue_vue_type_script_setup_true_lang_default;
|
|
206
|
-
|
|
207
|
-
var script$3 = defineComponent({
|
|
208
|
-
components: {
|
|
209
|
-
ElButton,
|
|
210
|
-
ElIcon,
|
|
211
|
-
ElButtonGroup,
|
|
212
|
-
Upload: upload_default,
|
|
213
|
-
Edit: edit_default,
|
|
214
|
-
ElUpload,
|
|
215
|
-
MapLocation: map_location_default
|
|
216
|
-
},
|
|
217
|
-
props: {
|
|
218
|
-
disabled: Boolean,
|
|
219
|
-
dialog: Boolean,
|
|
220
|
-
upload: {
|
|
221
|
-
type: Boolean,
|
|
222
|
-
default: true
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
emits: {
|
|
226
|
-
upload: (e) => e,
|
|
227
|
-
edit: null,
|
|
228
|
-
fly: null
|
|
229
|
-
},
|
|
230
|
-
methods: {
|
|
231
|
-
getFile(file) {
|
|
232
|
-
this.$emit("upload", file);
|
|
233
|
-
},
|
|
234
|
-
uploadClick(e) {
|
|
235
|
-
const target = e.target.querySelector("input[type=file]");
|
|
236
|
-
if (!target)
|
|
237
|
-
return;
|
|
238
|
-
target.click();
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
function render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
244
|
-
const _component_Upload = resolveComponent("Upload");
|
|
245
|
-
const _component_ElIcon = resolveComponent("ElIcon");
|
|
246
|
-
const _component_ElUpload = resolveComponent("ElUpload");
|
|
247
|
-
const _component_Edit = resolveComponent("Edit");
|
|
248
|
-
const _component_ElButton = resolveComponent("ElButton");
|
|
249
|
-
const _component_MapLocation = resolveComponent("MapLocation");
|
|
250
|
-
const _component_ElButtonGroup = resolveComponent("ElButtonGroup");
|
|
251
|
-
return openBlock(), createBlock(_component_ElButtonGroup, null, {
|
|
252
|
-
default: withCtx(() => [_ctx.upload ? (openBlock(), createBlock(_component_ElUpload, {
|
|
253
|
-
key: 0,
|
|
254
|
-
class: "el-button el-button--default vkf-esri-input-geojson__upload",
|
|
255
|
-
action: "",
|
|
256
|
-
accept: "file",
|
|
257
|
-
multiple: false,
|
|
258
|
-
"show-file-list": false,
|
|
259
|
-
"auto-upload": false,
|
|
260
|
-
"on-change": _ctx.getFile,
|
|
261
|
-
disabled: _ctx.disabled,
|
|
262
|
-
onClick: _ctx.uploadClick
|
|
263
|
-
}, {
|
|
264
|
-
default: withCtx(() => [createVNode(_component_ElIcon, {
|
|
265
|
-
color: "var(--el-color-primary)"
|
|
266
|
-
}, {
|
|
267
|
-
default: withCtx(() => [createVNode(_component_Upload)]),
|
|
268
|
-
_: 1
|
|
269
|
-
/* STABLE */
|
|
270
|
-
})]),
|
|
271
|
-
_: 1
|
|
272
|
-
/* STABLE */
|
|
273
|
-
}, 8, ["on-change", "disabled", "onClick"])) : createCommentVNode("v-if", true), _ctx.dialog ? (openBlock(), createBlock(_component_ElButton, {
|
|
274
|
-
key: 1,
|
|
275
|
-
disabled: _ctx.disabled,
|
|
276
|
-
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("edit"))
|
|
277
|
-
}, {
|
|
278
|
-
default: withCtx(() => [createVNode(_component_ElIcon, {
|
|
279
|
-
color: "var(--el-color-primary)"
|
|
280
|
-
}, {
|
|
281
|
-
default: withCtx(() => [createVNode(_component_Edit)]),
|
|
282
|
-
_: 1
|
|
283
|
-
/* STABLE */
|
|
284
|
-
})]),
|
|
285
|
-
_: 1
|
|
286
|
-
/* STABLE */
|
|
287
|
-
}, 8, ["disabled"])) : createCommentVNode("v-if", true), createVNode(_component_ElButton, {
|
|
288
|
-
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("fly"))
|
|
289
|
-
}, {
|
|
290
|
-
default: withCtx(() => [createVNode(_component_ElIcon, {
|
|
291
|
-
color: "var(--el-color-primary)"
|
|
292
|
-
}, {
|
|
293
|
-
default: withCtx(() => [createVNode(_component_MapLocation)]),
|
|
294
|
-
_: 1
|
|
295
|
-
/* STABLE */
|
|
296
|
-
})]),
|
|
297
|
-
_: 1
|
|
298
|
-
/* STABLE */
|
|
299
|
-
})]),
|
|
300
|
-
_: 1
|
|
301
|
-
/* STABLE */
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
script$3.render = render$2;
|
|
306
|
-
script$3.__file = "esri-input-geojson/src/append.vue";
|
|
307
|
-
|
|
308
|
-
var script$2 = /* @__PURE__ */ defineComponent({
|
|
309
|
-
__name: "default-view",
|
|
310
|
-
setup(__props) {
|
|
311
|
-
return (_ctx, _cache) => {
|
|
312
|
-
return openBlock(), createBlock(unref(VaMapView), null, {
|
|
313
|
-
default: withCtx(() => [createVNode(unref(VaTdtBasemap)), renderSlot(_ctx.$slots, "default")]),
|
|
314
|
-
_: 3
|
|
315
|
-
/* FORWARDED */
|
|
316
|
-
});
|
|
317
|
-
};
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
script$2.__file = "esri-input-geojson/src/default-view.vue";
|
|
322
|
-
|
|
323
|
-
var script$1 = defineComponent({
|
|
324
|
-
components: {
|
|
325
|
-
VaTdtBasemap,
|
|
326
|
-
VaMapView
|
|
327
|
-
},
|
|
328
|
-
props: {
|
|
329
|
-
view: {
|
|
330
|
-
type: Object,
|
|
331
|
-
default: void 0
|
|
332
|
-
},
|
|
333
|
-
viewComponent: {
|
|
334
|
-
type: [Object, Function],
|
|
335
|
-
default: () => script$2
|
|
336
|
-
},
|
|
337
|
-
viewComponentAttrs: {
|
|
338
|
-
type: Object,
|
|
339
|
-
default: () => ({})
|
|
340
|
-
}
|
|
341
|
-
},
|
|
342
|
-
setup(props) {
|
|
343
|
-
if (props.view) {
|
|
344
|
-
provide("vaView", props.view);
|
|
345
|
-
if (props.view instanceof MapView) {
|
|
346
|
-
provide("vaMapView", props.view);
|
|
347
|
-
}
|
|
348
|
-
if (props.view instanceof SceneView) {
|
|
349
|
-
provide("vaSceneView", props.view);
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
return {};
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
|
-
|
|
356
|
-
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
357
|
-
return !_ctx.view ? (openBlock(), createBlock(
|
|
358
|
-
resolveDynamicComponent(_ctx.viewComponent),
|
|
359
|
-
normalizeProps(mergeProps({
|
|
360
|
-
key: 0
|
|
361
|
-
}, _ctx.viewComponentAttrs)),
|
|
362
|
-
{
|
|
363
|
-
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
364
|
-
_: 3
|
|
365
|
-
/* FORWARDED */
|
|
366
|
-
},
|
|
367
|
-
16
|
|
368
|
-
/* FULL_PROPS */
|
|
369
|
-
)) : renderSlot(_ctx.$slots, "default", {
|
|
370
|
-
key: 1
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
script$1.render = render$1;
|
|
375
|
-
script$1.__file = "esri-input-geojson/src/viewer.vue";
|
|
376
|
-
|
|
377
|
-
function array_cancel() {
|
|
378
|
-
this._array = null;
|
|
379
|
-
return Promise.resolve();
|
|
380
|
-
}
|
|
381
|
-
function array_read() {
|
|
382
|
-
var array = this._array;
|
|
383
|
-
this._array = null;
|
|
384
|
-
return Promise.resolve(array ? {
|
|
385
|
-
done: false,
|
|
386
|
-
value: array
|
|
387
|
-
} : {
|
|
388
|
-
done: true,
|
|
389
|
-
value: undefined
|
|
390
|
-
});
|
|
391
|
-
}
|
|
392
|
-
function array(array) {
|
|
393
|
-
return new ArraySource(array instanceof Uint8Array ? array : new Uint8Array(array));
|
|
394
|
-
}
|
|
395
|
-
function ArraySource(array) {
|
|
396
|
-
this._array = array;
|
|
397
|
-
}
|
|
398
|
-
ArraySource.prototype.read = array_read;
|
|
399
|
-
ArraySource.prototype.cancel = array_cancel;
|
|
400
|
-
function fetchPath(url) {
|
|
401
|
-
return fetch(url).then(function (response) {
|
|
402
|
-
return response.body && response.body.getReader ? response.body.getReader() : response.arrayBuffer().then(array);
|
|
403
|
-
});
|
|
404
|
-
}
|
|
405
|
-
function requestPath(url) {
|
|
406
|
-
return new Promise(function (resolve, reject) {
|
|
407
|
-
var request = new XMLHttpRequest();
|
|
408
|
-
request.responseType = "arraybuffer";
|
|
409
|
-
request.onload = function () {
|
|
410
|
-
resolve(array(request.response));
|
|
411
|
-
};
|
|
412
|
-
request.onerror = reject;
|
|
413
|
-
request.ontimeout = reject;
|
|
414
|
-
request.open("GET", url, true);
|
|
415
|
-
request.send();
|
|
416
|
-
});
|
|
417
|
-
}
|
|
418
|
-
function path(path) {
|
|
419
|
-
return (typeof fetch === "function" ? fetchPath : requestPath)(path);
|
|
420
|
-
}
|
|
421
|
-
function stream(source) {
|
|
422
|
-
return typeof source.read === "function" ? source : source.getReader();
|
|
423
|
-
}
|
|
424
|
-
var empty = new Uint8Array(0);
|
|
425
|
-
function slice_cancel() {
|
|
426
|
-
return this._source.cancel();
|
|
427
|
-
}
|
|
428
|
-
function concat$1(a, b) {
|
|
429
|
-
if (!a.length) return b;
|
|
430
|
-
if (!b.length) return a;
|
|
431
|
-
var c = new Uint8Array(a.length + b.length);
|
|
432
|
-
c.set(a);
|
|
433
|
-
c.set(b, a.length);
|
|
434
|
-
return c;
|
|
435
|
-
}
|
|
436
|
-
function slice_read() {
|
|
437
|
-
var that = this,
|
|
438
|
-
array = that._array.subarray(that._index);
|
|
439
|
-
return that._source.read().then(function (result) {
|
|
440
|
-
that._array = empty;
|
|
441
|
-
that._index = 0;
|
|
442
|
-
return result.done ? array.length > 0 ? {
|
|
443
|
-
done: false,
|
|
444
|
-
value: array
|
|
445
|
-
} : {
|
|
446
|
-
done: true,
|
|
447
|
-
value: undefined
|
|
448
|
-
} : {
|
|
449
|
-
done: false,
|
|
450
|
-
value: concat$1(array, result.value)
|
|
451
|
-
};
|
|
452
|
-
});
|
|
453
|
-
}
|
|
454
|
-
function slice_slice(length) {
|
|
455
|
-
if ((length |= 0) < 0) throw new Error("invalid length");
|
|
456
|
-
var that = this,
|
|
457
|
-
index = this._array.length - this._index;
|
|
458
|
-
|
|
459
|
-
// If the request fits within the remaining buffer, resolve it immediately.
|
|
460
|
-
if (this._index + length <= this._array.length) {
|
|
461
|
-
return Promise.resolve(this._array.subarray(this._index, this._index += length));
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
// Otherwise, read chunks repeatedly until the request is fulfilled.
|
|
465
|
-
var array = new Uint8Array(length);
|
|
466
|
-
array.set(this._array.subarray(this._index));
|
|
467
|
-
return function read() {
|
|
468
|
-
return that._source.read().then(function (result) {
|
|
469
|
-
// When done, it’s possible the request wasn’t fully fullfilled!
|
|
470
|
-
// If so, the pre-allocated array is too big and needs slicing.
|
|
471
|
-
if (result.done) {
|
|
472
|
-
that._array = empty;
|
|
473
|
-
that._index = 0;
|
|
474
|
-
return index > 0 ? array.subarray(0, index) : null;
|
|
475
|
-
}
|
|
476
|
-
|
|
477
|
-
// If this chunk fulfills the request, return the resulting array.
|
|
478
|
-
if (index + result.value.length >= length) {
|
|
479
|
-
that._array = result.value;
|
|
480
|
-
that._index = length - index;
|
|
481
|
-
array.set(result.value.subarray(0, length - index), index);
|
|
482
|
-
return array;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
// Otherwise copy this chunk into the array, then read the next chunk.
|
|
486
|
-
array.set(result.value, index);
|
|
487
|
-
index += result.value.length;
|
|
488
|
-
return read();
|
|
489
|
-
});
|
|
490
|
-
}();
|
|
491
|
-
}
|
|
492
|
-
function slice(source) {
|
|
493
|
-
return typeof source.slice === "function" ? source : new SliceSource(typeof source.read === "function" ? source : source.getReader());
|
|
494
|
-
}
|
|
495
|
-
function SliceSource(source) {
|
|
496
|
-
this._source = source;
|
|
497
|
-
this._array = empty;
|
|
498
|
-
this._index = 0;
|
|
499
|
-
}
|
|
500
|
-
SliceSource.prototype.read = slice_read;
|
|
501
|
-
SliceSource.prototype.slice = slice_slice;
|
|
502
|
-
SliceSource.prototype.cancel = slice_cancel;
|
|
503
|
-
function dbf_cancel() {
|
|
504
|
-
return this._source.cancel();
|
|
505
|
-
}
|
|
506
|
-
function readBoolean(value) {
|
|
507
|
-
return /^[nf]$/i.test(value) ? false : /^[yt]$/i.test(value) ? true : null;
|
|
508
|
-
}
|
|
509
|
-
function readDate(value) {
|
|
510
|
-
return new Date(+value.substring(0, 4), value.substring(4, 6) - 1, +value.substring(6, 8));
|
|
511
|
-
}
|
|
512
|
-
function readNumber(value) {
|
|
513
|
-
return !(value = value.trim()) || isNaN(value = +value) ? null : value;
|
|
514
|
-
}
|
|
515
|
-
function readString(value) {
|
|
516
|
-
return value.trim() || null;
|
|
517
|
-
}
|
|
518
|
-
var types$1 = {
|
|
519
|
-
B: readNumber,
|
|
520
|
-
C: readString,
|
|
521
|
-
D: readDate,
|
|
522
|
-
F: readNumber,
|
|
523
|
-
L: readBoolean,
|
|
524
|
-
M: readNumber,
|
|
525
|
-
N: readNumber
|
|
526
|
-
};
|
|
527
|
-
function dbf_read() {
|
|
528
|
-
var that = this,
|
|
529
|
-
i = 1;
|
|
530
|
-
return that._source.slice(that._recordLength).then(function (value) {
|
|
531
|
-
return value && value[0] !== 0x1a ? {
|
|
532
|
-
done: false,
|
|
533
|
-
value: that._fields.reduce(function (p, f) {
|
|
534
|
-
p[f.name] = types$1[f.type](that._decode(value.subarray(i, i += f.length)));
|
|
535
|
-
return p;
|
|
536
|
-
}, {})
|
|
537
|
-
} : {
|
|
538
|
-
done: true,
|
|
539
|
-
value: undefined
|
|
540
|
-
};
|
|
541
|
-
});
|
|
542
|
-
}
|
|
543
|
-
function view(array) {
|
|
544
|
-
return new DataView(array.buffer, array.byteOffset, array.byteLength);
|
|
545
|
-
}
|
|
546
|
-
function dbf(source, decoder) {
|
|
547
|
-
source = slice(source);
|
|
548
|
-
return source.slice(32).then(function (array) {
|
|
549
|
-
var head = view(array);
|
|
550
|
-
return source.slice(head.getUint16(8, true) - 32).then(function (array) {
|
|
551
|
-
return new Dbf(source, decoder, head, view(array));
|
|
552
|
-
});
|
|
553
|
-
});
|
|
554
|
-
}
|
|
555
|
-
function Dbf(source, decoder, head, body) {
|
|
556
|
-
this._source = source;
|
|
557
|
-
this._decode = decoder.decode.bind(decoder);
|
|
558
|
-
this._recordLength = head.getUint16(10, true);
|
|
559
|
-
this._fields = [];
|
|
560
|
-
for (var n = 0; body.getUint8(n) !== 0x0d; n += 32) {
|
|
561
|
-
for (var j = 0; j < 11; ++j) if (body.getUint8(n + j) === 0) break;
|
|
562
|
-
this._fields.push({
|
|
563
|
-
name: this._decode(new Uint8Array(body.buffer, body.byteOffset + n, j)),
|
|
564
|
-
type: String.fromCharCode(body.getUint8(n + 11)),
|
|
565
|
-
length: body.getUint8(n + 16)
|
|
566
|
-
});
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
var prototype$2 = Dbf.prototype;
|
|
570
|
-
prototype$2.read = dbf_read;
|
|
571
|
-
prototype$2.cancel = dbf_cancel;
|
|
572
|
-
function cancel() {
|
|
573
|
-
return this._source.cancel();
|
|
574
|
-
}
|
|
575
|
-
function parseMultiPoint(record) {
|
|
576
|
-
var i = 40,
|
|
577
|
-
j,
|
|
578
|
-
n = record.getInt32(36, true),
|
|
579
|
-
coordinates = new Array(n);
|
|
580
|
-
for (j = 0; j < n; ++j, i += 16) coordinates[j] = [record.getFloat64(i, true), record.getFloat64(i + 8, true)];
|
|
581
|
-
return {
|
|
582
|
-
type: "MultiPoint",
|
|
583
|
-
coordinates: coordinates
|
|
584
|
-
};
|
|
585
|
-
}
|
|
586
|
-
function parseNull() {
|
|
587
|
-
return null;
|
|
588
|
-
}
|
|
589
|
-
function parsePoint(record) {
|
|
590
|
-
return {
|
|
591
|
-
type: "Point",
|
|
592
|
-
coordinates: [record.getFloat64(4, true), record.getFloat64(12, true)]
|
|
593
|
-
};
|
|
594
|
-
}
|
|
595
|
-
function parsePolygon(record) {
|
|
596
|
-
var i = 44,
|
|
597
|
-
j,
|
|
598
|
-
n = record.getInt32(36, true),
|
|
599
|
-
m = record.getInt32(40, true),
|
|
600
|
-
parts = new Array(n),
|
|
601
|
-
points = new Array(m),
|
|
602
|
-
polygons = [],
|
|
603
|
-
holes = [];
|
|
604
|
-
for (j = 0; j < n; ++j, i += 4) parts[j] = record.getInt32(i, true);
|
|
605
|
-
for (j = 0; j < m; ++j, i += 16) points[j] = [record.getFloat64(i, true), record.getFloat64(i + 8, true)];
|
|
606
|
-
parts.forEach(function (i, j) {
|
|
607
|
-
var ring = points.slice(i, parts[j + 1]);
|
|
608
|
-
if (ringClockwise(ring)) polygons.push([ring]);else holes.push(ring);
|
|
609
|
-
});
|
|
610
|
-
holes.forEach(function (hole) {
|
|
611
|
-
polygons.some(function (polygon) {
|
|
612
|
-
if (ringContainsSome(polygon[0], hole)) {
|
|
613
|
-
polygon.push(hole);
|
|
614
|
-
return true;
|
|
615
|
-
}
|
|
616
|
-
}) || polygons.push([hole]);
|
|
617
|
-
});
|
|
618
|
-
return polygons.length === 1 ? {
|
|
619
|
-
type: "Polygon",
|
|
620
|
-
coordinates: polygons[0]
|
|
621
|
-
} : {
|
|
622
|
-
type: "MultiPolygon",
|
|
623
|
-
coordinates: polygons
|
|
624
|
-
};
|
|
625
|
-
}
|
|
626
|
-
function ringClockwise(ring) {
|
|
627
|
-
if ((n = ring.length) < 4) return false;
|
|
628
|
-
var i = 0,
|
|
629
|
-
n,
|
|
630
|
-
area = ring[n - 1][1] * ring[0][0] - ring[n - 1][0] * ring[0][1];
|
|
631
|
-
while (++i < n) area += ring[i - 1][1] * ring[i][0] - ring[i - 1][0] * ring[i][1];
|
|
632
|
-
return area >= 0;
|
|
633
|
-
}
|
|
634
|
-
function ringContainsSome(ring, hole) {
|
|
635
|
-
var i = -1,
|
|
636
|
-
n = hole.length,
|
|
637
|
-
c;
|
|
638
|
-
while (++i < n) {
|
|
639
|
-
if (c = ringContains(ring, hole[i])) {
|
|
640
|
-
return c > 0;
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
return false;
|
|
644
|
-
}
|
|
645
|
-
function ringContains(ring, point) {
|
|
646
|
-
var x = point[0],
|
|
647
|
-
y = point[1],
|
|
648
|
-
contains = -1;
|
|
649
|
-
for (var i = 0, n = ring.length, j = n - 1; i < n; j = i++) {
|
|
650
|
-
var pi = ring[i],
|
|
651
|
-
xi = pi[0],
|
|
652
|
-
yi = pi[1],
|
|
653
|
-
pj = ring[j],
|
|
654
|
-
xj = pj[0],
|
|
655
|
-
yj = pj[1];
|
|
656
|
-
if (segmentContains(pi, pj, point)) {
|
|
657
|
-
return 0;
|
|
658
|
-
}
|
|
659
|
-
if (yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi) {
|
|
660
|
-
contains = -contains;
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
return contains;
|
|
664
|
-
}
|
|
665
|
-
function segmentContains(p0, p1, p2) {
|
|
666
|
-
var x20 = p2[0] - p0[0],
|
|
667
|
-
y20 = p2[1] - p0[1];
|
|
668
|
-
if (x20 === 0 && y20 === 0) return true;
|
|
669
|
-
var x10 = p1[0] - p0[0],
|
|
670
|
-
y10 = p1[1] - p0[1];
|
|
671
|
-
if (x10 === 0 && y10 === 0) return false;
|
|
672
|
-
var t = (x20 * x10 + y20 * y10) / (x10 * x10 + y10 * y10);
|
|
673
|
-
return t < 0 || t > 1 ? false : t === 0 || t === 1 ? true : t * x10 === x20 && t * y10 === y20;
|
|
674
|
-
}
|
|
675
|
-
function parsePolyLine(record) {
|
|
676
|
-
var i = 44,
|
|
677
|
-
j,
|
|
678
|
-
n = record.getInt32(36, true),
|
|
679
|
-
m = record.getInt32(40, true),
|
|
680
|
-
parts = new Array(n),
|
|
681
|
-
points = new Array(m);
|
|
682
|
-
for (j = 0; j < n; ++j, i += 4) parts[j] = record.getInt32(i, true);
|
|
683
|
-
for (j = 0; j < m; ++j, i += 16) points[j] = [record.getFloat64(i, true), record.getFloat64(i + 8, true)];
|
|
684
|
-
return n === 1 ? {
|
|
685
|
-
type: "LineString",
|
|
686
|
-
coordinates: points
|
|
687
|
-
} : {
|
|
688
|
-
type: "MultiLineString",
|
|
689
|
-
coordinates: parts.map(function (i, j) {
|
|
690
|
-
return points.slice(i, parts[j + 1]);
|
|
691
|
-
})
|
|
692
|
-
};
|
|
693
|
-
}
|
|
694
|
-
function concat(a, b) {
|
|
695
|
-
var ab = new Uint8Array(a.length + b.length);
|
|
696
|
-
ab.set(a, 0);
|
|
697
|
-
ab.set(b, a.length);
|
|
698
|
-
return ab;
|
|
699
|
-
}
|
|
700
|
-
function shp_read() {
|
|
701
|
-
var that = this;
|
|
702
|
-
++that._index;
|
|
703
|
-
return that._source.slice(12).then(function (array) {
|
|
704
|
-
if (array == null) return {
|
|
705
|
-
done: true,
|
|
706
|
-
value: undefined
|
|
707
|
-
};
|
|
708
|
-
var header = view(array);
|
|
709
|
-
|
|
710
|
-
// If the record starts with an invalid shape type (see #36), scan ahead in
|
|
711
|
-
// four-byte increments to find the next valid record, identified by the
|
|
712
|
-
// expected index, a non-empty content length and a valid shape type.
|
|
713
|
-
function skip() {
|
|
714
|
-
return that._source.slice(4).then(function (chunk) {
|
|
715
|
-
if (chunk == null) return {
|
|
716
|
-
done: true,
|
|
717
|
-
value: undefined
|
|
718
|
-
};
|
|
719
|
-
header = view(array = concat(array.slice(4), chunk));
|
|
720
|
-
return header.getInt32(0, false) !== that._index ? skip() : read();
|
|
721
|
-
});
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
// All records should have at least four bytes (for the record shape type),
|
|
725
|
-
// so an invalid content length indicates corruption.
|
|
726
|
-
function read() {
|
|
727
|
-
var length = header.getInt32(4, false) * 2 - 4,
|
|
728
|
-
type = header.getInt32(8, true);
|
|
729
|
-
return length < 0 || type && type !== that._type ? skip() : that._source.slice(length).then(function (chunk) {
|
|
730
|
-
return {
|
|
731
|
-
done: false,
|
|
732
|
-
value: type ? that._parse(view(concat(array.slice(8), chunk))) : null
|
|
733
|
-
};
|
|
734
|
-
});
|
|
735
|
-
}
|
|
736
|
-
return read();
|
|
737
|
-
});
|
|
738
|
-
}
|
|
739
|
-
var parsers = {
|
|
740
|
-
0: parseNull,
|
|
741
|
-
1: parsePoint,
|
|
742
|
-
3: parsePolyLine,
|
|
743
|
-
5: parsePolygon,
|
|
744
|
-
8: parseMultiPoint,
|
|
745
|
-
11: parsePoint,
|
|
746
|
-
// PointZ
|
|
747
|
-
13: parsePolyLine,
|
|
748
|
-
// PolyLineZ
|
|
749
|
-
15: parsePolygon,
|
|
750
|
-
// PolygonZ
|
|
751
|
-
18: parseMultiPoint,
|
|
752
|
-
// MultiPointZ
|
|
753
|
-
21: parsePoint,
|
|
754
|
-
// PointM
|
|
755
|
-
23: parsePolyLine,
|
|
756
|
-
// PolyLineM
|
|
757
|
-
25: parsePolygon,
|
|
758
|
-
// PolygonM
|
|
759
|
-
28: parseMultiPoint // MultiPointM
|
|
760
|
-
};
|
|
761
|
-
function shp(source) {
|
|
762
|
-
source = slice(source);
|
|
763
|
-
return source.slice(100).then(function (array) {
|
|
764
|
-
return new Shp(source, view(array));
|
|
765
|
-
});
|
|
766
|
-
}
|
|
767
|
-
function Shp(source, header) {
|
|
768
|
-
var type = header.getInt32(32, true);
|
|
769
|
-
if (!(type in parsers)) throw new Error("unsupported shape type: " + type);
|
|
770
|
-
this._source = source;
|
|
771
|
-
this._type = type;
|
|
772
|
-
this._index = 0;
|
|
773
|
-
this._parse = parsers[type];
|
|
774
|
-
this.bbox = [header.getFloat64(36, true), header.getFloat64(44, true), header.getFloat64(52, true), header.getFloat64(60, true)];
|
|
775
|
-
}
|
|
776
|
-
var prototype$1 = Shp.prototype;
|
|
777
|
-
prototype$1.read = shp_read;
|
|
778
|
-
prototype$1.cancel = cancel;
|
|
779
|
-
function noop() {}
|
|
780
|
-
function shapefile_cancel() {
|
|
781
|
-
return Promise.all([this._dbf && this._dbf.cancel(), this._shp.cancel()]).then(noop);
|
|
782
|
-
}
|
|
783
|
-
function shapefile_read() {
|
|
784
|
-
var that = this;
|
|
785
|
-
return Promise.all([that._dbf ? that._dbf.read() : {
|
|
786
|
-
value: {}
|
|
787
|
-
}, that._shp.read()]).then(function (results) {
|
|
788
|
-
var dbf = results[0],
|
|
789
|
-
shp = results[1];
|
|
790
|
-
return shp.done ? shp : {
|
|
791
|
-
done: false,
|
|
792
|
-
value: {
|
|
793
|
-
type: "Feature",
|
|
794
|
-
properties: dbf.value,
|
|
795
|
-
geometry: shp.value
|
|
796
|
-
}
|
|
797
|
-
};
|
|
798
|
-
});
|
|
799
|
-
}
|
|
800
|
-
function shapefile(shpSource, dbfSource, decoder) {
|
|
801
|
-
return Promise.all([shp(shpSource), dbfSource && dbf(dbfSource, decoder)]).then(function (sources) {
|
|
802
|
-
return new Shapefile(sources[0], sources[1]);
|
|
803
|
-
});
|
|
804
|
-
}
|
|
805
|
-
function Shapefile(shp, dbf) {
|
|
806
|
-
this._shp = shp;
|
|
807
|
-
this._dbf = dbf;
|
|
808
|
-
this.bbox = shp.bbox;
|
|
809
|
-
}
|
|
810
|
-
var prototype = Shapefile.prototype;
|
|
811
|
-
prototype.read = shapefile_read;
|
|
812
|
-
prototype.cancel = shapefile_cancel;
|
|
813
|
-
function open(shp, dbf, options) {
|
|
814
|
-
if (typeof dbf === "string") {
|
|
815
|
-
if (!/\.dbf$/.test(dbf)) dbf += ".dbf";
|
|
816
|
-
dbf = path(dbf);
|
|
817
|
-
} else if (dbf instanceof ArrayBuffer || dbf instanceof Uint8Array) {
|
|
818
|
-
dbf = array(dbf);
|
|
819
|
-
} else if (dbf != null) {
|
|
820
|
-
dbf = stream(dbf);
|
|
821
|
-
}
|
|
822
|
-
if (typeof shp === "string") {
|
|
823
|
-
if (!/\.shp$/.test(shp)) shp += ".shp";
|
|
824
|
-
if (dbf === undefined) dbf = path(shp.substring(0, shp.length - 4) + ".dbf").catch(function () {});
|
|
825
|
-
shp = path(shp);
|
|
826
|
-
} else if (shp instanceof ArrayBuffer || shp instanceof Uint8Array) {
|
|
827
|
-
shp = array(shp);
|
|
828
|
-
} else {
|
|
829
|
-
shp = stream(shp);
|
|
830
|
-
}
|
|
831
|
-
return Promise.all([shp, dbf]).then(function (sources) {
|
|
832
|
-
var shp = sources[0],
|
|
833
|
-
dbf = sources[1],
|
|
834
|
-
encoding = "windows-1252";
|
|
835
|
-
return shapefile(shp, dbf, dbf && new TextDecoder(encoding));
|
|
836
|
-
});
|
|
837
|
-
}
|
|
838
|
-
const shpToGeojson = file => {
|
|
839
|
-
return new Promise((resolve, reject) => {
|
|
840
|
-
const reader = new FileReader();
|
|
841
|
-
reader.readAsArrayBuffer(file);
|
|
842
|
-
const data = {
|
|
843
|
-
type: "FeatureCollection",
|
|
844
|
-
features: []
|
|
845
|
-
};
|
|
846
|
-
reader.onload = function () {
|
|
847
|
-
open(this.result).then(source => source.read().then(function log(result) {
|
|
848
|
-
if (!result.done) {
|
|
849
|
-
data.features.push(result.value);
|
|
850
|
-
source.read().then(log);
|
|
851
|
-
} else {
|
|
852
|
-
if (result.value) {
|
|
853
|
-
data.features.push(result.value);
|
|
854
|
-
}
|
|
855
|
-
resolve(data);
|
|
856
|
-
}
|
|
857
|
-
})).catch(reject);
|
|
858
|
-
};
|
|
859
|
-
});
|
|
860
|
-
};
|
|
861
|
-
const toGeojson = file => {
|
|
862
|
-
const actions = {
|
|
863
|
-
shp: shpToGeojson
|
|
864
|
-
};
|
|
865
|
-
return new Promise((resolve, reject) => {
|
|
866
|
-
const suffix = file.name.split(".").pop();
|
|
867
|
-
if (suffix && actions[suffix]) {
|
|
868
|
-
resolve(actions[suffix](file));
|
|
869
|
-
} else {
|
|
870
|
-
reject(new Error(`Can't resolve the .${suffix} file`));
|
|
871
|
-
}
|
|
872
|
-
});
|
|
873
|
-
};
|
|
874
|
-
|
|
875
|
-
/* @preserve
|
|
876
|
-
* @terraformer/arcgis - v2.1.1 - MIT
|
|
877
|
-
* Copyright (c) 2012-2022 Environmental Systems Research Institute, Inc.
|
|
878
|
-
* Tue Aug 02 2022 14:23:48 GMT-0700 (Pacific Daylight Time)
|
|
879
|
-
*/
|
|
880
|
-
/* Copyright (c) 2012-2019 Environmental Systems Research Institute, Inc.
|
|
881
|
-
* Apache-2.0 */
|
|
882
|
-
|
|
883
|
-
var edgeIntersectsEdge = function edgeIntersectsEdge(a1, a2, b1, b2) {
|
|
884
|
-
var uaT = (b2[0] - b1[0]) * (a1[1] - b1[1]) - (b2[1] - b1[1]) * (a1[0] - b1[0]);
|
|
885
|
-
var ubT = (a2[0] - a1[0]) * (a1[1] - b1[1]) - (a2[1] - a1[1]) * (a1[0] - b1[0]);
|
|
886
|
-
var uB = (b2[1] - b1[1]) * (a2[0] - a1[0]) - (b2[0] - b1[0]) * (a2[1] - a1[1]);
|
|
887
|
-
if (uB !== 0) {
|
|
888
|
-
var ua = uaT / uB;
|
|
889
|
-
var ub = ubT / uB;
|
|
890
|
-
if (ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1) {
|
|
891
|
-
return true;
|
|
892
|
-
}
|
|
893
|
-
}
|
|
894
|
-
return false;
|
|
895
|
-
};
|
|
896
|
-
var coordinatesContainPoint = function coordinatesContainPoint(coordinates, point) {
|
|
897
|
-
var contains = false;
|
|
898
|
-
for (var i = -1, l = coordinates.length, j = l - 1; ++i < l; j = i) {
|
|
899
|
-
if ((coordinates[i][1] <= point[1] && point[1] < coordinates[j][1] || coordinates[j][1] <= point[1] && point[1] < coordinates[i][1]) && point[0] < (coordinates[j][0] - coordinates[i][0]) * (point[1] - coordinates[i][1]) / (coordinates[j][1] - coordinates[i][1]) + coordinates[i][0]) {
|
|
900
|
-
contains = !contains;
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
return contains;
|
|
904
|
-
};
|
|
905
|
-
var pointsEqual = function pointsEqual(a, b) {
|
|
906
|
-
for (var i = 0; i < a.length; i++) {
|
|
907
|
-
if (a[i] !== b[i]) {
|
|
908
|
-
return false;
|
|
909
|
-
}
|
|
910
|
-
}
|
|
911
|
-
return true;
|
|
912
|
-
};
|
|
913
|
-
var arrayIntersectsArray = function arrayIntersectsArray(a, b) {
|
|
914
|
-
for (var i = 0; i < a.length - 1; i++) {
|
|
915
|
-
for (var j = 0; j < b.length - 1; j++) {
|
|
916
|
-
if (edgeIntersectsEdge(a[i], a[i + 1], b[j], b[j + 1])) {
|
|
917
|
-
return true;
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
|
-
return false;
|
|
922
|
-
};
|
|
923
|
-
|
|
924
|
-
/* Copyright (c) 2012-2019 Environmental Systems Research Institute, Inc.
|
|
925
|
-
* Apache-2.0 */
|
|
926
|
-
|
|
927
|
-
var closeRing = function closeRing(coordinates) {
|
|
928
|
-
if (!pointsEqual(coordinates[0], coordinates[coordinates.length - 1])) {
|
|
929
|
-
coordinates.push(coordinates[0]);
|
|
930
|
-
}
|
|
931
|
-
return coordinates;
|
|
932
|
-
}; // determine if polygon ring coordinates are clockwise. clockwise signifies outer ring, counter-clockwise an inner ring
|
|
933
|
-
// or hole. this logic was found at http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-
|
|
934
|
-
// points-are-in-clockwise-order
|
|
935
|
-
|
|
936
|
-
var ringIsClockwise = function ringIsClockwise(ringToTest) {
|
|
937
|
-
var total = 0;
|
|
938
|
-
var i = 0;
|
|
939
|
-
var rLength = ringToTest.length;
|
|
940
|
-
var pt1 = ringToTest[i];
|
|
941
|
-
var pt2;
|
|
942
|
-
for (i; i < rLength - 1; i++) {
|
|
943
|
-
pt2 = ringToTest[i + 1];
|
|
944
|
-
total += (pt2[0] - pt1[0]) * (pt2[1] + pt1[1]);
|
|
945
|
-
pt1 = pt2;
|
|
946
|
-
}
|
|
947
|
-
return total >= 0;
|
|
948
|
-
}; // This function ensures that rings are oriented in the right directions
|
|
949
|
-
// from http://jsperf.com/cloning-an-object/2
|
|
950
|
-
|
|
951
|
-
var shallowClone = function shallowClone(obj) {
|
|
952
|
-
var target = {};
|
|
953
|
-
for (var i in obj) {
|
|
954
|
-
// both arcgis attributes and geojson props are just hardcoded keys
|
|
955
|
-
if (obj.hasOwnProperty(i)) {
|
|
956
|
-
// eslint-disable-line no-prototype-builtins
|
|
957
|
-
target[i] = obj[i];
|
|
958
|
-
}
|
|
959
|
-
}
|
|
960
|
-
return target;
|
|
961
|
-
};
|
|
962
|
-
|
|
963
|
-
/* Copyright (c) 2012-2019 Environmental Systems Research Institute, Inc.
|
|
964
|
-
* Apache-2.0 */
|
|
965
|
-
|
|
966
|
-
var coordinatesContainCoordinates = function coordinatesContainCoordinates(outer, inner) {
|
|
967
|
-
var intersects = arrayIntersectsArray(outer, inner);
|
|
968
|
-
var contains = coordinatesContainPoint(outer, inner[0]);
|
|
969
|
-
if (!intersects && contains) {
|
|
970
|
-
return true;
|
|
971
|
-
}
|
|
972
|
-
return false;
|
|
973
|
-
}; // do any polygons in this array contain any other polygons in this array?
|
|
974
|
-
// used for checking for holes in arcgis rings
|
|
975
|
-
|
|
976
|
-
var convertRingsToGeoJSON = function convertRingsToGeoJSON(rings) {
|
|
977
|
-
var outerRings = [];
|
|
978
|
-
var holes = [];
|
|
979
|
-
var x; // iterator
|
|
980
|
-
|
|
981
|
-
var outerRing; // current outer ring being evaluated
|
|
982
|
-
|
|
983
|
-
var hole; // current hole being evaluated
|
|
984
|
-
// for each ring
|
|
985
|
-
|
|
986
|
-
for (var r = 0; r < rings.length; r++) {
|
|
987
|
-
var ring = closeRing(rings[r].slice(0));
|
|
988
|
-
if (ring.length < 4) {
|
|
989
|
-
continue;
|
|
990
|
-
} // is this ring an outer ring? is it clockwise?
|
|
991
|
-
|
|
992
|
-
if (ringIsClockwise(ring)) {
|
|
993
|
-
var polygon = [ring.slice().reverse()]; // wind outer rings counterclockwise for RFC 7946 compliance
|
|
994
|
-
|
|
995
|
-
outerRings.push(polygon); // push to outer rings
|
|
996
|
-
} else {
|
|
997
|
-
holes.push(ring.slice().reverse()); // wind inner rings clockwise for RFC 7946 compliance
|
|
998
|
-
}
|
|
999
|
-
}
|
|
1000
|
-
var uncontainedHoles = []; // while there are holes left...
|
|
1001
|
-
|
|
1002
|
-
while (holes.length) {
|
|
1003
|
-
// pop a hole off out stack
|
|
1004
|
-
hole = holes.pop(); // loop over all outer rings and see if they contain our hole.
|
|
1005
|
-
|
|
1006
|
-
var contained = false;
|
|
1007
|
-
for (x = outerRings.length - 1; x >= 0; x--) {
|
|
1008
|
-
outerRing = outerRings[x][0];
|
|
1009
|
-
if (coordinatesContainCoordinates(outerRing, hole)) {
|
|
1010
|
-
// the hole is contained push it into our polygon
|
|
1011
|
-
outerRings[x].push(hole);
|
|
1012
|
-
contained = true;
|
|
1013
|
-
break;
|
|
1014
|
-
}
|
|
1015
|
-
} // ring is not contained in any outer ring
|
|
1016
|
-
// sometimes this happens https://github.com/Esri/esri-leaflet/issues/320
|
|
1017
|
-
|
|
1018
|
-
if (!contained) {
|
|
1019
|
-
uncontainedHoles.push(hole);
|
|
1020
|
-
}
|
|
1021
|
-
} // if we couldn't match any holes using contains we can try intersects...
|
|
1022
|
-
|
|
1023
|
-
while (uncontainedHoles.length) {
|
|
1024
|
-
// pop a hole off out stack
|
|
1025
|
-
hole = uncontainedHoles.pop(); // loop over all outer rings and see if any intersect our hole.
|
|
1026
|
-
|
|
1027
|
-
var intersects = false;
|
|
1028
|
-
for (x = outerRings.length - 1; x >= 0; x--) {
|
|
1029
|
-
outerRing = outerRings[x][0];
|
|
1030
|
-
if (arrayIntersectsArray(outerRing, hole)) {
|
|
1031
|
-
// the hole is contained push it into our polygon
|
|
1032
|
-
outerRings[x].push(hole);
|
|
1033
|
-
intersects = true;
|
|
1034
|
-
break;
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
if (!intersects) {
|
|
1038
|
-
outerRings.push([hole.reverse()]);
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
1041
|
-
if (outerRings.length === 1) {
|
|
1042
|
-
return {
|
|
1043
|
-
type: 'Polygon',
|
|
1044
|
-
coordinates: outerRings[0]
|
|
1045
|
-
};
|
|
1046
|
-
} else {
|
|
1047
|
-
return {
|
|
1048
|
-
type: 'MultiPolygon',
|
|
1049
|
-
coordinates: outerRings
|
|
1050
|
-
};
|
|
1051
|
-
}
|
|
1052
|
-
};
|
|
1053
|
-
var getId = function getId(attributes, idAttribute) {
|
|
1054
|
-
var keys = ['OBJECTID', 'FID'];
|
|
1055
|
-
for (var i = 0; i < keys.length; i++) {
|
|
1056
|
-
var key = keys[i];
|
|
1057
|
-
if (key in attributes && (typeof attributes[key] === 'string' || typeof attributes[key] === 'number')) {
|
|
1058
|
-
return attributes[key];
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
throw Error('No valid id attribute found');
|
|
1062
|
-
};
|
|
1063
|
-
var arcgisToGeoJSON = function arcgisToGeoJSON(arcgis, idAttribute) {
|
|
1064
|
-
var geojson = {};
|
|
1065
|
-
if (arcgis.features) {
|
|
1066
|
-
geojson.type = 'FeatureCollection';
|
|
1067
|
-
geojson.features = [];
|
|
1068
|
-
for (var i = 0; i < arcgis.features.length; i++) {
|
|
1069
|
-
geojson.features.push(arcgisToGeoJSON(arcgis.features[i], idAttribute));
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
|
-
if (typeof arcgis.x === 'number' && typeof arcgis.y === 'number') {
|
|
1073
|
-
geojson.type = 'Point';
|
|
1074
|
-
geojson.coordinates = [arcgis.x, arcgis.y];
|
|
1075
|
-
if (typeof arcgis.z === 'number') {
|
|
1076
|
-
geojson.coordinates.push(arcgis.z);
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
if (arcgis.points) {
|
|
1080
|
-
geojson.type = 'MultiPoint';
|
|
1081
|
-
geojson.coordinates = arcgis.points.slice(0);
|
|
1082
|
-
}
|
|
1083
|
-
if (arcgis.paths) {
|
|
1084
|
-
if (arcgis.paths.length === 1) {
|
|
1085
|
-
geojson.type = 'LineString';
|
|
1086
|
-
geojson.coordinates = arcgis.paths[0].slice(0);
|
|
1087
|
-
} else {
|
|
1088
|
-
geojson.type = 'MultiLineString';
|
|
1089
|
-
geojson.coordinates = arcgis.paths.slice(0);
|
|
1090
|
-
}
|
|
1091
|
-
}
|
|
1092
|
-
if (arcgis.rings) {
|
|
1093
|
-
geojson = convertRingsToGeoJSON(arcgis.rings.slice(0));
|
|
1094
|
-
}
|
|
1095
|
-
if (typeof arcgis.xmin === 'number' && typeof arcgis.ymin === 'number' && typeof arcgis.xmax === 'number' && typeof arcgis.ymax === 'number') {
|
|
1096
|
-
geojson.type = 'Polygon';
|
|
1097
|
-
geojson.coordinates = [[[arcgis.xmax, arcgis.ymax], [arcgis.xmin, arcgis.ymax], [arcgis.xmin, arcgis.ymin], [arcgis.xmax, arcgis.ymin], [arcgis.xmax, arcgis.ymax]]];
|
|
1098
|
-
}
|
|
1099
|
-
if (arcgis.geometry || arcgis.attributes) {
|
|
1100
|
-
geojson.type = 'Feature';
|
|
1101
|
-
geojson.geometry = arcgis.geometry ? arcgisToGeoJSON(arcgis.geometry) : null;
|
|
1102
|
-
geojson.properties = arcgis.attributes ? shallowClone(arcgis.attributes) : null;
|
|
1103
|
-
if (arcgis.attributes) {
|
|
1104
|
-
try {
|
|
1105
|
-
geojson.id = getId(arcgis.attributes, idAttribute);
|
|
1106
|
-
} catch (err) {// don't set an id
|
|
1107
|
-
}
|
|
1108
|
-
}
|
|
1109
|
-
} // if no valid geometry was encountered
|
|
1110
|
-
|
|
1111
|
-
if (JSON.stringify(geojson.geometry) === JSON.stringify({})) {
|
|
1112
|
-
geojson.geometry = null;
|
|
1113
|
-
}
|
|
1114
|
-
if (arcgis.spatialReference && arcgis.spatialReference.wkid && arcgis.spatialReference.wkid !== 4326) {
|
|
1115
|
-
console.warn('Object converted in non-standard crs - ' + JSON.stringify(arcgis.spatialReference));
|
|
1116
|
-
}
|
|
1117
|
-
return geojson;
|
|
1118
|
-
};
|
|
1119
|
-
|
|
1120
|
-
/* Copyright (c) 2012-2019 Environmental Systems Research Institute, Inc.
|
|
1121
|
-
* Apache-2.0 */
|
|
1122
|
-
// outer rings are clockwise, holes are counterclockwise
|
|
1123
|
-
// used for converting GeoJSON Polygons to ArcGIS Polygons
|
|
1124
|
-
|
|
1125
|
-
var orientRings = function orientRings(poly) {
|
|
1126
|
-
var output = [];
|
|
1127
|
-
var polygon = poly.slice(0);
|
|
1128
|
-
var outerRing = closeRing(polygon.shift().slice(0));
|
|
1129
|
-
if (outerRing.length >= 4) {
|
|
1130
|
-
if (!ringIsClockwise(outerRing)) {
|
|
1131
|
-
outerRing.reverse();
|
|
1132
|
-
}
|
|
1133
|
-
output.push(outerRing);
|
|
1134
|
-
for (var i = 0; i < polygon.length; i++) {
|
|
1135
|
-
var hole = closeRing(polygon[i].slice(0));
|
|
1136
|
-
if (hole.length >= 4) {
|
|
1137
|
-
if (ringIsClockwise(hole)) {
|
|
1138
|
-
hole.reverse();
|
|
1139
|
-
}
|
|
1140
|
-
output.push(hole);
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
}
|
|
1144
|
-
return output;
|
|
1145
|
-
}; // This function flattens holes in multipolygons to one array of polygons
|
|
1146
|
-
// used for converting GeoJSON Polygons to ArcGIS Polygons
|
|
1147
|
-
|
|
1148
|
-
var flattenMultiPolygonRings = function flattenMultiPolygonRings(rings) {
|
|
1149
|
-
var output = [];
|
|
1150
|
-
for (var i = 0; i < rings.length; i++) {
|
|
1151
|
-
var polygon = orientRings(rings[i]);
|
|
1152
|
-
for (var x = polygon.length - 1; x >= 0; x--) {
|
|
1153
|
-
var ring = polygon[x].slice(0);
|
|
1154
|
-
output.push(ring);
|
|
1155
|
-
}
|
|
1156
|
-
}
|
|
1157
|
-
return output;
|
|
1158
|
-
};
|
|
1159
|
-
var geojsonToArcGIS = function geojsonToArcGIS(geojson, idAttribute) {
|
|
1160
|
-
idAttribute = idAttribute || 'OBJECTID';
|
|
1161
|
-
var spatialReference = {
|
|
1162
|
-
wkid: 4326
|
|
1163
|
-
};
|
|
1164
|
-
var result = {};
|
|
1165
|
-
var i;
|
|
1166
|
-
switch (geojson.type) {
|
|
1167
|
-
case 'Point':
|
|
1168
|
-
result.x = geojson.coordinates[0];
|
|
1169
|
-
result.y = geojson.coordinates[1];
|
|
1170
|
-
if (geojson.coordinates[2] != null) {
|
|
1171
|
-
result.z = geojson.coordinates[2];
|
|
1172
|
-
}
|
|
1173
|
-
result.spatialReference = spatialReference;
|
|
1174
|
-
break;
|
|
1175
|
-
case 'MultiPoint':
|
|
1176
|
-
result.points = geojson.coordinates.slice(0);
|
|
1177
|
-
if (geojson.coordinates[0][2] != null) {
|
|
1178
|
-
result.hasZ = true;
|
|
1179
|
-
}
|
|
1180
|
-
result.spatialReference = spatialReference;
|
|
1181
|
-
break;
|
|
1182
|
-
case 'LineString':
|
|
1183
|
-
result.paths = [geojson.coordinates.slice(0)];
|
|
1184
|
-
if (geojson.coordinates[0][2] != null) {
|
|
1185
|
-
result.hasZ = true;
|
|
1186
|
-
}
|
|
1187
|
-
result.spatialReference = spatialReference;
|
|
1188
|
-
break;
|
|
1189
|
-
case 'MultiLineString':
|
|
1190
|
-
result.paths = geojson.coordinates.slice(0);
|
|
1191
|
-
if (geojson.coordinates[0][0][2] != null) {
|
|
1192
|
-
result.hasZ = true;
|
|
1193
|
-
}
|
|
1194
|
-
result.spatialReference = spatialReference;
|
|
1195
|
-
break;
|
|
1196
|
-
case 'Polygon':
|
|
1197
|
-
result.rings = orientRings(geojson.coordinates.slice(0));
|
|
1198
|
-
if (geojson.coordinates[0][0][2] != null) {
|
|
1199
|
-
result.hasZ = true;
|
|
1200
|
-
}
|
|
1201
|
-
result.spatialReference = spatialReference;
|
|
1202
|
-
break;
|
|
1203
|
-
case 'MultiPolygon':
|
|
1204
|
-
result.rings = flattenMultiPolygonRings(geojson.coordinates.slice(0));
|
|
1205
|
-
if (geojson.coordinates[0][0][0][2] != null) {
|
|
1206
|
-
result.hasZ = true;
|
|
1207
|
-
}
|
|
1208
|
-
result.spatialReference = spatialReference;
|
|
1209
|
-
break;
|
|
1210
|
-
case 'Feature':
|
|
1211
|
-
if (geojson.geometry) {
|
|
1212
|
-
result.geometry = geojsonToArcGIS(geojson.geometry, idAttribute);
|
|
1213
|
-
}
|
|
1214
|
-
result.attributes = geojson.properties ? shallowClone(geojson.properties) : {};
|
|
1215
|
-
if (geojson.id) {
|
|
1216
|
-
result.attributes[idAttribute] = geojson.id;
|
|
1217
|
-
}
|
|
1218
|
-
break;
|
|
1219
|
-
case 'FeatureCollection':
|
|
1220
|
-
result = [];
|
|
1221
|
-
for (i = 0; i < geojson.features.length; i++) {
|
|
1222
|
-
result.push(geojsonToArcGIS(geojson.features[i], idAttribute));
|
|
1223
|
-
}
|
|
1224
|
-
break;
|
|
1225
|
-
case 'GeometryCollection':
|
|
1226
|
-
result = [];
|
|
1227
|
-
for (i = 0; i < geojson.geometries.length; i++) {
|
|
1228
|
-
result.push(geojsonToArcGIS(geojson.geometries[i], idAttribute));
|
|
1229
|
-
}
|
|
1230
|
-
break;
|
|
1231
|
-
}
|
|
1232
|
-
return result;
|
|
1233
|
-
};
|
|
1234
|
-
|
|
1235
|
-
var script = defineComponent({
|
|
1236
|
-
name: "VkfEsriInputGeojson",
|
|
1237
|
-
components: {
|
|
1238
|
-
VkfInput,
|
|
1239
|
-
VaSketch,
|
|
1240
|
-
ViewerVue: script$1,
|
|
1241
|
-
VkAsyncTeleport,
|
|
1242
|
-
DocumentChecked: document_checked_default,
|
|
1243
|
-
VaGraphicsLayer
|
|
1244
|
-
},
|
|
1245
|
-
props,
|
|
1246
|
-
emits,
|
|
1247
|
-
setup(props2, {
|
|
1248
|
-
emit
|
|
1249
|
-
}) {
|
|
1250
|
-
const inputBindProps = _VkfInputCtx.createBindProps(props2, ["inputSlots", "readonly", "modelValue"]);
|
|
1251
|
-
const inputOnEmits = _VkfInputCtx.createOnEmits(emit, ["update:modelValue"]);
|
|
1252
|
-
const getInputModelValue = (v) => {
|
|
1253
|
-
const emptyStr = "\u6682\u65E0\u6570\u636E";
|
|
1254
|
-
if (!v)
|
|
1255
|
-
return emptyStr;
|
|
1256
|
-
if (!v.features.length)
|
|
1257
|
-
return emptyStr;
|
|
1258
|
-
return JSON.stringify(v);
|
|
1259
|
-
};
|
|
1260
|
-
const readonly = useComputedReadonly(props2);
|
|
1261
|
-
const sketchIf = ref(!props2.view);
|
|
1262
|
-
const sketchRef = shallowRef();
|
|
1263
|
-
const shetchPanel = computed(() => {
|
|
1264
|
-
const container = sketchRef.value?.container;
|
|
1265
|
-
return container?.querySelector(".esri-sketch__panel");
|
|
1266
|
-
});
|
|
1267
|
-
const viewDef = new Deferred();
|
|
1268
|
-
const layerRef = shallowRef();
|
|
1269
|
-
const sketchLoad = async (e) => {
|
|
1270
|
-
await e.sketch.when();
|
|
1271
|
-
sketchRef.value = e.sketch;
|
|
1272
|
-
viewDef.resolve(sketchRef.value.view);
|
|
1273
|
-
};
|
|
1274
|
-
const layerLoad = async ({
|
|
1275
|
-
view,
|
|
1276
|
-
layer
|
|
1277
|
-
}) => {
|
|
1278
|
-
viewDef.resolve(view);
|
|
1279
|
-
layerRef.value = layer;
|
|
1280
|
-
};
|
|
1281
|
-
const availableCreatureTools = computed(() => {
|
|
1282
|
-
if (Array.isArray(props2.editTypes)) {
|
|
1283
|
-
return props2.editTypes.reduce((pre, cur) => {
|
|
1284
|
-
return pre.concat(EDIT_TYPE_REFLECT[cur].availableCreatureTools);
|
|
1285
|
-
}, []);
|
|
1286
|
-
} else {
|
|
1287
|
-
return EDIT_TYPE_REFLECT[props2.editTypes].availableCreatureTools;
|
|
1288
|
-
}
|
|
1289
|
-
});
|
|
1290
|
-
const sketchValueUpdating = ref(false);
|
|
1291
|
-
const sketchValue = shallowRef([]);
|
|
1292
|
-
watch(() => props2.modelValue, (v, ov) => {
|
|
1293
|
-
if (sketchValueUpdating.value)
|
|
1294
|
-
return;
|
|
1295
|
-
uSketchValue();
|
|
1296
|
-
if (!ov?.features.length) {
|
|
1297
|
-
fly();
|
|
1298
|
-
}
|
|
1299
|
-
}, {
|
|
1300
|
-
immediate: true
|
|
1301
|
-
});
|
|
1302
|
-
const handleUpdateSketchValue = (e) => {
|
|
1303
|
-
sketchValue.value = e;
|
|
1304
|
-
if (props2.skipSave) {
|
|
1305
|
-
u();
|
|
1306
|
-
}
|
|
1307
|
-
};
|
|
1308
|
-
const normalMapRef = shallowRef();
|
|
1309
|
-
const dialogMapRef = shallowRef();
|
|
1310
|
-
const mapTo = shallowRef();
|
|
1311
|
-
onMounted(() => {
|
|
1312
|
-
mapTo.value = normalMapRef.value;
|
|
1313
|
-
});
|
|
1314
|
-
const dialogShow = ref(false);
|
|
1315
|
-
const setDialogShow = (v) => {
|
|
1316
|
-
dialogShow.value = v;
|
|
1317
|
-
};
|
|
1318
|
-
const dialogOnOpen = async () => {
|
|
1319
|
-
mapTo.value = dialogMapRef.value;
|
|
1320
|
-
};
|
|
1321
|
-
const dialogOnClose = async () => {
|
|
1322
|
-
mapTo.value = normalMapRef.value;
|
|
1323
|
-
};
|
|
1324
|
-
const doSave = () => {
|
|
1325
|
-
u();
|
|
1326
|
-
ElMessage({
|
|
1327
|
-
message: "\u4FDD\u5B58\u6210\u529F",
|
|
1328
|
-
type: "success"
|
|
1329
|
-
});
|
|
1330
|
-
dialogShow.value = false;
|
|
1331
|
-
if (props2.view) {
|
|
1332
|
-
sketchIf.value = false;
|
|
1333
|
-
}
|
|
1334
|
-
};
|
|
1335
|
-
const append = () => createVNode(script$3, {
|
|
1336
|
-
"dialog": !readonly.value && props2.dialogEdit,
|
|
1337
|
-
"upload": !readonly.value,
|
|
1338
|
-
"disabled": props2.disabled,
|
|
1339
|
-
"onUpload": onUpload,
|
|
1340
|
-
"onEdit": onEdit,
|
|
1341
|
-
"onFly": () => {
|
|
1342
|
-
if (!props2.showMap && !props2.view) {
|
|
1343
|
-
dialogShow.value = true;
|
|
1344
|
-
}
|
|
1345
|
-
emit("appendFly");
|
|
1346
|
-
fly();
|
|
1347
|
-
}
|
|
1348
|
-
}, null);
|
|
1349
|
-
async function onUpload(e) {
|
|
1350
|
-
if (!e.raw)
|
|
1351
|
-
return;
|
|
1352
|
-
toGeojson(e.raw).then((res) => {
|
|
1353
|
-
emit("update:modelValue", res);
|
|
1354
|
-
}).then(() => {
|
|
1355
|
-
ElMessage.success("\u4E0A\u4F20\u6210\u529F");
|
|
1356
|
-
}).then(fly);
|
|
1357
|
-
}
|
|
1358
|
-
function onEdit() {
|
|
1359
|
-
if (!props2.view) {
|
|
1360
|
-
dialogShow.value = true;
|
|
1361
|
-
} else {
|
|
1362
|
-
sketchIf.value = true;
|
|
1363
|
-
}
|
|
1364
|
-
emit("appendEdit");
|
|
1365
|
-
}
|
|
1366
|
-
function u() {
|
|
1367
|
-
sketchValueUpdating.value = true;
|
|
1368
|
-
const features = sketchValue.value.map((item) => {
|
|
1369
|
-
return arcgisToGeoJSON(item);
|
|
1370
|
-
});
|
|
1371
|
-
emit("update:modelValue", {
|
|
1372
|
-
type: "FeatureCollection",
|
|
1373
|
-
features
|
|
1374
|
-
});
|
|
1375
|
-
nextTick(() => {
|
|
1376
|
-
sketchValueUpdating.value = false;
|
|
1377
|
-
});
|
|
1378
|
-
}
|
|
1379
|
-
function uSketchValue() {
|
|
1380
|
-
const esriData = geojsonToArcGIS(props2.modelValue);
|
|
1381
|
-
const graphics = esriData.map((item) => {
|
|
1382
|
-
const g = item.geometry;
|
|
1383
|
-
if (g.rings) {
|
|
1384
|
-
g.type = "polygon";
|
|
1385
|
-
item.symbol = props2.viewModelActiveFillSymbol;
|
|
1386
|
-
} else if (g.paths) {
|
|
1387
|
-
g.type = "polyline";
|
|
1388
|
-
item.symbol = props2.viewModelActiveLineSymbol;
|
|
1389
|
-
} else if (g.x) {
|
|
1390
|
-
g.type = "point";
|
|
1391
|
-
item.symbol = props2.viewModelActivePointSymbol;
|
|
1392
|
-
}
|
|
1393
|
-
return new Graphic(item);
|
|
1394
|
-
});
|
|
1395
|
-
sketchValue.value = graphics;
|
|
1396
|
-
}
|
|
1397
|
-
watch(() => props2.flying, (v) => {
|
|
1398
|
-
v && fly();
|
|
1399
|
-
});
|
|
1400
|
-
async function fly() {
|
|
1401
|
-
const view = await viewDef.promise;
|
|
1402
|
-
if (!view)
|
|
1403
|
-
return;
|
|
1404
|
-
emit("update:flying", true);
|
|
1405
|
-
await view.when();
|
|
1406
|
-
view.goTo(sketchValue.value).finally(() => {
|
|
1407
|
-
emit("update:flying", false);
|
|
1408
|
-
});
|
|
1409
|
-
}
|
|
1410
|
-
return {
|
|
1411
|
-
inputBindProps,
|
|
1412
|
-
inputOnEmits,
|
|
1413
|
-
append,
|
|
1414
|
-
availableCreatureTools,
|
|
1415
|
-
sketchValue,
|
|
1416
|
-
handleUpdateSketchValue,
|
|
1417
|
-
sketchRef,
|
|
1418
|
-
sketchLoad,
|
|
1419
|
-
shetchPanel,
|
|
1420
|
-
dialogShow,
|
|
1421
|
-
setDialogShow,
|
|
1422
|
-
normalMapRef,
|
|
1423
|
-
dialogMapRef,
|
|
1424
|
-
dialogOnOpen,
|
|
1425
|
-
dialogOnClose,
|
|
1426
|
-
mapTo,
|
|
1427
|
-
doSave,
|
|
1428
|
-
readonly,
|
|
1429
|
-
layerLoad,
|
|
1430
|
-
sketchIf,
|
|
1431
|
-
fly,
|
|
1432
|
-
layerRef,
|
|
1433
|
-
getInputModelValue
|
|
1434
|
-
};
|
|
1435
|
-
}
|
|
1436
|
-
});
|
|
1437
|
-
|
|
1438
|
-
const _hoisted_1 = {
|
|
1439
|
-
class: "vkf-form-item"
|
|
1440
|
-
};
|
|
1441
|
-
const _hoisted_2 = {
|
|
1442
|
-
ref: "normalMapRef",
|
|
1443
|
-
class: "vkf-esri-input-geojson__map"
|
|
1444
|
-
};
|
|
1445
|
-
const _hoisted_3 = {
|
|
1446
|
-
ref: "dialogMapRef",
|
|
1447
|
-
class: "vkf-esri-input-geojson-dialog__map"
|
|
1448
|
-
};
|
|
1449
|
-
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1450
|
-
const _component_VkfInput = resolveComponent("VkfInput");
|
|
1451
|
-
const _component_DocumentChecked = resolveComponent("DocumentChecked");
|
|
1452
|
-
const _component_ElIcon = resolveComponent("ElIcon");
|
|
1453
|
-
const _component_VkAsyncTeleport = resolveComponent("VkAsyncTeleport");
|
|
1454
|
-
const _component_VaSketch = resolveComponent("VaSketch");
|
|
1455
|
-
const _component_VaGraphicsLayer = resolveComponent("VaGraphicsLayer");
|
|
1456
|
-
const _component_ViewerVue = resolveComponent("ViewerVue");
|
|
1457
|
-
const _component_ElDialog = resolveComponent("ElDialog");
|
|
1458
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [renderSlot(_ctx.$slots, "custom", {
|
|
1459
|
-
modelValue: _ctx.modelValue,
|
|
1460
|
-
fly: _ctx.fly,
|
|
1461
|
-
setDialogShow: _ctx.setDialogShow,
|
|
1462
|
-
layer: _ctx.layerRef,
|
|
1463
|
-
showMap: _ctx.showMap
|
|
1464
|
-
}, () => [createVNode(_component_VkfInput, mergeProps({
|
|
1465
|
-
readonly: true,
|
|
1466
|
-
"model-value": _ctx.getInputModelValue(_ctx.modelValue)
|
|
1467
|
-
}, _ctx.inputBindProps, {
|
|
1468
|
-
"input-slots": {
|
|
1469
|
-
append: _ctx.append
|
|
1470
|
-
}
|
|
1471
|
-
}, toHandlers(_ctx.inputOnEmits)), null, 16, ["model-value", "input-slots"])]), createVNode(_component_VkAsyncTeleport, {
|
|
1472
|
-
to: _ctx.mapTo
|
|
1473
|
-
}, {
|
|
1474
|
-
default: withCtx(() => [createVNode(_component_ViewerVue, {
|
|
1475
|
-
view: _ctx.view,
|
|
1476
|
-
"view-component": _ctx.viewComponent,
|
|
1477
|
-
viewComponentAttrs: _ctx.viewComponentAttrs
|
|
1478
|
-
}, {
|
|
1479
|
-
default: withCtx(() => [createVNode(_component_VaGraphicsLayer, {
|
|
1480
|
-
index: _ctx.layerIndex,
|
|
1481
|
-
graphics: _ctx.sketchValue,
|
|
1482
|
-
onLoad: _ctx.layerLoad
|
|
1483
|
-
}, {
|
|
1484
|
-
default: withCtx(() => [!(_ctx.readonly || !_ctx.sketchIf) ? (openBlock(), createBlock(_component_VaSketch, {
|
|
1485
|
-
key: 0,
|
|
1486
|
-
"view-model-active-fill-symbol": _ctx.viewModelActiveFillSymbol,
|
|
1487
|
-
"view-model-active-line-symbol": _ctx.viewModelActiveLineSymbol,
|
|
1488
|
-
"view-model-active-point-symbol": _ctx.viewModelActivePointSymbol,
|
|
1489
|
-
multiple: _ctx.multiple,
|
|
1490
|
-
"available-creature-tools": _ctx.availableCreatureTools,
|
|
1491
|
-
"model-value": _ctx.sketchValue,
|
|
1492
|
-
"onUpdate:modelValue": _ctx.handleUpdateSketchValue,
|
|
1493
|
-
onLoad: _ctx.sketchLoad,
|
|
1494
|
-
visibleElements: _ctx.visibleElements
|
|
1495
|
-
}, {
|
|
1496
|
-
default: withCtx(() => [!_ctx.skipSave && _ctx.shetchPanel ? (openBlock(), createBlock(_component_VkAsyncTeleport, {
|
|
1497
|
-
key: 0,
|
|
1498
|
-
to: _ctx.shetchPanel
|
|
1499
|
-
}, {
|
|
1500
|
-
default: withCtx(() => [createVNode(_component_ElIcon, {
|
|
1501
|
-
class: "esri-sketch-ui-save esri-widget--button",
|
|
1502
|
-
onClick: _ctx.doSave
|
|
1503
|
-
}, {
|
|
1504
|
-
default: withCtx(() => [createVNode(_component_DocumentChecked)]),
|
|
1505
|
-
_: 1
|
|
1506
|
-
/* STABLE */
|
|
1507
|
-
}, 8, ["onClick"])]),
|
|
1508
|
-
_: 1
|
|
1509
|
-
/* STABLE */
|
|
1510
|
-
}, 8, ["to"])) : createCommentVNode("v-if", true)]),
|
|
1511
|
-
_: 1
|
|
1512
|
-
/* STABLE */
|
|
1513
|
-
}, 8, ["view-model-active-fill-symbol", "view-model-active-line-symbol", "view-model-active-point-symbol", "multiple", "available-creature-tools", "model-value", "onUpdate:modelValue", "onLoad", "visibleElements"])) : createCommentVNode("v-if", true)]),
|
|
1514
|
-
_: 1
|
|
1515
|
-
/* STABLE */
|
|
1516
|
-
}, 8, ["index", "graphics", "onLoad"])]),
|
|
1517
|
-
_: 1
|
|
1518
|
-
/* STABLE */
|
|
1519
|
-
}, 8, ["view", "view-component", "viewComponentAttrs"])]),
|
|
1520
|
-
_: 1
|
|
1521
|
-
/* STABLE */
|
|
1522
|
-
}, 8, ["to"]), withDirectives(createElementVNode(
|
|
1523
|
-
"div",
|
|
1524
|
-
_hoisted_2,
|
|
1525
|
-
null,
|
|
1526
|
-
512
|
|
1527
|
-
/* NEED_PATCH */
|
|
1528
|
-
), [[vShow, _ctx.showMap]]), createVNode(_component_ElDialog, {
|
|
1529
|
-
modelValue: _ctx.dialogShow,
|
|
1530
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.dialogShow = $event),
|
|
1531
|
-
title: _ctx.dialogEditTitle,
|
|
1532
|
-
fullscreen: _ctx.dialogEditFullscreen,
|
|
1533
|
-
"modal-class": "vkf-esri-input-geojson-dialog",
|
|
1534
|
-
"append-to-body": true,
|
|
1535
|
-
"close-on-click-modal": false,
|
|
1536
|
-
draggable: true,
|
|
1537
|
-
onOpen: _ctx.dialogOnOpen,
|
|
1538
|
-
onClose: _ctx.dialogOnClose
|
|
1539
|
-
}, {
|
|
1540
|
-
default: withCtx(() => [createElementVNode(
|
|
1541
|
-
"div",
|
|
1542
|
-
_hoisted_3,
|
|
1543
|
-
null,
|
|
1544
|
-
512
|
|
1545
|
-
/* NEED_PATCH */
|
|
1546
|
-
)]),
|
|
1547
|
-
_: 1
|
|
1548
|
-
/* STABLE */
|
|
1549
|
-
}, 8, ["modelValue", "title", "fullscreen", "onOpen", "onClose"])]);
|
|
1550
|
-
}
|
|
1551
|
-
|
|
1552
|
-
script.render = render;
|
|
1553
|
-
script.__file = "esri-input-geojson/src/index.vue";
|
|
1554
|
-
|
|
1555
|
-
var types = /*#__PURE__*/Object.freeze({
|
|
1556
|
-
__proto__: null
|
|
1557
|
-
});
|
|
1558
|
-
|
|
1559
|
-
script.install = (app) => {
|
|
1560
|
-
app.component(script.name, script);
|
|
1561
|
-
};
|
|
1562
|
-
|
|
1563
|
-
export { EDIT_TYPE, EDIT_TYPE_OPTIONS, EDIT_TYPE_REFLECT, EMPTY_FEATURE_COLLECTION, script as VkfEsriInputGeojson, ctx as _VkfEsriInputGeojsonCtx, types as __VkfEsriInputGeojson, script as default };
|