@twinmatrix/spatialverse-sdk-web 0.0.4 → 0.0.5
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/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraSync.js +293 -0
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraSync.js.map +1 -0
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraUtils.js +35 -0
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraUtils.js.map +1 -0
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/constants.js +33 -0
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/constants.js.map +1 -0
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/suncalc.js +307 -0
- package/lib/cjs/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/suncalc.js.map +1 -0
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/focustree.json +121 -0
- package/lib/cjs/meta-atlas-sdk/MetaAtlasCore/whatTaxonomies.json +170 -0
- package/lib/cjs/meta-atlas-sdk/combined_style.json +2313 -0
- package/lib/cjs/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.js +166 -0
- package/lib/cjs/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.js.map +1 -0
- package/lib/cjs/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.js +229 -0
- package/lib/cjs/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.js.map +1 -0
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraSync.js +286 -0
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraSync.js.map +1 -0
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraUtils.js +27 -0
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/CameraUtils.js.map +1 -0
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/constants.js +27 -0
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/constants.js.map +1 -0
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/suncalc.js +305 -0
- package/lib/esm/meta-atlas-sdk/3DMap/CustomThreeJsWrapper/utility/suncalc.js.map +1 -0
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/focustree.json +121 -0
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/meta-atlas-sdk-core.js +2 -2
- package/lib/esm/meta-atlas-sdk/MetaAtlasCore/whatTaxonomies.json +170 -0
- package/lib/esm/meta-atlas-sdk/combined_style.json +2313 -0
- package/lib/esm/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.js +158 -0
- package/lib/esm/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.js.map +1 -0
- package/lib/esm/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.js +221 -0
- package/lib/esm/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var CommonSelectors = _interopRequireWildcard(require("@mapbox/mapbox-gl-draw/src/lib/common_selectors"));
|
|
8
|
+
var _is_event_at_coordinates = _interopRequireDefault(require("@mapbox/mapbox-gl-draw/src/lib/is_event_at_coordinates"));
|
|
9
|
+
var _double_click_zoom = _interopRequireDefault(require("@mapbox/mapbox-gl-draw/src/lib/double_click_zoom"));
|
|
10
|
+
var Constants = _interopRequireWildcard(require("@mapbox/mapbox-gl-draw/src/constants"));
|
|
11
|
+
var _create_vertex = _interopRequireDefault(require("@mapbox/mapbox-gl-draw/src/lib/create_vertex"));
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
const DrawMarker = {};
|
|
15
|
+
DrawMarker.onSetup = function (opts) {
|
|
16
|
+
opts = opts || {};
|
|
17
|
+
const featureId = opts.featureId;
|
|
18
|
+
let line, currentVertexPosition;
|
|
19
|
+
let direction = 'forward';
|
|
20
|
+
if (featureId) {
|
|
21
|
+
line = this.getFeature(featureId);
|
|
22
|
+
if (!line) {
|
|
23
|
+
throw new Error('Could not find a feature with the provided featureId');
|
|
24
|
+
}
|
|
25
|
+
let from = opts.from;
|
|
26
|
+
if (from && from.type === 'Feature' && from.geometry && from.geometry.type === 'Point') {
|
|
27
|
+
from = from.geometry;
|
|
28
|
+
}
|
|
29
|
+
if (from && from.type === 'Point' && from.coordinates && from.coordinates.length === 2) {
|
|
30
|
+
from = from.coordinates;
|
|
31
|
+
}
|
|
32
|
+
if (!from || !Array.isArray(from)) {
|
|
33
|
+
throw new Error('Please use the `from` property to indicate which point to continue the line from');
|
|
34
|
+
}
|
|
35
|
+
const lastCoord = line.coordinates.length - 1;
|
|
36
|
+
if (line.coordinates[lastCoord][0] === from[0] && line.coordinates[lastCoord][1] === from[1]) {
|
|
37
|
+
currentVertexPosition = lastCoord + 1;
|
|
38
|
+
// add one new coordinate to continue from
|
|
39
|
+
line.addCoordinate(currentVertexPosition, ...line.coordinates[lastCoord]);
|
|
40
|
+
} else if (line.coordinates[0][0] === from[0] && line.coordinates[0][1] === from[1]) {
|
|
41
|
+
direction = 'backwards';
|
|
42
|
+
currentVertexPosition = 0;
|
|
43
|
+
// add one new coordinate to continue from
|
|
44
|
+
line.addCoordinate(currentVertexPosition, ...line.coordinates[0]);
|
|
45
|
+
} else {
|
|
46
|
+
throw new Error('`from` should match the point at either the start or the end of the provided LineString');
|
|
47
|
+
}
|
|
48
|
+
} else {
|
|
49
|
+
line = this.newFeature({
|
|
50
|
+
type: Constants.geojsonTypes.FEATURE,
|
|
51
|
+
properties: {
|
|
52
|
+
marker: true
|
|
53
|
+
},
|
|
54
|
+
geometry: {
|
|
55
|
+
type: Constants.geojsonTypes.LINE_STRING,
|
|
56
|
+
coordinates: []
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
currentVertexPosition = 0;
|
|
60
|
+
this.addFeature(line);
|
|
61
|
+
}
|
|
62
|
+
this.clearSelectedFeatures();
|
|
63
|
+
_double_click_zoom.default.disable(this);
|
|
64
|
+
this.updateUIClasses({
|
|
65
|
+
mouse: Constants.cursors.ADD
|
|
66
|
+
});
|
|
67
|
+
this.activateUIButton(Constants.types.LINE);
|
|
68
|
+
this.setActionableState({
|
|
69
|
+
trash: true
|
|
70
|
+
});
|
|
71
|
+
return {
|
|
72
|
+
line,
|
|
73
|
+
currentVertexPosition,
|
|
74
|
+
direction
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
DrawMarker.clickAnywhere = function (state, e) {
|
|
78
|
+
if (state.currentVertexPosition > 0 && (0, _is_event_at_coordinates.default)(e, state.line.coordinates[state.currentVertexPosition - 1]) || state.direction === 'backwards' && (0, _is_event_at_coordinates.default)(e, state.line.coordinates[state.currentVertexPosition + 1])) {
|
|
79
|
+
return this.changeMode(Constants.modes.SIMPLE_SELECT, {
|
|
80
|
+
featureIds: [state.line.id]
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
this.updateUIClasses({
|
|
84
|
+
mouse: Constants.cursors.ADD
|
|
85
|
+
});
|
|
86
|
+
state.line.updateCoordinate(state.currentVertexPosition, e.lngLat.lng, e.lngLat.lat);
|
|
87
|
+
if (state.direction === 'forward') {
|
|
88
|
+
state.currentVertexPosition++;
|
|
89
|
+
state.line.updateCoordinate(state.currentVertexPosition, e.lngLat.lng, e.lngLat.lat);
|
|
90
|
+
} else {
|
|
91
|
+
state.line.addCoordinate(0, e.lngLat.lng, e.lngLat.lat);
|
|
92
|
+
}
|
|
93
|
+
state.line.addCoordinate(0, e.lngLat.lng + 0.00001, e.lngLat.lat);
|
|
94
|
+
return this.changeMode(Constants.modes.SIMPLE_SELECT, {
|
|
95
|
+
featureIds: [state.line.id]
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
DrawMarker.clickOnVertex = function (state) {
|
|
99
|
+
return this.changeMode(Constants.modes.SIMPLE_SELECT, {
|
|
100
|
+
featureIds: [state.line.id]
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
DrawMarker.onMouseMove = function (state, e) {
|
|
104
|
+
state.line.updateCoordinate(state.currentVertexPosition, e.lngLat.lng, e.lngLat.lat);
|
|
105
|
+
if (CommonSelectors.isVertex(e)) {
|
|
106
|
+
this.updateUIClasses({
|
|
107
|
+
mouse: Constants.cursors.POINTER
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
DrawMarker.onTap = DrawMarker.onClick = function (state, e) {
|
|
112
|
+
if (CommonSelectors.isVertex(e)) return this.clickOnVertex(state, e);
|
|
113
|
+
this.clickAnywhere(state, e);
|
|
114
|
+
};
|
|
115
|
+
DrawMarker.onKeyUp = function (state, e) {
|
|
116
|
+
if (CommonSelectors.isEnterKey(e)) {
|
|
117
|
+
this.changeMode(Constants.modes.SIMPLE_SELECT, {
|
|
118
|
+
featureIds: [state.line.id]
|
|
119
|
+
});
|
|
120
|
+
} else if (CommonSelectors.isEscapeKey(e)) {
|
|
121
|
+
this.deleteFeature([state.line.id], {
|
|
122
|
+
silent: true
|
|
123
|
+
});
|
|
124
|
+
this.changeMode(Constants.modes.SIMPLE_SELECT);
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
DrawMarker.onStop = function (state) {
|
|
128
|
+
_double_click_zoom.default.enable(this);
|
|
129
|
+
this.activateUIButton();
|
|
130
|
+
|
|
131
|
+
// check to see if we've deleted this feature
|
|
132
|
+
if (this.getFeature(state.line.id) === undefined) return;
|
|
133
|
+
|
|
134
|
+
//remove last added coordinate
|
|
135
|
+
state.line.removeCoordinate("".concat(state.currentVertexPosition));
|
|
136
|
+
if (state.line.isValid()) {
|
|
137
|
+
this.map.fire(Constants.events.CREATE, {
|
|
138
|
+
features: [state.line.toGeoJSON()]
|
|
139
|
+
});
|
|
140
|
+
} else {
|
|
141
|
+
this.deleteFeature([state.line.id], {
|
|
142
|
+
silent: true
|
|
143
|
+
});
|
|
144
|
+
this.changeMode(Constants.modes.SIMPLE_SELECT, {}, {
|
|
145
|
+
silent: true
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
DrawMarker.onTrash = function (state) {
|
|
150
|
+
this.deleteFeature([state.line.id], {
|
|
151
|
+
silent: true
|
|
152
|
+
});
|
|
153
|
+
this.changeMode(Constants.modes.SIMPLE_SELECT);
|
|
154
|
+
};
|
|
155
|
+
DrawMarker.toDisplayFeatures = function (state, geojson, display) {
|
|
156
|
+
const isActiveLine = geojson.properties.id === state.line.id;
|
|
157
|
+
geojson.properties.active = isActiveLine ? Constants.activeStates.ACTIVE : Constants.activeStates.INACTIVE;
|
|
158
|
+
if (!isActiveLine) return display(geojson);
|
|
159
|
+
// Only render the line if it has at least one real coordinate
|
|
160
|
+
if (geojson.geometry.coordinates.length < 2) return;
|
|
161
|
+
geojson.properties.meta = Constants.meta.FEATURE;
|
|
162
|
+
display((0, _create_vertex.default)(state.line.id, geojson.geometry.coordinates[state.direction === 'forward' ? geojson.geometry.coordinates.length - 2 : 1], "".concat(state.direction === 'forward' ? geojson.geometry.coordinates.length - 2 : 1), false));
|
|
163
|
+
display(geojson);
|
|
164
|
+
};
|
|
165
|
+
var _default = exports.default = DrawMarker;
|
|
166
|
+
//# sourceMappingURL=draw_marker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draw_marker.js","names":["CommonSelectors","_interopRequireWildcard","require","_is_event_at_coordinates","_interopRequireDefault","_double_click_zoom","Constants","_create_vertex","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","DrawMarker","onSetup","opts","featureId","line","currentVertexPosition","direction","getFeature","Error","from","type","geometry","coordinates","length","Array","isArray","lastCoord","addCoordinate","newFeature","geojsonTypes","FEATURE","properties","marker","LINE_STRING","addFeature","clearSelectedFeatures","doubleClickZoom","disable","updateUIClasses","mouse","cursors","ADD","activateUIButton","types","LINE","setActionableState","trash","clickAnywhere","state","isEventAtCoordinates","changeMode","modes","SIMPLE_SELECT","featureIds","id","updateCoordinate","lngLat","lng","lat","clickOnVertex","onMouseMove","isVertex","POINTER","onTap","onClick","onKeyUp","isEnterKey","isEscapeKey","deleteFeature","silent","onStop","enable","undefined","removeCoordinate","concat","isValid","map","fire","events","CREATE","features","toGeoJSON","onTrash","toDisplayFeatures","geojson","display","isActiveLine","active","activeStates","ACTIVE","INACTIVE","meta","createVertex","_default","exports"],"sources":["../../../../src/meta-atlas-sdk/mapbox_draw_custom_modes/draw_marker.js"],"sourcesContent":["import * as CommonSelectors from '@mapbox/mapbox-gl-draw/src/lib/common_selectors';\nimport isEventAtCoordinates from '@mapbox/mapbox-gl-draw/src/lib/is_event_at_coordinates';\nimport doubleClickZoom from '@mapbox/mapbox-gl-draw/src/lib/double_click_zoom';\nimport * as Constants from '@mapbox/mapbox-gl-draw/src/constants';\nimport createVertex from '@mapbox/mapbox-gl-draw/src/lib/create_vertex';\nconst DrawMarker = {};\n\nDrawMarker.onSetup = function(opts) {\n opts = opts || {};\n const featureId = opts.featureId;\n\n let line, currentVertexPosition;\n let direction = 'forward';\n if (featureId) {\n line = this.getFeature(featureId);\n if (!line) {\n throw new Error('Could not find a feature with the provided featureId');\n }\n let from = opts.from;\n if (from && from.type === 'Feature' && from.geometry && from.geometry.type === 'Point') {\n from = from.geometry;\n }\n if (from && from.type === 'Point' && from.coordinates && from.coordinates.length === 2) {\n from = from.coordinates;\n }\n if (!from || !Array.isArray(from)) {\n throw new Error('Please use the `from` property to indicate which point to continue the line from');\n }\n const lastCoord = line.coordinates.length - 1;\n if (line.coordinates[lastCoord][0] === from[0] && line.coordinates[lastCoord][1] === from[1]) {\n currentVertexPosition = lastCoord + 1;\n // add one new coordinate to continue from\n line.addCoordinate(currentVertexPosition, ...line.coordinates[lastCoord]);\n } else if (line.coordinates[0][0] === from[0] && line.coordinates[0][1] === from[1]) {\n direction = 'backwards';\n currentVertexPosition = 0;\n // add one new coordinate to continue from\n line.addCoordinate(currentVertexPosition, ...line.coordinates[0]);\n } else {\n throw new Error('`from` should match the point at either the start or the end of the provided LineString');\n }\n } else {\n line = this.newFeature({\n type: Constants.geojsonTypes.FEATURE,\n properties: {\n marker: true\n },\n geometry: {\n type: Constants.geojsonTypes.LINE_STRING,\n coordinates: []\n }\n });\n currentVertexPosition = 0;\n this.addFeature(line);\n }\n\n this.clearSelectedFeatures();\n doubleClickZoom.disable(this);\n this.updateUIClasses({ mouse: Constants.cursors.ADD });\n this.activateUIButton(Constants.types.LINE);\n this.setActionableState({\n trash: true\n });\n\n return {\n line,\n currentVertexPosition,\n direction\n };\n};\n\nDrawMarker.clickAnywhere = function(state, e) {\n if (state.currentVertexPosition > 0 && isEventAtCoordinates(e, state.line.coordinates[state.currentVertexPosition - 1]) ||\n state.direction === 'backwards' && isEventAtCoordinates(e, state.line.coordinates[state.currentVertexPosition + 1])) {\n return this.changeMode(Constants.modes.SIMPLE_SELECT, { featureIds: [state.line.id] });\n }\n this.updateUIClasses({ mouse: Constants.cursors.ADD });\n state.line.updateCoordinate(state.currentVertexPosition, e.lngLat.lng, e.lngLat.lat);\n if (state.direction === 'forward') {\n state.currentVertexPosition++;\n state.line.updateCoordinate(state.currentVertexPosition, e.lngLat.lng, e.lngLat.lat);\n } else {\n state.line.addCoordinate(0, e.lngLat.lng, e.lngLat.lat);\n }\n\n state.line.addCoordinate(0, e.lngLat.lng+0.00001, e.lngLat.lat);\n return this.changeMode(Constants.modes.SIMPLE_SELECT, { featureIds: [state.line.id] });\n};\n\nDrawMarker.clickOnVertex = function(state) {\n return this.changeMode(Constants.modes.SIMPLE_SELECT, { featureIds: [state.line.id] });\n};\n\nDrawMarker.onMouseMove = function(state, e) {\n state.line.updateCoordinate(state.currentVertexPosition, e.lngLat.lng, e.lngLat.lat);\n if (CommonSelectors.isVertex(e)) {\n this.updateUIClasses({ mouse: Constants.cursors.POINTER });\n }\n};\n\nDrawMarker.onTap = DrawMarker.onClick = function(state, e) {\n if (CommonSelectors.isVertex(e)) return this.clickOnVertex(state, e);\n this.clickAnywhere(state, e);\n};\n\nDrawMarker.onKeyUp = function(state, e) {\n if (CommonSelectors.isEnterKey(e)) {\n this.changeMode(Constants.modes.SIMPLE_SELECT, { featureIds: [state.line.id] });\n } else if (CommonSelectors.isEscapeKey(e)) {\n this.deleteFeature([state.line.id], { silent: true });\n this.changeMode(Constants.modes.SIMPLE_SELECT);\n }\n};\n\nDrawMarker.onStop = function(state) {\n doubleClickZoom.enable(this);\n this.activateUIButton();\n\n // check to see if we've deleted this feature\n if (this.getFeature(state.line.id) === undefined) return;\n\n //remove last added coordinate\n state.line.removeCoordinate(`${state.currentVertexPosition}`);\n if (state.line.isValid()) {\n this.map.fire(Constants.events.CREATE, {\n features: [state.line.toGeoJSON()]\n });\n } else {\n this.deleteFeature([state.line.id], { silent: true });\n this.changeMode(Constants.modes.SIMPLE_SELECT, {}, { silent: true });\n }\n};\n\nDrawMarker.onTrash = function(state) {\n this.deleteFeature([state.line.id], { silent: true });\n this.changeMode(Constants.modes.SIMPLE_SELECT);\n};\n\nDrawMarker.toDisplayFeatures = function(state, geojson, display) {\n const isActiveLine = geojson.properties.id === state.line.id;\n geojson.properties.active = (isActiveLine) ? Constants.activeStates.ACTIVE : Constants.activeStates.INACTIVE;\n if (!isActiveLine) return display(geojson);\n // Only render the line if it has at least one real coordinate\n if (geojson.geometry.coordinates.length < 2) return;\n geojson.properties.meta = Constants.meta.FEATURE;\n display(createVertex(\n state.line.id,\n geojson.geometry.coordinates[state.direction === 'forward' ? geojson.geometry.coordinates.length - 2 : 1],\n `${state.direction === 'forward' ? geojson.geometry.coordinates.length - 2 : 1}`,\n false\n ));\n\n display(geojson);\n};\n\nexport default DrawMarker;"],"mappings":";;;;;;AAAA,IAAAA,eAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,SAAA,GAAAL,uBAAA,CAAAC,OAAA;AACA,IAAAK,cAAA,GAAAH,sBAAA,CAAAF,OAAA;AAAwE,SAAAE,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAP,wBAAAO,CAAA,EAAAG,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAX,uBAAA,YAAAA,CAAAO,CAAA,EAAAG,CAAA,SAAAA,CAAA,IAAAH,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,MAAAO,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAR,OAAA,EAAAF,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAS,CAAA,MAAAF,CAAA,GAAAJ,CAAA,GAAAG,CAAA,GA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C,EAAE;EAC5D8B,OAAO,CAACrD,UAAU,CAACwD,MAAM,GAAID,YAAY,GAAIjG,SAAS,CAACmG,YAAY,CAACC,MAAM,GAAGpG,SAAS,CAACmG,YAAY,CAACE,QAAQ;EAC5G,IAAI,CAACJ,YAAY,EAAE,OAAOD,OAAO,CAACD,OAAO,CAAC;EAC1C;EACA,IAAIA,OAAO,CAAC/D,QAAQ,CAACC,WAAW,CAACC,MAAM,GAAG,CAAC,EAAE;EAC7C6D,OAAO,CAACrD,UAAU,CAAC4D,IAAI,GAAGtG,SAAS,CAACsG,IAAI,CAAC7D,OAAO;EAChDuD,OAAO,CAAC,IAAAO,sBAAY,EAClB5C,KAAK,CAAClC,IAAI,CAACwC,EAAE,EACb8B,OAAO,CAAC/D,QAAQ,CAACC,WAAW,CAAC0B,KAAK,CAAChC,SAAS,KAAK,SAAS,GAAGoE,OAAO,CAAC/D,QAAQ,CAACC,WAAW,CAACC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,KAAAmD,MAAA,CACtG1B,KAAK,CAAChC,SAAS,KAAK,SAAS,GAAGoE,OAAO,CAAC/D,QAAQ,CAACC,WAAW,CAACC,MAAM,GAAG,CAAC,GAAG,CAAC,GAC9E,KACF,CAAC,CAAC;EAEF8D,OAAO,CAACD,OAAO,CAAC;AAClB,CAAC;AAAC,IAAAS,QAAA,GAAAC,OAAA,CAAArG,OAAA,GAEaiB,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _common_selectors = require("@mapbox/mapbox-gl-draw/src/lib/common_selectors");
|
|
8
|
+
var _create_supplementary_points = _interopRequireDefault(require("@mapbox/mapbox-gl-draw/src/lib/create_supplementary_points"));
|
|
9
|
+
var _constrain_feature_movement = _interopRequireDefault(require("@mapbox/mapbox-gl-draw/src/lib/constrain_feature_movement"));
|
|
10
|
+
var _double_click_zoom = _interopRequireDefault(require("@mapbox/mapbox-gl-draw/src/lib/double_click_zoom"));
|
|
11
|
+
var Constants = _interopRequireWildcard(require("@mapbox/mapbox-gl-draw/src/constants"));
|
|
12
|
+
var _move_features = _interopRequireDefault(require("@mapbox/mapbox-gl-draw/src/lib/move_features"));
|
|
13
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
const isVertex = (0, _common_selectors.isOfMetaType)(Constants.meta.VERTEX);
|
|
16
|
+
const isMidpoint = (0, _common_selectors.isOfMetaType)(Constants.meta.MIDPOINT);
|
|
17
|
+
const MarkerSelect = {};
|
|
18
|
+
|
|
19
|
+
// INTERNAL FUCNTIONS
|
|
20
|
+
|
|
21
|
+
MarkerSelect.fireUpdate = function () {
|
|
22
|
+
this.map.fire(Constants.events.UPDATE, {
|
|
23
|
+
action: Constants.updateActions.CHANGE_COORDINATES,
|
|
24
|
+
features: this.getSelected().map(f => f.toGeoJSON())
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
MarkerSelect.fireActionable = function (state) {
|
|
28
|
+
this.setActionableState({
|
|
29
|
+
combineFeatures: false,
|
|
30
|
+
uncombineFeatures: false,
|
|
31
|
+
trash: state.selectedCoordPaths.length > 0
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
MarkerSelect.startDragging = function (state, e) {
|
|
35
|
+
this.map.dragPan.disable();
|
|
36
|
+
state.canDragMove = true;
|
|
37
|
+
state.dragMoveLocation = e.lngLat;
|
|
38
|
+
};
|
|
39
|
+
MarkerSelect.stopDragging = function (state) {
|
|
40
|
+
this.map.dragPan.enable();
|
|
41
|
+
state.dragMoving = false;
|
|
42
|
+
state.canDragMove = false;
|
|
43
|
+
state.dragMoveLocation = null;
|
|
44
|
+
};
|
|
45
|
+
MarkerSelect.onVertex = function (state, e) {
|
|
46
|
+
this.startDragging(state, e);
|
|
47
|
+
const about = e.featureTarget.properties;
|
|
48
|
+
const selectedIndex = state.selectedCoordPaths.indexOf(about.coord_path);
|
|
49
|
+
if (!(0, _common_selectors.isShiftDown)(e) && selectedIndex === -1) {
|
|
50
|
+
state.selectedCoordPaths = [about.coord_path];
|
|
51
|
+
} else if ((0, _common_selectors.isShiftDown)(e) && selectedIndex === -1) {
|
|
52
|
+
state.selectedCoordPaths.push(about.coord_path);
|
|
53
|
+
}
|
|
54
|
+
const selectedCoordinates = this.pathsToCoordinates(state.featureId, state.selectedCoordPaths);
|
|
55
|
+
this.setSelectedCoordinates(selectedCoordinates);
|
|
56
|
+
};
|
|
57
|
+
MarkerSelect.onMidpoint = function (state, e) {
|
|
58
|
+
this.startDragging(state, e);
|
|
59
|
+
const about = e.featureTarget.properties;
|
|
60
|
+
state.feature.addCoordinate(about.coord_path, about.lng, about.lat);
|
|
61
|
+
this.fireUpdate();
|
|
62
|
+
state.selectedCoordPaths = [about.coord_path];
|
|
63
|
+
};
|
|
64
|
+
MarkerSelect.pathsToCoordinates = function (featureId, paths) {
|
|
65
|
+
return paths.map(coord_path => ({
|
|
66
|
+
feature_id: featureId,
|
|
67
|
+
coord_path
|
|
68
|
+
}));
|
|
69
|
+
};
|
|
70
|
+
MarkerSelect.onFeature = function (state, e) {
|
|
71
|
+
if (state.selectedCoordPaths.length === 0) this.startDragging(state, e);else this.stopDragging(state);
|
|
72
|
+
};
|
|
73
|
+
MarkerSelect.dragFeature = function (state, e, delta) {
|
|
74
|
+
(0, _move_features.default)(this.getSelected(), delta);
|
|
75
|
+
state.dragMoveLocation = e.lngLat;
|
|
76
|
+
};
|
|
77
|
+
MarkerSelect.dragVertex = function (state, e, delta) {
|
|
78
|
+
const selectedCoords = state.selectedCoordPaths.map(coord_path => state.feature.getCoordinate(coord_path));
|
|
79
|
+
const selectedCoordPoints = selectedCoords.map(coords => ({
|
|
80
|
+
type: Constants.geojsonTypes.FEATURE,
|
|
81
|
+
properties: {},
|
|
82
|
+
geometry: {
|
|
83
|
+
type: Constants.geojsonTypes.POINT,
|
|
84
|
+
coordinates: coords
|
|
85
|
+
}
|
|
86
|
+
}));
|
|
87
|
+
const constrainedDelta = (0, _constrain_feature_movement.default)(selectedCoordPoints, delta);
|
|
88
|
+
for (let i = 0; i < selectedCoords.length; i++) {
|
|
89
|
+
const coord = selectedCoords[i];
|
|
90
|
+
state.feature.updateCoordinate(state.selectedCoordPaths[i], coord[0] + constrainedDelta.lng, coord[1] + constrainedDelta.lat);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
MarkerSelect.clickNoTarget = function () {
|
|
94
|
+
this.changeMode(Constants.modes.SIMPLE_SELECT);
|
|
95
|
+
};
|
|
96
|
+
MarkerSelect.clickInactive = function () {
|
|
97
|
+
this.changeMode(Constants.modes.SIMPLE_SELECT);
|
|
98
|
+
};
|
|
99
|
+
MarkerSelect.clickActiveFeature = function (state) {
|
|
100
|
+
state.selectedCoordPaths = [];
|
|
101
|
+
this.clearSelectedCoordinates();
|
|
102
|
+
state.feature.changed();
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// EXTERNAL FUNCTIONS
|
|
106
|
+
|
|
107
|
+
MarkerSelect.onSetup = function (opts) {
|
|
108
|
+
const featureId = opts.featureId;
|
|
109
|
+
const feature = this.getFeature(featureId);
|
|
110
|
+
if (!feature) {
|
|
111
|
+
throw new Error('You must provide a featureId to enter direct_select mode');
|
|
112
|
+
}
|
|
113
|
+
if (feature.type === Constants.geojsonTypes.POINT) {
|
|
114
|
+
throw new TypeError('direct_select mode doesn\'t handle point features');
|
|
115
|
+
}
|
|
116
|
+
const state = {
|
|
117
|
+
featureId,
|
|
118
|
+
feature,
|
|
119
|
+
dragMoveLocation: opts.startPos || null,
|
|
120
|
+
dragMoving: false,
|
|
121
|
+
canDragMove: false,
|
|
122
|
+
selectedCoordPaths: opts.coordPath ? [opts.coordPath] : []
|
|
123
|
+
};
|
|
124
|
+
this.setSelectedCoordinates(this.pathsToCoordinates(featureId, state.selectedCoordPaths));
|
|
125
|
+
this.setSelected(featureId);
|
|
126
|
+
_double_click_zoom.default.disable(this);
|
|
127
|
+
this.setActionableState({
|
|
128
|
+
trash: true
|
|
129
|
+
});
|
|
130
|
+
return state;
|
|
131
|
+
};
|
|
132
|
+
MarkerSelect.onStop = function () {
|
|
133
|
+
_double_click_zoom.default.enable(this);
|
|
134
|
+
this.clearSelectedCoordinates();
|
|
135
|
+
};
|
|
136
|
+
MarkerSelect.toDisplayFeatures = function (state, geojson, push) {
|
|
137
|
+
if (state.featureId === geojson.properties.id) {
|
|
138
|
+
geojson.properties.active = Constants.activeStates.ACTIVE;
|
|
139
|
+
push(geojson);
|
|
140
|
+
(0, _create_supplementary_points.default)(geojson, {
|
|
141
|
+
map: this.map,
|
|
142
|
+
midpoints: true,
|
|
143
|
+
selectedPaths: state.selectedCoordPaths
|
|
144
|
+
}).forEach(push);
|
|
145
|
+
} else {
|
|
146
|
+
geojson.properties.active = Constants.activeStates.INACTIVE;
|
|
147
|
+
push(geojson);
|
|
148
|
+
}
|
|
149
|
+
this.fireActionable(state);
|
|
150
|
+
};
|
|
151
|
+
MarkerSelect.onTrash = function (state) {
|
|
152
|
+
// Uses number-aware sorting to make sure '9' < '10'. Comparison is reversed because we want them
|
|
153
|
+
// in reverse order so that we can remove by index safely.
|
|
154
|
+
state.selectedCoordPaths.sort((a, b) => b.localeCompare(a, 'en', {
|
|
155
|
+
numeric: true
|
|
156
|
+
})).forEach(id => state.feature.removeCoordinate(id));
|
|
157
|
+
this.fireUpdate();
|
|
158
|
+
state.selectedCoordPaths = [];
|
|
159
|
+
this.clearSelectedCoordinates();
|
|
160
|
+
this.fireActionable(state);
|
|
161
|
+
if (state.feature.isValid() === false) {
|
|
162
|
+
this.deleteFeature([state.featureId]);
|
|
163
|
+
this.changeMode(Constants.modes.SIMPLE_SELECT, {});
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
MarkerSelect.onMouseMove = function (state, e) {
|
|
167
|
+
// On mousemove that is not a drag, stop vertex movement.
|
|
168
|
+
const isFeature = (0, _common_selectors.isActiveFeature)(e);
|
|
169
|
+
const onVertex = isVertex(e);
|
|
170
|
+
const isMidPoint = isMidpoint(e);
|
|
171
|
+
const noCoords = state.selectedCoordPaths.length === 0;
|
|
172
|
+
if (isFeature && noCoords) this.updateUIClasses({
|
|
173
|
+
mouse: Constants.cursors.MOVE
|
|
174
|
+
});else if (onVertex && !noCoords) this.updateUIClasses({
|
|
175
|
+
mouse: Constants.cursors.MOVE
|
|
176
|
+
});else this.updateUIClasses({
|
|
177
|
+
mouse: Constants.cursors.NONE
|
|
178
|
+
});
|
|
179
|
+
const isDraggableItem = onVertex || isFeature || isMidPoint;
|
|
180
|
+
if (isDraggableItem && state.dragMoving) this.fireUpdate();
|
|
181
|
+
this.stopDragging(state);
|
|
182
|
+
|
|
183
|
+
// Skip render
|
|
184
|
+
return true;
|
|
185
|
+
};
|
|
186
|
+
MarkerSelect.onMouseOut = function (state) {
|
|
187
|
+
// As soon as you mouse leaves the canvas, update the feature
|
|
188
|
+
if (state.dragMoving) this.fireUpdate();
|
|
189
|
+
|
|
190
|
+
// Skip render
|
|
191
|
+
return true;
|
|
192
|
+
};
|
|
193
|
+
MarkerSelect.onTouchStart = MarkerSelect.onMouseDown = function (state, e) {
|
|
194
|
+
if (isVertex(e)) return this.onVertex(state, e);
|
|
195
|
+
if ((0, _common_selectors.isActiveFeature)(e)) return this.onFeature(state, e);
|
|
196
|
+
if (isMidpoint(e)) return this.onMidpoint(state, e);
|
|
197
|
+
};
|
|
198
|
+
MarkerSelect.onDrag = function (state, e) {
|
|
199
|
+
if (state.canDragMove !== true) return;
|
|
200
|
+
state.dragMoving = true;
|
|
201
|
+
e.originalEvent.stopPropagation();
|
|
202
|
+
const delta = {
|
|
203
|
+
lng: e.lngLat.lng - state.dragMoveLocation.lng,
|
|
204
|
+
lat: e.lngLat.lat - state.dragMoveLocation.lat
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
// always drag feature, never drag vertex
|
|
208
|
+
this.dragFeature(state, e, delta);
|
|
209
|
+
state.dragMoveLocation = e.lngLat;
|
|
210
|
+
};
|
|
211
|
+
MarkerSelect.onClick = function (state, e) {
|
|
212
|
+
if ((0, _common_selectors.noTarget)(e)) return this.clickNoTarget(state, e);
|
|
213
|
+
if ((0, _common_selectors.isActiveFeature)(e)) return this.clickActiveFeature(state, e);
|
|
214
|
+
if ((0, _common_selectors.isInactiveFeature)(e)) return this.clickInactive(state, e);
|
|
215
|
+
this.stopDragging(state);
|
|
216
|
+
};
|
|
217
|
+
MarkerSelect.onTap = function (state, e) {
|
|
218
|
+
if ((0, _common_selectors.noTarget)(e)) return this.clickNoTarget(state, e);
|
|
219
|
+
if ((0, _common_selectors.isActiveFeature)(e)) return this.clickActiveFeature(state, e);
|
|
220
|
+
if ((0, _common_selectors.isInactiveFeature)(e)) return this.clickInactive(state, e);
|
|
221
|
+
};
|
|
222
|
+
MarkerSelect.onTouchEnd = MarkerSelect.onMouseUp = function (state) {
|
|
223
|
+
if (state.dragMoving) {
|
|
224
|
+
this.fireUpdate();
|
|
225
|
+
}
|
|
226
|
+
this.stopDragging(state);
|
|
227
|
+
};
|
|
228
|
+
var _default = exports.default = MarkerSelect;
|
|
229
|
+
//# sourceMappingURL=marker_select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marker_select.js","names":["_common_selectors","require","_create_supplementary_points","_interopRequireDefault","_constrain_feature_movement","_double_click_zoom","Constants","_interopRequireWildcard","_move_features","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","isVertex","isOfMetaType","meta","VERTEX","isMidpoint","MIDPOINT","MarkerSelect","fireUpdate","map","fire","events","UPDATE","action","updateActions","CHANGE_COORDINATES","features","getSelected","toGeoJSON","fireActionable","state","setActionableState","combineFeatures","uncombineFeatures","trash","selectedCoordPaths","length","startDragging","dragPan","disable","canDragMove","dragMoveLocation","lngLat","stopDragging","enable","dragMoving","onVertex","about","featureTarget","properties","selectedIndex","indexOf","coord_path","isShiftDown","push","selectedCoordinates","pathsToCoordinates","featureId","setSelectedCoordinates","onMidpoint","feature","addCoordinate","lng","lat","paths","feature_id","onFeature","dragFeature","delta","moveFeatures","dragVertex","selectedCoords","getCoordinate","selectedCoordPoints","coords","type","geojsonTypes","FEATURE","geometry","POINT","coordinates","constrainedDelta","constrainFeatureMovement","coord","updateCoordinate","clickNoTarget","changeMode","modes","SIMPLE_SELECT","clickInactive","clickActiveFeature","clearSelectedCoordinates","changed","onSetup","opts","getFeature","Error","TypeError","startPos","coordPath","setSelected","doubleClickZoom","onStop","toDisplayFeatures","geojson","id","active","activeStates","ACTIVE","createSupplementaryPoints","midpoints","selectedPaths","forEach","INACTIVE","onTrash","sort","a","b","localeCompare","numeric","removeCoordinate","isValid","deleteFeature","onMouseMove","isFeature","isActiveFeature","isMidPoint","noCoords","updateUIClasses","mouse","cursors","MOVE","NONE","isDraggableItem","onMouseOut","onTouchStart","onMouseDown","onDrag","originalEvent","stopPropagation","onClick","noTarget","isInactiveFeature","onTap","onTouchEnd","onMouseUp","_default","exports"],"sources":["../../../../src/meta-atlas-sdk/mapbox_draw_custom_modes/marker_select.js"],"sourcesContent":["import {noTarget, isOfMetaType, isActiveFeature, isInactiveFeature, isShiftDown} from '@mapbox/mapbox-gl-draw/src/lib/common_selectors';\nimport createSupplementaryPoints from '@mapbox/mapbox-gl-draw/src/lib/create_supplementary_points';\nimport constrainFeatureMovement from '@mapbox/mapbox-gl-draw/src/lib/constrain_feature_movement';\nimport doubleClickZoom from '@mapbox/mapbox-gl-draw/src/lib/double_click_zoom';\nimport * as Constants from '@mapbox/mapbox-gl-draw/src/constants';\nimport moveFeatures from '@mapbox/mapbox-gl-draw/src/lib/move_features';\n\nconst isVertex = isOfMetaType(Constants.meta.VERTEX);\nconst isMidpoint = isOfMetaType(Constants.meta.MIDPOINT);\n\nconst MarkerSelect = {};\n\n// INTERNAL FUCNTIONS\n\nMarkerSelect.fireUpdate = function() {\n this.map.fire(Constants.events.UPDATE, {\n action: Constants.updateActions.CHANGE_COORDINATES,\n features: this.getSelected().map(f => f.toGeoJSON())\n });\n};\n\nMarkerSelect.fireActionable = function(state) {\n this.setActionableState({\n combineFeatures: false,\n uncombineFeatures: false,\n trash: state.selectedCoordPaths.length > 0\n });\n};\n\nMarkerSelect.startDragging = function(state, e) {\n this.map.dragPan.disable();\n state.canDragMove = true;\n state.dragMoveLocation = e.lngLat;\n};\n\nMarkerSelect.stopDragging = function(state) {\n this.map.dragPan.enable();\n state.dragMoving = false;\n state.canDragMove = false;\n state.dragMoveLocation = null;\n};\n\nMarkerSelect.onVertex = function (state, e) {\n this.startDragging(state, e);\n const about = e.featureTarget.properties;\n const selectedIndex = state.selectedCoordPaths.indexOf(about.coord_path);\n if (!isShiftDown(e) && selectedIndex === -1) {\n state.selectedCoordPaths = [about.coord_path];\n } else if (isShiftDown(e) && selectedIndex === -1) {\n state.selectedCoordPaths.push(about.coord_path);\n }\n\n const selectedCoordinates = this.pathsToCoordinates(state.featureId, state.selectedCoordPaths);\n this.setSelectedCoordinates(selectedCoordinates);\n};\n\nMarkerSelect.onMidpoint = function(state, e) {\n this.startDragging(state, e);\n const about = e.featureTarget.properties;\n state.feature.addCoordinate(about.coord_path, about.lng, about.lat);\n this.fireUpdate();\n state.selectedCoordPaths = [about.coord_path];\n};\n\nMarkerSelect.pathsToCoordinates = function(featureId, paths) {\n return paths.map(coord_path => ({ feature_id: featureId, coord_path }));\n};\n\nMarkerSelect.onFeature = function(state, e) {\n if (state.selectedCoordPaths.length === 0) this.startDragging(state, e);\n else this.stopDragging(state);\n};\n\nMarkerSelect.dragFeature = function(state, e, delta) {\n moveFeatures(this.getSelected(), delta);\n state.dragMoveLocation = e.lngLat;\n};\n\nMarkerSelect.dragVertex = function(state, e, delta) {\n const selectedCoords = state.selectedCoordPaths.map(coord_path => state.feature.getCoordinate(coord_path));\n const selectedCoordPoints = selectedCoords.map(coords => ({\n type: Constants.geojsonTypes.FEATURE,\n properties: {},\n geometry: {\n type: Constants.geojsonTypes.POINT,\n coordinates: coords\n }\n }));\n\n const constrainedDelta = constrainFeatureMovement(selectedCoordPoints, delta);\n for (let i = 0; i < selectedCoords.length; i++) {\n const coord = selectedCoords[i];\n state.feature.updateCoordinate(state.selectedCoordPaths[i], coord[0] + constrainedDelta.lng, coord[1] + constrainedDelta.lat);\n }\n};\n\nMarkerSelect.clickNoTarget = function () {\n this.changeMode(Constants.modes.SIMPLE_SELECT);\n};\n\nMarkerSelect.clickInactive = function () {\n this.changeMode(Constants.modes.SIMPLE_SELECT);\n};\n\nMarkerSelect.clickActiveFeature = function (state) {\n state.selectedCoordPaths = [];\n this.clearSelectedCoordinates();\n state.feature.changed();\n};\n\n// EXTERNAL FUNCTIONS\n\nMarkerSelect.onSetup = function(opts) {\n const featureId = opts.featureId;\n const feature = this.getFeature(featureId);\n\n if (!feature) {\n throw new Error('You must provide a featureId to enter direct_select mode');\n }\n\n if (feature.type === Constants.geojsonTypes.POINT) {\n throw new TypeError('direct_select mode doesn\\'t handle point features');\n }\n\n const state = {\n featureId,\n feature,\n dragMoveLocation: opts.startPos || null,\n dragMoving: false,\n canDragMove: false,\n selectedCoordPaths: opts.coordPath ? [opts.coordPath] : []\n };\n\n this.setSelectedCoordinates(this.pathsToCoordinates(featureId, state.selectedCoordPaths));\n this.setSelected(featureId);\n doubleClickZoom.disable(this);\n\n this.setActionableState({\n trash: true\n });\n\n return state;\n};\n\nMarkerSelect.onStop = function() {\n doubleClickZoom.enable(this);\n this.clearSelectedCoordinates();\n};\n\nMarkerSelect.toDisplayFeatures = function(state, geojson, push) {\n if (state.featureId === geojson.properties.id) {\n geojson.properties.active = Constants.activeStates.ACTIVE;\n push(geojson);\n createSupplementaryPoints(geojson, {\n map: this.map,\n midpoints: true,\n selectedPaths: state.selectedCoordPaths\n }).forEach(push);\n } else {\n geojson.properties.active = Constants.activeStates.INACTIVE;\n push(geojson);\n }\n this.fireActionable(state);\n};\n\nMarkerSelect.onTrash = function(state) {\n // Uses number-aware sorting to make sure '9' < '10'. Comparison is reversed because we want them\n // in reverse order so that we can remove by index safely.\n state.selectedCoordPaths\n .sort((a, b) => b.localeCompare(a, 'en', { numeric: true }))\n .forEach(id => state.feature.removeCoordinate(id));\n this.fireUpdate();\n state.selectedCoordPaths = [];\n this.clearSelectedCoordinates();\n this.fireActionable(state);\n if (state.feature.isValid() === false) {\n this.deleteFeature([state.featureId]);\n this.changeMode(Constants.modes.SIMPLE_SELECT, {});\n }\n};\n\nMarkerSelect.onMouseMove = function(state, e) {\n // On mousemove that is not a drag, stop vertex movement.\n const isFeature = isActiveFeature(e);\n const onVertex = isVertex(e);\n const isMidPoint = isMidpoint(e);\n const noCoords = state.selectedCoordPaths.length === 0;\n if (isFeature && noCoords) this.updateUIClasses({ mouse: Constants.cursors.MOVE });\n else if (onVertex && !noCoords) this.updateUIClasses({ mouse: Constants.cursors.MOVE });\n else this.updateUIClasses({ mouse: Constants.cursors.NONE });\n\n const isDraggableItem = onVertex || isFeature || isMidPoint;\n if (isDraggableItem && state.dragMoving) this.fireUpdate();\n\n this.stopDragging(state);\n\n // Skip render\n return true;\n};\n\nMarkerSelect.onMouseOut = function(state) {\n // As soon as you mouse leaves the canvas, update the feature\n if (state.dragMoving) this.fireUpdate();\n\n // Skip render\n return true;\n};\n\nMarkerSelect.onTouchStart = MarkerSelect.onMouseDown = function(state, e) {\n if (isVertex(e)) return this.onVertex(state, e);\n if (isActiveFeature(e)) return this.onFeature(state, e);\n if (isMidpoint(e)) return this.onMidpoint(state, e);\n};\n\nMarkerSelect.onDrag = function(state, e) {\n if (state.canDragMove !== true) return;\n state.dragMoving = true;\n e.originalEvent.stopPropagation();\n\n const delta = {\n lng: e.lngLat.lng - state.dragMoveLocation.lng,\n lat: e.lngLat.lat - state.dragMoveLocation.lat\n };\n \n // always drag feature, never drag vertex\n this.dragFeature(state, e, delta);\n\n state.dragMoveLocation = e.lngLat;\n};\n\nMarkerSelect.onClick = function(state, e) {\n if (noTarget(e)) return this.clickNoTarget(state, e);\n if (isActiveFeature(e)) return this.clickActiveFeature(state, e);\n if (isInactiveFeature(e)) return this.clickInactive(state, e);\n this.stopDragging(state);\n};\n\nMarkerSelect.onTap = function(state, e) {\n if (noTarget(e)) return this.clickNoTarget(state, e);\n if (isActiveFeature(e)) return this.clickActiveFeature(state, e);\n if (isInactiveFeature(e)) return this.clickInactive(state, e);\n};\n\nMarkerSelect.onTouchEnd = MarkerSelect.onMouseUp = function(state) {\n if (state.dragMoving) {\n this.fireUpdate();\n }\n this.stopDragging(state);\n};\n\nexport default MarkerSelect;\n"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,4BAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,2BAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,kBAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,SAAA,GAAAC,uBAAA,CAAAN,OAAA;AACA,IAAAO,cAAA,GAAAL,sBAAA,CAAAF,OAAA;AAAwE,SAAAM,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,CAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IA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