@mint-ui/map 0.4.4-beta → 0.4.6-beta

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 (65) hide show
  1. package/.eslintrc.js +109 -109
  2. package/LICENSE +21 -21
  3. package/README.md +73 -73
  4. package/dist/components/mint-map/MintMap.d.ts +10 -117
  5. package/dist/components/mint-map/MintMap.js +24 -421
  6. package/dist/components/mint-map/core/MintMapCanvasRenderer.d.ts +4 -4
  7. package/dist/components/mint-map/core/MintMapCanvasRenderer.js +3 -1
  8. package/dist/components/mint-map/core/MintMapController.d.ts +58 -44
  9. package/dist/components/mint-map/core/MintMapController.js +49 -15
  10. package/dist/components/mint-map/core/MintMapCore.d.ts +3 -3
  11. package/dist/components/mint-map/core/MintMapCore.js +22 -10
  12. package/dist/components/mint-map/core/advanced/MapBuildingProjection.d.ts +15 -15
  13. package/dist/components/mint-map/core/advanced/MapBuildingProjection.js +11 -7
  14. package/dist/components/mint-map/core/advanced/MapLoadingComponents.d.ts +17 -0
  15. package/dist/components/mint-map/core/advanced/MapLoadingComponents.js +257 -0
  16. package/dist/components/mint-map/core/advanced/index.d.ts +2 -1
  17. package/dist/components/mint-map/core/hooks/MarkerMovingHook.d.ts +6 -6
  18. package/dist/components/mint-map/core/hooks/MarkerMovingHook.js +17 -8
  19. package/dist/components/mint-map/core/hooks/index.d.ts +1 -1
  20. package/dist/components/mint-map/core/index.d.ts +8 -8
  21. package/dist/components/mint-map/core/provider/MintMapProvider.d.ts +8 -8
  22. package/dist/components/mint-map/core/provider/index.d.ts +1 -1
  23. package/dist/components/mint-map/core/util/animation.d.ts +16 -16
  24. package/dist/components/mint-map/core/util/animation.js +14 -5
  25. package/dist/components/mint-map/core/util/calculate.d.ts +39 -34
  26. package/dist/components/mint-map/core/util/calculate.js +65 -26
  27. package/dist/components/mint-map/core/util/cluster.d.ts +18 -18
  28. package/dist/components/mint-map/core/util/cluster.js +14 -9
  29. package/dist/components/mint-map/core/util/index.d.ts +4 -4
  30. package/dist/components/mint-map/core/util/waiting.d.ts +1 -1
  31. package/dist/components/mint-map/core/util/waiting.js +6 -2
  32. package/dist/components/mint-map/core/wrapper/MapCanvasMarkerWrapper.d.ts +27 -19
  33. package/dist/components/mint-map/core/wrapper/MapCanvasMarkerWrapper.js +9 -0
  34. package/dist/components/mint-map/core/wrapper/MapCanvasWrapper.d.ts +11 -4
  35. package/dist/components/mint-map/core/wrapper/MapCanvasWrapper.js +107 -35
  36. package/dist/components/mint-map/core/wrapper/MapControlWrapper.d.ts +18 -11
  37. package/dist/components/mint-map/core/wrapper/MapControlWrapper.js +8 -0
  38. package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.d.ts +31 -23
  39. package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.js +54 -25
  40. package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.d.ts +12 -5
  41. package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.js +21 -6
  42. package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.d.ts +12 -5
  43. package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.js +21 -7
  44. package/dist/components/mint-map/core/wrapper/index.d.ts +6 -6
  45. package/dist/components/mint-map/google/GoogleMintMapController.d.ts +42 -39
  46. package/dist/components/mint-map/google/GoogleMintMapController.js +91 -45
  47. package/dist/components/mint-map/index.d.ts +5 -4
  48. package/dist/components/mint-map/kakao/KakaoMintMapController.d.ts +48 -44
  49. package/dist/components/mint-map/kakao/KakaoMintMapController.js +147 -65
  50. package/dist/components/mint-map/naver/NaverMintMapController.d.ts +45 -42
  51. package/dist/components/mint-map/naver/NaverMintMapController.js +136 -49
  52. package/dist/components/mint-map/types/CommonTypes.d.ts +11 -0
  53. package/dist/components/mint-map/types/MapDrawables.d.ts +110 -0
  54. package/dist/components/mint-map/types/MapDrawables.js +92 -0
  55. package/dist/components/mint-map/types/MapTypes.d.ts +59 -0
  56. package/dist/components/mint-map/types/MapTypes.js +151 -0
  57. package/dist/components/mint-map/types/MintMapEvents.d.ts +25 -0
  58. package/dist/components/mint-map/types/MintMapProps.d.ts +92 -0
  59. package/dist/components/mint-map/types/index.d.ts +5 -0
  60. package/dist/index.d.ts +7 -1
  61. package/dist/index.es.js +1506 -947
  62. package/dist/index.js +12 -9
  63. package/dist/index.umd.js +1506 -947
  64. package/package.json +77 -77
  65. package/test.ts +0 -7
