@ohuoy/easymap 1.0.19 → 1.0.21

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.
Files changed (57) hide show
  1. package/dist/bundle.js +318 -290
  2. package/dist/example - /345/211/257/346/234/254/bundle.js" +318 -290
  3. package/dist/example - /345/211/257/346/234/254/index.html" +11 -11
  4. package/index.js +4 -0
  5. package/lib/threebox-plugin/CHANGELOG.md +665 -0
  6. package/lib/threebox-plugin/LICENSE.txt +97 -0
  7. package/lib/threebox-plugin/README.md +199 -0
  8. package/lib/threebox-plugin/exports.js +2 -0
  9. package/lib/threebox-plugin/main.js +8 -0
  10. package/lib/threebox-plugin/package.json +44 -0
  11. package/lib/threebox-plugin/server.stop.js +13 -0
  12. package/lib/threebox-plugin/src/Threebox.js +1216 -0
  13. package/lib/threebox-plugin/src/animation/AnimationManager.js +483 -0
  14. package/lib/threebox-plugin/src/camera/CameraSync.js +302 -0
  15. package/lib/threebox-plugin/src/objects/CSS2DRenderer.js +245 -0
  16. package/lib/threebox-plugin/src/objects/LabelRenderer.js +71 -0
  17. package/lib/threebox-plugin/src/objects/Object3D.js +34 -0
  18. package/lib/threebox-plugin/src/objects/effects/BuildingShadows.js +115 -0
  19. package/lib/threebox-plugin/src/objects/extrusion.js +61 -0
  20. package/lib/threebox-plugin/src/objects/fflate.min.js +15 -0
  21. package/lib/threebox-plugin/src/objects/label.js +29 -0
  22. package/lib/threebox-plugin/src/objects/line.js +1386 -0
  23. package/lib/threebox-plugin/src/objects/loadObj.js +142 -0
  24. package/lib/threebox-plugin/src/objects/loaders/ColladaLoader.js +3751 -0
  25. package/lib/threebox-plugin/src/objects/loaders/FBXLoader.js +3864 -0
  26. package/lib/threebox-plugin/src/objects/loaders/GLTFLoader.js +3857 -0
  27. package/lib/threebox-plugin/src/objects/loaders/MTLLoader.js +498 -0
  28. package/lib/threebox-plugin/src/objects/loaders/OBJLoader.js +818 -0
  29. package/lib/threebox-plugin/src/objects/objects.js +1113 -0
  30. package/lib/threebox-plugin/src/objects/sphere.js +28 -0
  31. package/lib/threebox-plugin/src/objects/tooltip.js +27 -0
  32. package/lib/threebox-plugin/src/objects/tube.js +35 -0
  33. package/lib/threebox-plugin/src/three.js +6 -0
  34. package/lib/threebox-plugin/src/three.module.js +54571 -0
  35. package/lib/threebox-plugin/src/utils/ValueGenerator.js +11 -0
  36. package/lib/threebox-plugin/src/utils/constants.js +21 -0
  37. package/lib/threebox-plugin/src/utils/material.js +52 -0
  38. package/lib/threebox-plugin/src/utils/suncalc.js +322 -0
  39. package/lib/threebox-plugin/src/utils/utils.js +424 -0
  40. package/lib/threebox-plugin/src/utils/validate.js +115 -0
  41. package/package.json +18 -18
  42. package/src/components/EasyMapMarker.js +8 -0
  43. package/src/components/control/DrawBar.js +5 -0
  44. package/src/components/control/TilesBar.js +116 -27
  45. package/src/components/control/Toobars.js +20 -1
  46. package/src/components/layer/AlarmLayer.js +4 -1
  47. package/src/components/layer/AnimationBarbsLayer.js +1 -1
  48. package/src/components/layer/AnimationLayer copy.js +1 -1
  49. package/src/components/layer/AnimationLayer.js +11 -3
  50. package/src/components/layer/CustomIconLayer.js +1 -1
  51. package/src/components/layer/ExtrusionLayer.js +1 -1
  52. package/src/components/layer/ExtrusionLayerold.js +2 -1
  53. package/src/components/layer/MarkerAreaLayer.js +1 -1
  54. package/src/components/layer/PathLineLayer.js +1 -1
  55. package/src/components/layer/ThreeScanLayer.js +51 -14
  56. package/src/components/layer/ThreeWallLayer.js +1 -1
  57. package/webpack.config.js +2 -1