@@ -8,7 +8,6 @@ var classNames = require('classnames/bind');
8
8
  var MintMap_module = require('./MintMap.module.scss.js');
9
9
  var MintMapCore = require('./core/MintMapCore.js');
10
10
  var MintMapProvider = require('./core/provider/MintMapProvider.js');
11
- var calculate = require('./core/util/calculate.js');
12
11
  var NaverMintMapController = require('./naver/NaverMintMapController.js');
13
12
  var GoogleMintMapController = require('./google/GoogleMintMapController.js');
14
13
  var KakaoMintMapController = require('./kakao/KakaoMintMapController.js');
@@ -18,181 +17,20 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
18
17
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
19
18
  var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
20
19
 
21
- var Position = function () {
22
- function Position(lat, lng) {
23
- this.lat = 0;
24
- this.lng = 0;
25
- this.lat = lat;
26
- this.lng = lng;
27
- }
20
+ var cn = classNames__default["default"].bind(MintMap_module); //지도 기본 센터
28
21
 
29
- Position.equals = function (pos1, pos2) {
30
- return pos1.lat === pos2.lat && pos1.lng === pos2.lng;
31
- };
32
-
33
- return Position;
34
- }();
35
-
36
- var Bounds = function () {
37
- function Bounds(nw, se, ne, sw) {
38
- if (!(nw && se || ne && sw)) {
39
- throw new Error('nw/se or ne/sw needed');
40
- }
41
-
42
- this.nw = nw;
43
- this.se = se;
44
- this.ne = ne;
45
- this.sw = sw;
46
-
47
- if (nw && se) {
48
- this.covertNWSEtoNESW(nw, se);
49
- } else if (ne && sw) {
50
- this.covertNESWtoNWSE(ne, sw);
51
- }
52
- }
53
-
54
- Bounds.fromNWSE = function (nw, se) {
55
- return new Bounds(nw, se, undefined, undefined);
56
- };
57
-
58
- Bounds.fromNESW = function (ne, sw) {
59
- return new Bounds(undefined, undefined, ne, sw);
60
- };
61
-
62
- Bounds.prototype.covertNWSEtoNESW = function (nw, se) {
63
- this.ne = new Position(nw.lat, se.lng);
64
- this.sw = new Position(se.lat, nw.lng);
65
- };
66
-
67
- Bounds.prototype.covertNESWtoNWSE = function (ne, sw) {
68
- this.nw = new Position(ne.lat, sw.lng);
69
- this.se = new Position(sw.lat, ne.lng);
70
- };
71
-
72
- Bounds.prototype.getCenter = function () {
73
- return new Position(this.se.lat + (this.nw.lat - this.se.lat) / 2, this.nw.lng + (this.se.lng - this.nw.lng) / 2);
74
- };
75
-
76
- Bounds.prototype.includesPosition = function (pos) {
77
- return this.nw.lng < pos.lng && this.se.lng > pos.lng && this.se.lat < pos.lat && this.nw.lat > pos.lat;
78
- };
79
-
80
- Bounds.prototype.getIncludedPositions = function (positions) {
81
- var result = [];
82
-
83
- for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
84
- var pos = positions_1[_i];
85
-
86
- if (this.includesPosition(pos)) {
87
- result.push(pos);
88
- }
89
- }
90
-
91
- return result;
92
- };
93
-
94
- Bounds.prototype.includes = function (positions) {
95
- positions = Array.isArray(positions) ? positions : [positions];
96
-
97
- for (var _i = 0, positions_2 = positions; _i < positions_2.length; _i++) {
98
- var pos = positions_2[_i];
99
-
100
- if (!this.includesPosition(pos)) {
101
- return false;
102
- }
103
- }
104
-
105
- return true;
106
- };
107
-
108
- Bounds.prototype.includesOnlyOnePoint = function (positions) {
109
- for (var _i = 0, positions_3 = positions; _i < positions_3.length; _i++) {
110
- var pos = positions_3[_i];
111
-
112
- if (this.includesPosition(pos)) {
113
- return true;
114
- }
115
- }
116
-
117
- return false;
118
- };
119
-
120
- Bounds.prototype.intersects = function (positions) {
121
- return calculate.PolygonCalculator.intersects([this.nw, this.se], positions);
122
- };
123
-
124
- return Bounds;
125
- }();
126
-
127
- var Offset = function () {
128
- function Offset(x, y) {
129
- this.x = x;
130
- this.y = y;
131
- }
132
-
133
- return Offset;
134
- }();
135
-
136
- var Drawable = function () {
137
- function Drawable() {}
138
-
139
- return Drawable;
140
- }();
141
-
142
- var Marker = function (_super) {
143
- tslib.__extends(Marker, _super);
144
-
145
- function Marker(options) {
146
- var _this = _super.call(this) || this;
147
-
148
- _this.options = options;
149
- return _this;
150
- }
151
-
152
- return Marker;
153
- }(Drawable);
154
-
155
- var Polyline = function (_super) {
156
- tslib.__extends(Polyline, _super);
157
-
158
- function Polyline(options) {
159
- var _this = _super.call(this) || this;
160
-
161
- _this.options = options;
162
- return _this;
163
- }
164
-
165
- return Polyline;
166
- }(Drawable);
167
-
168
- var Polygon = function (_super) {
169
- tslib.__extends(Polygon, _super);
170
-
171
- function Polygon(options) {
172
- var _this = _super.call(this) || this;
173
-
174
- _this.options = options;
175
- return _this;
176
- }
177
-
178
- Polygon.prototype.getCenter = function () {
179
- if (Array.isArray(this.options.position) && this.options.position.length > 0) {
180
- var paths = this.options.position.map(function (elem) {
181
- return elem instanceof Position ? elem : new Position(elem[0], elem[1]);
182
- });
183
- return calculate.PolygonCalculator.getCenter(paths);
184
- }
185
-
186
- throw new Error('center 를 찾을 수 없습니다.');
187
- };
188
-
189
- return Polygon;
190
- }(Drawable);
191
- var cn = classNames__default["default"].bind(MintMap_module);
192
22
  var DEFAULT_CENTER = {
193
23
  lat: 37.5036845,
194
24
  lng: 127.0448698
195
25
  };