@@ -0,0 +1,424 @@
1
+ //var THREE = require("../three.js");
2
+ import * as THREE from '../three.module.js'
3
+ import Constants from './constants.js'
4
+ import validate from './validate.js'
5
+ //var Constants = require("./constants.js");
6
+ //var validate = require("./validate.js");
7
+
8
+ var utils = {
9
+
10
+ prettyPrintMatrix: function (uglymatrix) {
11
+ for (var s = 0; s < 4; s++) {
12
+ var quartet = [uglymatrix[s],
13
+ uglymatrix[s + 4],
14
+ uglymatrix[s + 8],
15
+ uglymatrix[s + 12]];
16
+ console.log(quartet.map(function (num) { return num.toFixed(4) }))
17
+ }
18
+ },
19
+
20
+ makePerspectiveMatrix: function (fovy, aspect, near, far) {
21
+
22
+ var out = new THREE.Matrix4();
23
+ var f = 1.0 / Math.tan(fovy / 2),
24
+ nf = 1 / (near - far);
25
+
26
+ var newMatrix = [
27
+ f / aspect, 0, 0, 0,
28
+ 0, f, 0, 0,
29
+ 0, 0, (far + near) * nf, -1,
30
+ 0, 0, (2 * far * near) * nf, 0
31
+ ]
32
+
33
+ out.elements = newMatrix
34
+ return out;
35
+ },
36
+
37
+ //[jscastro] new orthographic matrix calculations https://en.wikipedia.org/wiki/Orthographic_projection and validated with https://bit.ly/3rPvB9Y
38
+ makeOrthographicMatrix: function (left, right, top, bottom, near, far) {
39
+ var out = new THREE.Matrix4();
40
+
41
+ const w = 1.0 / (right - left);
42
+ const h = 1.0 / (top - bottom);
43
+ const p = 1.0 / (far - near);
44
+
45
+ const x = (right + left) * w;
46
+ const y = (top + bottom) * h;
47
+ const z = near * p;
48
+
49
+ var newMatrix = [
50
+ 2 * w, 0, 0, 0,
51
+ 0, 2 * h, 0, 0,
52
+ 0, 0, - 1 * p, 0,
53
+ - x, -y, -z, 1
54
+ ]
55
+
56
+ out.elements = newMatrix
57
+ return out;
58
+ },
59
+
60
+ //gimme radians
61
+ radify: function (deg) {
62
+
63
+ function convert(degrees) {
64
+ degrees = degrees || 0;
65
+ return Math.PI * 2 * degrees / 360
66
+ }
67
+
68
+ if (typeof deg === 'object') {
69
+
70
+ //if [x,y,z] array of rotations
71
+ if (deg.length > 0) {
72
+ return deg.map(function (degree) {
73
+ return convert(degree)
74
+ })
75
+ }
76
+
77
+ // if {x: y: z:} rotation object
78
+ else {
79
+ return [convert(deg.x), convert(deg.y), convert(deg.z)]
80
+ }
81
+ }
82
+
83
+ //if just a number
84
+ else return convert(deg)
85
+ },
86
+
87
+ //gimme degrees
88
+ degreeify: function (rad) {
89
+ function convert(radians) {
90
+ radians = radians || 0;
91
+ return radians * 360 / (Math.PI * 2)
92
+ }
93
+
94
+ if (typeof rad === 'object') {
95
+ return [convert(rad.x), convert(rad.y), convert(rad.z)]
96
+ }
97
+
98
+ else return convert(rad)
99
+ },
100
+
101
+ projectToWorld: function (coords) {
102
+
103
+ // Spherical mercator forward projection, re-scaling to WORLD_SIZE
104
+
105
+ var projected = [
106
+ -Constants.MERCATOR_A * Constants.DEG2RAD * coords[0] * Constants.PROJECTION_WORLD_SIZE,
107
+ -Constants.MERCATOR_A * Math.log(Math.tan((Math.PI * 0.25) + (0.5 * Constants.DEG2RAD * coords[1]))) * Constants.PROJECTION_WORLD_SIZE
108
+ ];
109
+
110
+ //z dimension, defaulting to 0 if not provided
111
+
112
+ if (!coords[2]) projected.push(0)
113
+ else {
114
+ var pixelsPerMeter = this.projectedUnitsPerMeter(coords[1]);
115
+ projected.push(coords[2] * pixelsPerMeter);
116
+ }
117
+
118
+ var result = new THREE.Vector3(projected[0], projected[1], projected[2]);
119
+
120
+ return result;
121
+ },
122
+
123
+ projectedUnitsPerMeter: function (latitude) {
124
+ return Math.abs(Constants.WORLD_SIZE / Math.cos(Constants.DEG2RAD * latitude) / Constants.EARTH_CIRCUMFERENCE);
125
+ },
126
+
127
+ _circumferenceAtLatitude: function (latitude) {
128
+ return Constants.EARTH_CIRCUMFERENCE * Math.cos(latitude * Math.PI / 180);
129
+ },
130
+
131
+ mercatorZfromAltitude: function (altitude, lat) {
132
+ return altitude / this._circumferenceAtLatitude(lat);
133
+ },
134
+
135
+ _scaleVerticesToMeters: function (centerLatLng, vertices) {
136
+ var pixelsPerMeter = this.projectedUnitsPerMeter(centerLatLng[1]);
137
+ var centerProjected = this.projectToWorld(centerLatLng);
138
+
139
+ for (var i = 0; i < vertices.length; i++) {
140
+ vertices[i].multiplyScalar(pixelsPerMeter);
141
+ }
142
+
143
+ return vertices;
144
+ },
145
+
146
+ projectToScreen: function (coords) {
147
+ console.log("WARNING: Projecting to screen coordinates is not yet implemented");
148
+ },
149
+
150
+ unprojectFromScreen: function (pixel) {
151
+ console.log("WARNING: unproject is not yet implemented");
152
+ },
153
+
154
+ //world units to lnglat
155
+ unprojectFromWorld: function (worldUnits) {
156
+
157
+ var unprojected = [
158
+ -worldUnits.x / (Constants.MERCATOR_A * Constants.DEG2RAD * Constants.PROJECTION_WORLD_SIZE),
159
+ 2 * (Math.atan(Math.exp(worldUnits.y / (Constants.PROJECTION_WORLD_SIZE * (-Constants.MERCATOR_A)))) - Math.PI / 4) / Constants.DEG2RAD
160
+ ];
161
+
162
+ var pixelsPerMeter = this.projectedUnitsPerMeter(unprojected[1]);
163
+
164
+ //z dimension
165
+ var height = worldUnits.z || 0;
166
+ unprojected.push(height / pixelsPerMeter);
167
+
168
+ return unprojected;
169
+ },
170
+
171
+ toScreenPosition: function (obj, camera) {
172
+ var vector = new THREE.Vector3();
173
+
174
+ var widthHalf = 0.5 * renderer.context.canvas.width;
175
+ var heightHalf = 0.5 * renderer.context.canvas.height;
176
+
177
+ obj.updateMatrixWorld();
178
+ vector.setFromMatrixPosition(obj.matrixWorld);
179
+ vector.project(camera);
180
+
181
+ vector.x = (vector.x * widthHalf) + widthHalf;
182
+ vector.y = - (vector.y * heightHalf) + heightHalf;
183
+
184
+ return {
185
+ x: vector.x,
186
+ y: vector.y
187
+ };
188
+
189
+ },
190
+
191
+ //get the center point of a feature
192
+ getFeatureCenter: function getFeatureCenter(feature, model, level) {
193
+ let center = [];
194
+ let latitude = 0;
195
+ let longitude = 0;
196
+ let height = 0;
197
+ //deep copy to avoid modifying the original array
198
+ let coordinates = [...feature.geometry.coordinates[0]];
199
+ if (feature.geometry.type === "Point") {
200
+ center = [...coordinates[0]];//deep copy
201
+ }
202
+ else {
203
+ //features in mapbox repeat the first coordinates at the end. We remove it.
204
+ if (feature.geometry.type === "MultiPolygon") coordinates = coordinates[0];
205
+ coordinates.splice(-1, 1);
206
+ coordinates.forEach(function (c) {
207
+ latitude += c[0];
208
+ longitude += c[1];
209
+ });
210
+ center = [latitude / coordinates.length, longitude / coordinates.length];
211
+ }
212
+ height = this.getObjectHeightOnFloor(feature, model, level);
213
+
214
+ (center.length < 3 ? center.push(height) : center[2] = height);
215
+
216
+ return center;
217
+ },
218
+
219
+ getObjectHeightOnFloor: function (feature, obj, level = feature.properties.level || 0) {
220
+ let floorHeightMin = (level * (feature.properties.levelHeight || 0));
221
+ //object height is modelSize.z + base_height or min_height configured for this object
222
+ let base = (feature.properties.base_height || feature.properties.min_height || 0);
223
+ //let height = ((obj && obj.model) ? obj.modelSize.z : (feature.properties.height - base));
224
+ let height = ((obj && obj.model) ? 0 : (feature.properties.height - base));
225
+ let objectHeight = height + base;
226
+ let modelHeightFloor = floorHeightMin + objectHeight;
227
+ return modelHeightFloor;
228
+ },
229
+
230
+ _flipMaterialSides: function (obj) {
231
+
232
+ },
233
+
234
+ // to improve precision, normalize a series of vector3's to their collective center, and move the resultant mesh to that center
235
+ normalizeVertices(vertices) {
236
+
237
+ let geometry = new THREE.BufferGeometry();
238
+ let positions = [];
239
+
240
+ for (var j = 0; j < vertices.length; j++) {
241
+ let p = vertices[j];
242
+ positions.push(p.x, p.y, p.z);
243
+ positions.push(p.x, p.y, p.z);
244
+ }
245
+ geometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array(positions), 3));
246
+ geometry.computeBoundingSphere();
247
+ var center = geometry.boundingSphere.center;
248
+
249
+ var scaled = vertices.map(function (v3) {
250
+ var normalized = v3.sub(center);
251
+ return normalized;
252
+ });
253
+
254
+ return { vertices: scaled, position: center }
255
+ },
256
+
257
+ //flatten an array of Vector3's into a shallow array of values in x-y-z order, for bufferGeometry
258
+ flattenVectors(vectors) {
259
+ var flattenedArray = [];
260
+ for (let vertex of vectors) {
261
+ flattenedArray.push(vertex.x, vertex.y, vertex.z);
262
+ }
263
+ return flattenedArray
264
+ },
265
+
266
+ //convert a line/polygon to Vector3's
267
+
268
+ lnglatsToWorld: function (coords) {
269
+
270
+ var vector3 = coords.map(
271
+ function (pt) {
272
+ var p = utils.projectToWorld(pt);
273
+ var v3 = new THREE.Vector3(p.x, p.y, p.z);
274
+ return v3
275
+ }
276
+ );
277
+
278
+ return vector3
279
+ },
280
+
281
+ extend: function (original, addition) {
282
+ for (let key in addition) original[key] = addition[key];
283
+ },
284
+
285
+ clone: function (original) {
286
+ var clone = {};
287
+ for (let key in original) clone[key] = original[key];
288
+ return clone;
289
+ },
290
+
291
+ clamp: function(n, min, max) {
292
+ return Math.min(max, Math.max(min, n));
293
+ },
294
+
295
+ // retrieve object parameters from an options object
296
+ types: {
297
+
298
+ rotation: function (r, currentRotation) {
299
+
300
+ //[jscastro] rotation default 0
301
+ if (!r) { r = 0; };
302
+
303
+ // if number provided, rotate only in Z by that amount
304
+ if (typeof r === 'number') r = { z: r };
305
+
306
+ var degrees = this.applyDefault([r.x, r.y, r.z], currentRotation);
307
+ var radians = utils.radify(degrees);
308
+ return radians;
309
+
310
+ },
311
+
312
+ scale: function (s, currentScale) {
313
+ //[jscastro] scale default 1
314
+ if (!s) { s = 1; };
315
+ if (typeof s === 'number') return s = [s, s, s];
316
+ else return this.applyDefault([s.x, s.y, s.z], currentScale);
317
+ },
318
+
319
+ applyDefault: function (array, current) {
320
+
321
+ var output = array.map(function (item, index) {
322
+ item = item || current[index];
323
+ return item
324
+ })
325
+
326
+ return output
327
+ },
328
+
329
+ },
330
+
331
+ toDecimal: function (n, d) {
332
+ return Number(n.toFixed(d));
333
+ },
334
+
335
+ equal: function (obj1, obj2) {
336
+ const keys1 = Object.keys(obj1);
337
+ const keys2 = Object.keys(obj2);
338
+
339
+ if (keys1.length !== keys2.length) {
340
+ return false;
341
+ }
342
+ if (keys1.length == 0 && keys2.length == 0 && keys1 !== keys2) {
343
+ return false;
344
+ }
345
+
346
+ for (const key of keys1) {
347
+ const val1 = obj1[key];
348
+ const val2 = obj2[key];
349
+ const areObjects = this.isObject(val1) && this.isObject(val2);
350
+ if (
351
+ areObjects && !equal(val1, val2) ||
352
+ !areObjects && val1 !== val2
353
+ ) {
354
+ return false;
355
+ }
356
+ }
357
+
358
+ return true;
359
+ },
360
+
361
+ isObject: function (object) {
362
+ return object != null && typeof object === 'object';
363
+ },
364
+
365
+ curveToLine: (curve, params) => {
366
+ let { width, color } = params;
367
+ let geometry = new THREE.BufferGeometry().setFromPoints(
368
+ curve.getPoints(100)
369
+ );
370
+
371
+ let material = new THREE.LineBasicMaterial({
372
+ color: color,
373
+ linewidth: width,
374
+ });
375
+
376
+ let line = new THREE.Line(geometry, material);
377
+
378
+ return line;
379
+ },
380
+
381
+ curvesToLines: (curves) => {
382
+ var colors = [0xff0000, 0x1eff00, 0x2600ff];
383
+ var lines = curves.map((curve, i) => {
384
+ let params = {
385
+ width: 3,
386
+ color: colors[i] || 'purple',
387
+ };
388
+ let curveline = curveToLine(curve, params);
389
+
390
+ return curveline;
391
+ });
392
+ return lines;
393
+ },
394
+
395
+ _validate: function (userInputs, defaults) {
396
+
397
+ userInputs = userInputs || {};
398
+ var validatedOutput = {};
399
+ utils.extend(validatedOutput, userInputs);
400
+
401
+ for (let key of Object.keys(defaults)) {
402
+
403
+ if (userInputs[key] === undefined) {
404
+ //make sure required params are present
405
+ if (defaults[key] === null) {
406
+ console.error(key + ' is required')
407
+ return;
408
+ }
409
+
410
+ else validatedOutput[key] = defaults[key]
411
+
412
+ }
413
+
414
+ else validatedOutput[key] = userInputs[key]
415
+ }
416
+
417
+ return validatedOutput
418
+ },
419
+ Validator: new validate(),
420
+ exposedMethods: ['projectToWorld', 'projectedUnitsPerMeter', 'extend', 'unprojectFromWorld']
421
+ }
422
+ export default utils;
423
+
424
+ //module.exports = exports = utils
@@ -0,0 +1,115 @@
1
+ // Type validator
2
+
3
+ function Validate(){
4
+
5
+ };
6
+
7
+ Validate.prototype = {
8
+
9
+ Coords: function(input) {
10
+
11
+ if (input.constructor !== Array) {
12
+ console.error("Coords must be an array")
13
+ return
14
+ }
15
+
16
+ if (input.length < 2) {
17
+ console.error("Coords length must be at least 2")
18
+ return
19
+ }
20
+
21
+ for (const member of input) {
22
+ if (member.constructor !== Number) {
23
+ console.error("Coords values must be numbers")
24
+ return
25
+ }
26
+ }
27
+
28
+ if (Math.abs(input[1]) > 90) {
29
+ console.error("Latitude must be between -90 and 90")
30
+ return
31
+ }
32
+
33
+ return input
34
+ },
35
+
36
+ Line: function(input) {
37
+
38
+ var scope = this;
39
+
40
+ if (input.constructor !== Array) {
41
+ console.error("Line must be an array")
42
+ return
43
+ }
44
+
45
+ for (const coord of input){
46
+ if (!scope.Coords(coord)) {
47
+ console.error("Each coordinate in a line must be a valid Coords type")
48
+ return
49
+ }
50
+
51
+ }
52
+
53
+ return input
54
+ },
55
+
56
+ Rotation: function(input) {
57
+
58
+ if (input.constructor === Number) input = {z: input}
59
+
60
+ else if (input.constructor === Object) {
61
+
62
+ for (const key of Object.keys(input)){
63
+
64
+ if (!['x', 'y', 'z'].includes(key)) {
65
+ console.error('Rotation parameters must be x, y, or z')
66
+ return
67
+ }
68
+ if (input[key].constructor !== Number) {
69
+ console.error('Individual rotation values must be numbers')
70
+ return
71
+ }
72
+ }
73
+ }
74
+
75
+ else {
76
+ console.error('Rotation must be an object or a number')
77
+ return
78
+ }
79
+
80
+ return input
81
+ },
82
+
83
+ Scale: function(input) {
84
+
85
+ if (input.constructor === Number) {
86
+ input = {x:input, y:input, z: input}
87
+ }
88
+
89
+ else if (input.constructor === Object) {
90
+
91
+ for (const key of Object.keys(input)){
92
+
93
+ if (!['x', 'y', 'z'].includes(key)) {
94
+ console.error('Scale parameters must be x, y, or z')
95
+ return
96
+ }
97
+ if (input[key].constructor !== Number) {
98
+ console.error('Individual scale values must be numbers')
99
+ return
100
+ }
101
+ }
102
+ }
103
+
104
+ else {
105
+ console.error('Scale must be an object or a number')
106
+ return
107
+ }
108
+
109
+ return input
110
+ }
111
+
112
+ }
113
+
114
+ export default Validate
115
+ //module.exports = exports = Validate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ohuoy/easymap",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "self map easy use",
5
5
  "main": "main.js",