26
+ /**
27
+ * Mint Map 컴포넌트
28
+ *
29
+ * @param {MintMapProps} MintMapProps
30
+ *
31
+ * @returns {JSX.Element} JSX
32
+ */
33
+
196
34
  function MintMap(_a) {
197
35
  var mapLoadingComponent = _a.mapLoadingComponent,
198
36
  _b = _a.dissolveEffectWhenLoaded,
@@ -234,7 +72,21 @@ function MintMap(_a) {
234
72
 
235
73
  if (newController_1) {
236
74
  newController_1.loadMapApi().then(function () {
237
- setController(newController_1);
75
+ setController(newController_1); // fade in 로직은 일단 스킵
76
+ // if(dissolveEffectWhenLoaded && loadingRef.current){
77
+ // const elemStyle = loadingRef.current.style
78
+ // elemStyle.background = 'white'
79
+ // elemStyle.opacity = '0'
80
+ // elemStyle.animationDuration = '0.1s'
81
+ // loadingRef.current.addEventListener('animationend', ()=>{
82
+ // setController(newController as MintMapController)
83
+ // }, {
84
+ // once:true
85
+ // })
86
+ // loadingRef.current.classList.add(cn('ani-fade-in'))
87
+ // }else{
88
+ // setController(newController as MintMapController)
89
+ // }
238
90
  });
239
91
  } else {
240
92
  throw new Error("Not Supported Map type ".concat(mapType));
@@ -279,254 +131,5 @@ function MintMap(_a) {
279
131
  }
280
132
  }), loading));