6
6
  "scripts": {
@@ -10,40 +10,40 @@
10
10
  "author": "weichong song",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
+ "@amap/amap-jsapi-loader": "^1.0.1",
13
14
  "@antv/l7": "file:lib/@antv/l7",
15
+ "@babel/runtime": "^7.7.7",
14
16
  "@mapbox/mapbox-gl-draw": "^1.5.0",
15
17
  "@mdi/js": "^7.4.47",
16
18
  "@turf/turf": "^6.5.0",
19
+ "d3-dsv": "^1.1.1",
20
+ "d3-hexbin": "^0.2.2",
21
+ "d3-scale": "^2",
22
+ "element-resize-detector": "^1.2.4",
23
+ "eventemitter3": "^4.0.0",
17
24
  "gcoord": "^1.0.6",
18
25
  "gif.js": "^0.2.0",
26
+ "hammerjs": "^2.0.8",
19
27
  "jszip": "^3.10.1",
20
28
  "mapbox-gl": "file:lib/mapbox-gl",
29
+ "regl": "1.6.1",
21
30
  "three": "^0.170.0",
22
31
  "threebox-plugin": "^2.2.7",
23
- "@babel/runtime": "^7.7.7",
24
- "eventemitter3": "^4.0.0",
25
- "viewport-mercator-project": "^6.2.1",
26
- "hammerjs": "^2.0.8",
27
- "@amap/amap-jsapi-loader": "^1.0.1",
28
- "d3-dsv": "^1.1.1",
29
- "element-resize-detector": "^1.2.4",
30
- "d3-hexbin": "^0.2.2",
31
- "d3-scale": "^2",
32
- "regl": "1.6.1"
32
+ "viewport-mercator-project": "^6.2.1"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@babel/core": "^7.24.7",
36
- "@types/d3-dsv": "^1.0.36",
37
36
  "@babel/preset-env": "^7.24.7",
37
+ "@types/d3-dsv": "^1.0.36",
38
+ "@types/d3-hexbin": "^0.2.3",
39
+ "@types/d3-scale": "^2.1.1",
40
+ "@types/element-resize-detector": "^1.1.6",
41
+ "@types/hammerjs": "^2.0.36",
42
+ "@types/viewport-mercator-project": "^6.1.0",
38
43
  "babel-loader": "^9.1.3",
39
44
  "css-loader": "^7.1.2",
40
45
  "style-loader": "^4.0.0",
41
46
  "webpack": "^5.91.0",
42
- "webpack-cli": "^5.1.4",
43
- "@types/viewport-mercator-project": "^6.1.0",
44
- "@types/hammerjs": "^2.0.36",
45
- "@types/element-resize-detector": "^1.1.6",
46
- "@types/d3-hexbin": "^0.2.3",
47
- "@types/d3-scale": "^2.1.1"
47
+ "webpack-cli": "^5.1.4"
48
48
  }
49
49
  }
@@ -54,6 +54,14 @@ export default class EasyMapMarker{
54
54
  throw new Error('no config')
55
55
  }
56
56
  }
57
+
58
+ setMarkerPopup(popup,_marker){
59
+ _marker = _marker ? _marker : this.marker
60
+ if(_marker){
61
+ _marker.setPopup(popup)
62
+ }
63
+ }
64
+
57
65
  moveTo(location,zoom = 12.5){
58
66
  let _location = transform(location)
59
67
  this.marker.setLngLat(_location)
@@ -132,4 +132,9 @@ export default class DrawBar {
132
132
  }
133
133
  }
134
134
  }
135
+
136
+ onRemove() {
137
+ this.drawEntity = null
138
+ this.drawing = false;
139
+ }
135
140
  }