281
133
  }
282
- function PointLoading(_a) {
283
- var _b = _a.text,
284
- text = _b === void 0 ? 'Loading' : _b,
285
- _c = _a.pointCount,
286
- pointCount = _c === void 0 ? 4 : _c,
287
- _d = _a.speedMs,
288
- speedMs = _d === void 0 ? 200 : _d;
289
- var pointStringPool = React.useState(Array.from(Array(pointCount)).map(function (_el, idx) {
290
- return Array.from(Array(idx + 1)).map(function () {
291
- return '.';
292
- }).join('');
293
- }))[0];
294
-
295
- var _e = React.useState(''),
296
- pointString = _e[0],
297
- setPointString = _e[1];
298
-
299
- React.useEffect(function () {
300
- var pointStringIndex = 0;
301
- var interval = setInterval(function () {
302
- pointStringIndex += 1;
303
-
304
- if (pointStringIndex >= pointCount) {
305
- pointStringIndex = 0;
306
- }
307
-
308
- setPointString(pointStringPool[pointStringIndex]);
309
- }, speedMs);
310
- return function () {
311
- interval && clearInterval(interval);
312
- };
313
- }, []);
314
- return React__default["default"].createElement("div", {
315
- className: cn('loading-point-container')
316
- }, React__default["default"].createElement("div", {
317
- style: {
318
- width: '300px',
319
- fontSize: '16px',
320
- fontWeight: 600,
321
- color: 'gray',
322
- transform: 'translateX(130px)'
323
- }
324
- }, "".concat(text, " ").concat(pointString)));
325
- }
326
- function MapLoadingWithImage(_a) {
327
- var _b = _a.size,
328
- size = _b === void 0 ? 256 : _b;
329
-
330
- var _c = React.useState(),
331
- width = _c[0],
332
- setWidth = _c[1];
333
-
334
- var _d = React.useState(),
335
- height = _d[0],
336
- setHeight = _d[1];
337
-
338
- var render = React.useMemo(function () {
339
- if (!height || !width) {
340
- return;
341
- }
342
-
343
- var row = Math.ceil(height / size);
344
- var col = Math.ceil(width / size);
345
- console.log('re render', width, height, row, col);
346
- return Array.from(Array(row)).map(function () {
347
- return React__default["default"].createElement("div", {
348
- style: {
349
- display: 'flex'
350
- }
351
- }, Array.from(Array(col)).map(function () {
352
- var duration = Number((Math.random() * 4).toFixed(1)) + 1;
353
- var delay = Number((Math.random() * 4).toFixed(1)) + 2;
354
- return React__default["default"].createElement(LoadingImage, {
355
- size: size,
356
- duration: duration,
357
- delay: delay
358
- });
359
- }));
360
- });
361
- }, [width, height]);
362
- return React__default["default"].createElement("div", {
363
- ref: function (refs) {
364
- setWidth(refs === null || refs === void 0 ? void 0 : refs.offsetWidth);
365
- setHeight(refs === null || refs === void 0 ? void 0 : refs.offsetHeight);
366
- },
367
- style: {
368
- width: '100%',
369
- height: '100%',
370
- overflow: 'hidden'
371
- }
372
- }, render);
373
- }
374
-
375
- function LoadingImage(_a) {
376
- var _b = _a.size,
377
- size = _b === void 0 ? 256 : _b,
378
- _c = _a.duration,
379
- duration = _c === void 0 ? 1 : _c,
380
- _d = _a.delay,
381
- delay = _d === void 0 ? 1 : _d;
382
- var scale = 256 / 4000;
383
- return React__default["default"].createElement("svg", {
384
- className: cn("ani-fade-in"),
385
- style: {
386
- flex: "0 0 ".concat(size, "px"),
387
- opacity: 0,
388
- animationDelay: "".concat(delay, "s"),
389
- animationDuration: "".concat(duration, "s"),
390
- animationFillMode: 'forwards'
391
- },
392
- width: size,
393
- height: size,
394
- viewBox: "0 0 ".concat(size, " ").concat(size),
395
- fill: "none",
396
- xmlns: "http://www.w3.org/2000/svg"
397
- }, React__default["default"].createElement("g", {
398
- transform: "scale(".concat(scale, ")"),
399
- "clip-path": "url(#clip0_5_701)"
400
- }, React__default["default"].createElement("rect", {
401
- width: "4000",
402
- height: "4000",
403
- transform: "translate(0 4000) rotate(-90)",
404
- fill: "#F8F8F8"
405
- }), React__default["default"].createElement("path", {
406
- d: "M2996.5 780L3624 309L3928.5 789.5L3422 1080.5L2996.5 780Z",
407
- fill: "#E6E6E6"
408
- }), React__default["default"].createElement("path", {
409
- d: "M522.5 449.5L1156.5 48.4999L1197.5 64.4999L1502.5 485.5L822.5 918L522.5 449.5Z",
410
- fill: "#F6E4DD"
411
- }), React__default["default"].createElement("path", {
412
- d: "M1149.5 1386.5L2468 516L2931.5 1286.5L2966 1415L1650.5 2248L1149.5 1386.5Z",
413
- fill: "#DCEACA"
414
- }), React__default["default"].createElement("path", {
415
- d: "M1840.5 2838.5L2609 2313L3047.5 2599.5L3073.5 2745.5L2176.5 3311L1840.5 2838.5Z",
416
- fill: "#E6E6E6"
417
- }), React__default["default"].createElement("path", {
418
- d: "M594 3013.5L1080.5 2681.5L1744 3615L1162.5 4002.5L594 3013.5Z",
419
- fill: "#DCEACA"
420
- }), React__default["default"].createElement("path", {
421
- d: "M2094.05 1450.88C2127.97 1531.67 2192.23 1496.11 2250.02 1514.4C2567.73 1559.37 2608.68 1362.05 2668.2 1302.01C2736.79 1232.83 2612.15 1065.8 2523.28 1090.46C2434.42 1115.13 2432.96 1150.53 2415.25 1229.76C2397.53 1308.98 2233.45 1247.46 2177.4 1257.03C2121.35 1266.61 2051.65 1349.89 2094.05 1450.88Z",
422
- fill: "#A2CAEE"
423
- }), React__default["default"].createElement("circle", {
424
- cx: "958",
425
- cy: "3092",
426
- r: "95",
427
- fill: "#A2CAEE"
428
- }), React__default["default"].createElement("circle", {
429
- cx: "1127",
430
- cy: "3176",
431
- r: "56",
432
- fill: "#A2CAEE"
433
- }), React__default["default"].createElement("path", {
434
- "fill-rule": "evenodd",
435
- "clip-rule": "evenodd",
436
- d: "M3459.68 1085.96L4058.54 2069.19L4001.32 2104.04L3402.46 1120.82L3459.68 1085.96Z",
437
- fill: "white"
438
- }), React__default["default"].createElement("path", {
439
- "fill-rule": "evenodd",
440
- "clip-rule": "evenodd",
441
- d: "M-317.721 1447.99L595.333 2953.94L1201.76 4004.26L1143.74 4037.76L537.668 2988.06L-375.013 1482.72L-317.721 1447.99ZM1058.06 1406.15L1789.22 920.04L1109.17 -5.66436L1163.17 -45.3311L1844.92 882.695L2486.62 448.527L3047.72 1427.91L2989.59 1461.22L2464.38 544.474L1855.66 956.322L1855.55 956.398L1095.15 1461.94L1058.06 1406.15ZM1384.39 3114.5L2197.8 2552.05L1838.4 2105.93L1890.57 2063.9L2253.06 2513.84L2642 2244.89L2680.11 2300L1883.89 2850.56L2238.69 3352.52L2183.98 3391.19L1828.78 2888.67L1422.5 3169.61L1384.39 3114.5Z",
442
- fill: "white"
443
- }), React__default["default"].createElement("path", {
444
- "fill-rule": "evenodd",
445
- "clip-rule": "evenodd",
446
- d: "M-100.246 749.04L1266.96 -152.746L1346.25 -32.5396L-20.9597 869.247L-100.246 749.04Z",
447
- fill: "#FBEDB1"
448
- }), React__default["default"].createElement("path", {
449
- "fill-rule": "evenodd",
450
- "clip-rule": "evenodd",
451
- d: "M5229.83 1392.22L2830.78 2477.33L2803.17 2416.28L5202.22 1331.17L5229.83 1392.22Z",
452
- fill: "white"
453
- }), React__default["default"].createElement("path", {
454
- "fill-rule": "evenodd",
455
- "clip-rule": "evenodd",
456
- d: "M2486.94 449.315L3519.19 1097.44L3483.56 1154.18L2451.32 506.057L2486.94 449.315Z",
457
- fill: "white"
458
- }), React__default["default"].createElement("path", {
459
- "fill-rule": "evenodd",
460
- "clip-rule": "evenodd",
461
- d: "M2352.16 -273.141L2533.64 518.164L2468.34 533.141L2286.86 -258.164L2352.16 -273.141Z",
462
- fill: "white"
463
- }), React__default["default"].createElement("path", {
464
- "fill-rule": "evenodd",
465
- "clip-rule": "evenodd",
466
- d: "M2237.62 3336.43L2440.07 4086.61L2375.39 4104.07L2172.93 3353.89L2237.62 3336.43Z",
467
- fill: "white"
468
- }), React__default["default"].createElement("path", {
469
- "fill-rule": "evenodd",
470
- "clip-rule": "evenodd",
471
- d: "M1204.91 1396.51L-54.5055 1973.41L-82.4082 1912.49L1177.01 1335.59L1204.91 1396.51Z",
472
- fill: "white"
473
- }), React__default["default"].createElement("path", {
474
- "fill-rule": "evenodd",
475
- "clip-rule": "evenodd",
476
- d: "M2694.5 2950.14L4158.86 4928.5L4105.01 4968.36L2640.64 2990L2694.5 2950.14Z",
477
- fill: "white"
478
- }), React__default["default"].createElement("path", {
479
- "fill-rule": "evenodd",
480
- "clip-rule": "evenodd",
481
- d: "M3441.72 -42.6462L3995.65 846.725L3938.77 882.146L3384.85 -7.2254L3441.72 -42.6462Z",
482
- fill: "white"
483
- }), React__default["default"].createElement("path", {
484
- "fill-rule": "evenodd",
485
- "clip-rule": "evenodd",
486
- d: "M2282.81 3631.14L2925.81 3304.14L2956.19 3363.86L2313.19 3690.86L2282.81 3631.14Z",
487
- fill: "white"
488
- }), React__default["default"].createElement("path", {
489
- "fill-rule": "evenodd",
490
- "clip-rule": "evenodd",
491
- d: "M466.178 1695.89L522.822 1660.11L813.709 2120.58L1365.65 1773.15L1401.35 1829.85L849.492 2177.23L1140.32 2637.61L1083.68 2673.39L466.178 1695.89Z",
492
- fill: "white"
493
- }), React__default["default"].createElement("path", {
494
- "fill-rule": "evenodd",
495
- "clip-rule": "evenodd",
496
- d: "M790.24 914.745L1475.24 451.745L1512.76 507.255L827.76 970.255L790.24 914.745Z",
497
- fill: "white"
498
- }), React__default["default"].createElement("path", {
499
- "fill-rule": "evenodd",
500
- "clip-rule": "evenodd",
501
- d: "M3410.6 2192.45L2986.6 1469.45L3044.4 1435.55L3468.4 2158.55L3410.6 2192.45Z",
502
- fill: "white"
503
- }), React__default["default"].createElement("path", {
504
- "fill-rule": "evenodd",
505
- "clip-rule": "evenodd",
506
- d: "M3637.26 329.182L3012.26 803.682L2971.74 750.318L3596.74 275.818L3637.26 329.182Z",
507
- fill: "white"
508
- }), React__default["default"].createElement("path", {
509
- "fill-rule": "evenodd",
510
- "clip-rule": "evenodd",
511
- d: "M-102.531 3333.52L1563.16 2259.21L418.867 413.751L541.25 337.866L1684.19 2181.14L4025.32 666.934L4103.57 787.82L2336.63 1931.51L3187.41 2659.17L4104.73 3340.1L4018.9 3455.73L3139.75 2803.13L956.929 4221.62L878.381 4100.93L1666.1 3588.26L1086.77 2737.81L-24.4816 3454.53L-102.531 3333.52ZM1207.82 2659.74L1786.86 3509.76L3022.47 2707.58L2210.46 2013.07L1207.82 2659.74Z",
512
- fill: "#FBEDB1"
513
- })), React__default["default"].createElement("defs", null, React__default["default"].createElement("clipPath", {
514
- id: "clip0_5_701"
515
- }, React__default["default"].createElement("rect", {
516
- width: "4000",
517
- height: "4000",
518
- fill: "white",
519
- transform: "translate(0 4000) rotate(-90)"
520
- }))));
521
- }
522
134
 
523
- exports.Bounds = Bounds;
524
- exports.Drawable = Drawable;
525
- exports.MapLoadingWithImage = MapLoadingWithImage;
526
- exports.Marker = Marker;
527
135
  exports.MintMap = MintMap;
528
- exports.Offset = Offset;
529
- exports.PointLoading = PointLoading;
530
- exports.Polygon = Polygon;
531
- exports.Polyline = Polyline;
532
- exports.Position = Position;
@@ -1,4 +1,4 @@
1
- export declare class MintMapCanvasRenderer {
2
- context: CanvasRenderingContext2D;
3
- constructor(context: CanvasRenderingContext2D);
4
- }
1
+ export declare class MintMapCanvasRenderer {
2
+ context: CanvasRenderingContext2D;
3
+ constructor(context: CanvasRenderingContext2D);
4
+ }
@@ -2,7 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var MintMapCanvasRenderer = function () {
5
+ var MintMapCanvasRenderer =
6
+ /** @class */
7
+ function () {
6
8
  function MintMapCanvasRenderer(context) {
7
9
  this.context = context;
8
10
  }
@@ -1,44 +1,58 @@
1
- import { Bounds, Drawable, MapType, MapVendorType, Marker, MarkerOptions, MintMapProps, Offset, Polygon, PolygonOptions, Polyline, PolylineOptions, Position } from "../MintMap";
2
- export declare abstract class MintMapController {
3
- abstract type: MapType;
4
- abstract map: MapVendorType | null;
5
- abstract scriptUrl: string;
6
- abstract initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
7
- abstract destroyMap(): void;
8
- abstract loadMapApi(): Promise<boolean>;
9
- abstract getCurrBounds(): Bounds;
10
- abstract panningTo(targetCenter: Position): void;
11
- abstract getZoomLevel(): number;
12
- abstract setZoomLevel(zoom: number): void;
13
- abstract getCenter(): Position;
14
- abstract setCenter(position: Position): void;
15
- abstract createMarker(marker: Marker): void;
16
- abstract updateMarker(marker: Marker, options: MarkerOptions): void;
17
- abstract clearDrawable(drawable: Drawable): boolean;
18
- abstract markerToTheTop(marker: Marker): void;
19
- abstract isMapDragged(): boolean;
20
- abstract setMapDragged(value: boolean): void;
21
- abstract setMarkerZIndex(marker: Marker, zIndex: number): void;
22
- abstract createPolyline(polyline: Polyline): void;
23
- abstract updatePolyline(polyline: Polyline, options: PolylineOptions): void;
24
- abstract createPolygon(polygon: Polygon): void;
25
- abstract updatePolygon(polygon: Polygon, options: PolygonOptions): void;
26
- mapProps: MintMapProps;
27
- mapApiLoaded: boolean;
28
- mapInitialized: boolean;
29
- mapDivElement: HTMLDivElement;
30
- constructor(props: MintMapProps);
31
- getMap(): MapVendorType | null;
32
- getMapType(): MapType;
33
- positionToOffset(position: Position): Offset;
34
- offsetToPosition(offset: Offset): Position;
35
- loadScript(url: string, id: string, checkLoaded: () => boolean): Promise<boolean>;
36
- getRandomFunctionName(prefix: string): string;
37
- buildUrl(baseUrl: string, param: {
38
- [key: string]: string | string[];
39
- }): string;
40
- private processedTime;
41
- checkBoundsChangeThrottleTime(): boolean;
42
- getBaseToMapZoom(zoomBase: number): number;
43
- getMapToBaseZoom(mapZoom: number): number;
44
- }
1
+ import { MapType, MapVendorType } from '../types/CommonTypes';
2
+ import { Drawable, Marker, MarkerOptions, Polygon, PolygonOptions, Polyline, PolylineOptions } from '../types/MapDrawables';
3
+ import { Bounds, Offset, Position } from '../types/MapTypes';
4
+ import { MintMapProps } from '../types/MintMapProps';
5
+ export declare abstract class MintMapController {
6
+ abstract type: MapType;
7
+ abstract map: MapVendorType | null;
8
+ abstract scriptUrl: string;
9
+ abstract initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
10
+ abstract destroyMap(): void;
11
+ abstract loadMapApi(): Promise<boolean>;
12
+ abstract getCurrBounds(): Bounds;
13
+ abstract panningTo(targetCenter: Position): void;
14
+ abstract getZoomLevel(): number;
15
+ abstract setZoomLevel(zoom: number): void;
16
+ abstract getCenter(): Position;
17
+ abstract setCenter(position: Position): void;
18
+ abstract createMarker(marker: Marker): void;
19
+ abstract updateMarker(marker: Marker, options: MarkerOptions): void;
20
+ abstract clearDrawable(drawable: Drawable): boolean;
21
+ abstract markerToTheTop(marker: Marker): void;
22
+ abstract isMapDragged(): boolean;
23
+ abstract setMapDragged(value: boolean): void;
24
+ abstract setMarkerZIndex(marker: Marker, zIndex: number): void;
25
+ abstract createPolyline(polyline: Polyline): void;
26
+ abstract updatePolyline(polyline: Polyline, options: PolylineOptions): void;
27
+ abstract createPolygon(polygon: Polygon): void;
28
+ abstract updatePolygon(polygon: Polygon, options: PolygonOptions): void;
29
+ mapProps: MintMapProps;
30
+ mapApiLoaded: boolean;
31
+ mapInitialized: boolean;
32
+ mapDivElement: HTMLDivElement;
33
+ constructor(props: MintMapProps);
34
+ getMap(): MapVendorType | null;
35
+ getMapType(): MapType;
36
+ positionToOffset(position: Position): Offset;
37
+ offsetToPosition(offset: Offset): Position;
38
+ loadScript(url: string, id: string, checkLoaded: () => boolean): Promise<boolean>;
39
+ getRandomFunctionName(prefix: string): string;
40
+ /**
41
+ * URL 빌더 메서드
42
+ *
43
+ * @param {string} baseUrl: 기본 URL
44
+ * @param {{ [ key: string ]: string | string[] }} param: 파라미터 JSON
45
+ * @returns {string} URL
46
+ */
47
+ buildUrl(baseUrl: string, param: {
48
+ [key: string]: string | string[] | boolean;
49
+ }): string;
50
+ private processedTime;
51
+ /**
52
+ * 쓰로틀링 처리
53
+ * @returns
54
+ */
55
+ checkBoundsChangeThrottleTime(): boolean;
56
+ getBaseToMapZoom(zoomBase: number): number;
57
+ getMapToBaseZoom(mapZoom: number): number;
58
+ }