@mint-ui/map 0.5.0-beta → 0.5.2-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 (66) 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 -10
  5. package/dist/components/mint-map/MintMap.js +6 -6
  6. package/dist/components/mint-map/core/MintMapCanvasRenderer.d.ts +4 -4
  7. package/dist/components/mint-map/core/MintMapController.d.ts +64 -64
  8. package/dist/components/mint-map/core/MintMapController.js +9 -9
  9. package/dist/components/mint-map/core/MintMapCore.d.ts +3 -3
  10. package/dist/components/mint-map/core/advanced/MapBuildingProjection.d.ts +15 -15
  11. package/dist/components/mint-map/core/advanced/MapLoadingComponents.d.ts +17 -17
  12. package/dist/components/mint-map/core/advanced/index.d.ts +3 -3
  13. package/dist/components/mint-map/core/advanced/shapes/CircleMarker.d.ts +20 -20
  14. package/dist/components/mint-map/core/advanced/shapes/CircleMarker.js +6 -6
  15. package/dist/components/mint-map/core/advanced/shapes/PolygonMarker.d.ts +23 -23
  16. package/dist/components/mint-map/core/advanced/shapes/PolygonMarker.js +6 -6
  17. package/dist/components/mint-map/core/advanced/shapes/base/SVGCircle.d.ts +8 -8
  18. package/dist/components/mint-map/core/advanced/shapes/base/SVGCircle.js +4 -4
  19. package/dist/components/mint-map/core/advanced/shapes/base/SVGPolygon.d.ts +12 -12
  20. package/dist/components/mint-map/core/advanced/shapes/base/SVGRect.d.ts +10 -10
  21. package/dist/components/mint-map/core/advanced/shapes/base/index.d.ts +3 -3
  22. package/dist/components/mint-map/core/advanced/shapes/index.d.ts +3 -3
  23. package/dist/components/mint-map/core/hooks/MarkerMovingHook.d.ts +6 -6
  24. package/dist/components/mint-map/core/hooks/index.d.ts +1 -1
  25. package/dist/components/mint-map/core/index.d.ts +8 -8
  26. package/dist/components/mint-map/core/provider/MintMapProvider.d.ts +8 -8
  27. package/dist/components/mint-map/core/provider/index.d.ts +1 -1
  28. package/dist/components/mint-map/core/util/animation.d.ts +16 -16
  29. package/dist/components/mint-map/core/util/calculate.d.ts +66 -66
  30. package/dist/components/mint-map/core/util/cluster.d.ts +18 -18
  31. package/dist/components/mint-map/core/util/index.d.ts +4 -4
  32. package/dist/components/mint-map/core/util/waiting.d.ts +1 -1
  33. package/dist/components/mint-map/core/wrapper/MapCanvasMarkerWrapper.d.ts +27 -27
  34. package/dist/components/mint-map/core/wrapper/MapCanvasMarkerWrapper.js +6 -6
  35. package/dist/components/mint-map/core/wrapper/MapCanvasWrapper.d.ts +11 -11
  36. package/dist/components/mint-map/core/wrapper/MapCanvasWrapper.js +6 -6
  37. package/dist/components/mint-map/core/wrapper/MapControlWrapper.d.ts +18 -18
  38. package/dist/components/mint-map/core/wrapper/MapControlWrapper.js +6 -6
  39. package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.d.ts +32 -32
  40. package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.js +6 -6
  41. package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.d.ts +12 -12
  42. package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.js +6 -6
  43. package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.d.ts +12 -12
  44. package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.js +6 -6
  45. package/dist/components/mint-map/core/wrapper/index.d.ts +6 -6
  46. package/dist/components/mint-map/google/GoogleMintMapController.d.ts +51 -51
  47. package/dist/components/mint-map/google/GoogleMintMapController.js +2 -2
  48. package/dist/components/mint-map/index.d.ts +5 -5
  49. package/dist/components/mint-map/kakao/KakaoMintMapController.d.ts +56 -56
  50. package/dist/components/mint-map/kakao/KakaoMintMapController.js +11 -8
  51. package/dist/components/mint-map/naver/NaverMintMapController.d.ts +53 -53
  52. package/dist/components/mint-map/naver/NaverMintMapController.js +10 -7
  53. package/dist/components/mint-map/types/CommonTypes.d.ts +11 -11
  54. package/dist/components/mint-map/types/MapDrawables.d.ts +110 -110
  55. package/dist/components/mint-map/types/MapDrawables.js +8 -8
  56. package/dist/components/mint-map/types/MapEventTypes.d.ts +44 -41
  57. package/dist/components/mint-map/types/MapEventTypes.js +2 -0
  58. package/dist/components/mint-map/types/MapTypes.d.ts +60 -60
  59. package/dist/components/mint-map/types/MapTypes.js +13 -13
  60. package/dist/components/mint-map/types/MintMapEvents.d.ts +25 -25
  61. package/dist/components/mint-map/types/MintMapProps.d.ts +92 -92
  62. package/dist/components/mint-map/types/index.d.ts +6 -6
  63. package/dist/index.d.ts +7 -7
  64. package/dist/index.es.js +113 -105
  65. package/dist/index.umd.js +113 -105
  66. package/package.json +77 -77
package/dist/index.es.js CHANGED
@@ -437,23 +437,23 @@ function () {
437
437
  return GeoCalulator;
438
438
  }();
439
439
 
440
- /**
441
- * 좌표값
442
- * @description 위도/경도, DOM 상의 X/Y 좌표
440
+ /**
441
+ * 좌표값
442
+ * @description 위도/경도, DOM 상의 X/Y 좌표
443
443
  */
444
444
 
445
445
  var Position =
446
446
  /** @class */
447
447
  function () {
448
448
  function Position(lat, lng) {
449
- /**
450
- * 위도
451
- * @description 위도(latitude)
449
+ /**
450
+ * 위도
451
+ * @description 위도(latitude)
452
452
  */
453
453
  this.lat = 0;
454
- /**
455
- * 경도
456
- * @description 경도(longitude)
454
+ /**
455
+ * 경도
456
+ * @description 경도(longitude)
457
457
  */
458
458
 
459
459
  this.lng = 0;
@@ -561,15 +561,15 @@ function () {
561
561
 
562
562
  return Bounds;
563
563
  }();
564
- /**
565
- * DOM 상에서의 좌표를 표현 (픽셀을 나타내는 숫자)
564
+ /**
565
+ * DOM 상에서의 좌표를 표현 (픽셀을 나타내는 숫자)
566
566
  */
567
567
 
568
568
  var Offset =
569
569
  /** @class */
570
570
  function () {
571
- /**
572
- * DOM 상에서의 좌표를 표현 (픽셀을 나타내는 숫자)
571
+ /**
572
+ * DOM 상에서의 좌표를 표현 (픽셀을 나타내는 숫자)
573
573
  */
574
574
  function Offset(x, y) {
575
575
  this.x = x;
@@ -795,12 +795,12 @@ function () {
795
795
  MintMapController.prototype.getRandomFunctionName = function (prefix) {
796
796
  return "".concat(prefix, "_").concat(v4().replace(/-/g, '_'));
797
797
  };
798
- /**
799
- * URL 빌더 메서드
800
- *
801
- * @param {string} baseUrl: 기본 URL
802
- * @param {{ [ key: string ]: string | string[] }} param: 파라미터 JSON
803
- * @returns {string} URL
798
+ /**
799
+ * URL 빌더 메서드
800
+ *
801
+ * @param {string} baseUrl: 기본 URL
802
+ * @param {{ [ key: string ]: string | string[] }} param: 파라미터 JSON
803
+ * @returns {string} URL
804
804
  */
805
805
 
806
806
 
@@ -813,9 +813,9 @@ function () {
813
813
  }).join('&');
814
814
  return "".concat(baseUrl, "?").concat(params);
815
815
  };
816
- /**
817
- * 쓰로틀링 처리
818
- * @returns
816
+ /**
817
+ * 쓰로틀링 처리
818
+ * @returns
819
819
  */
820
820
 
821
821
 
@@ -1121,6 +1121,8 @@ function () {
1121
1121
  this.DRAG = 'drag';
1122
1122
  this.DRAGSTART = 'dragstart';
1123
1123
  this.DRAGEND = 'dragend';
1124
+ this.RIGHTCLICK = 'rightclick';
1125
+ this.CONTEXTMENU = 'contextmenu';
1124
1126
  }
1125
1127
 
1126
1128
  MapUIEvent.prototype.get = function (eventName) {
@@ -1154,7 +1156,9 @@ function (_super) {
1154
1156
  _this.markerEvents = ['click', 'mouseover', 'mouseout'];
1155
1157
  _this.dragStartPoint = [0, 0];
1156
1158
  _this.dragged = false;
1157
- _this.eventMap = new Map();
1159
+ _this.eventMap = new Map(); //contextmenu 는 지원하지 않지만 호환성을 위해 rightclick 으로 대체
1160
+
1161
+ _this.mapUIEvent.CONTEXTMENU = 'rightclick';
1158
1162
  Object.freeze(_this.mapEvent);
1159
1163
  Object.freeze(_this.mapUIEvent);
1160
1164
  return _this; // console.log(`${this.type} controller loadded`);
@@ -1372,11 +1376,11 @@ function (_super) {
1372
1376
  var map = marker.native.getMap();
1373
1377
 
1374
1378
  if (map) {
1375
- /** 중요!!!!
1376
- * naver 마커의 setOption(MarkerOptions) 은 내부적으로 setMap 을 무조건 강제 처리한다!!!
1377
- * setMap 을 처리하면 맵의 이벤트리스너 등등이 모두 초기화 되고 다시 맵을 add 하면서 마커관련된 모든 초기화가 다시 일어난다.
1378
- * (심지어 map 이 기존과 같은 객체인데도 초기화 처리함)
1379
- * 그래서 민트맵에서는 update 를 지원하는 항목별로 명시적으로 각각 처리한다.
1379
+ /** 중요!!!!
1380
+ * naver 마커의 setOption(MarkerOptions) 은 내부적으로 setMap 을 무조건 강제 처리한다!!!
1381
+ * setMap 을 처리하면 맵의 이벤트리스너 등등이 모두 초기화 되고 다시 맵을 add 하면서 마커관련된 모든 초기화가 다시 일어난다.
1382
+ * (심지어 map 이 기존과 같은 객체인데도 초기화 처리함)
1383
+ * 그래서 민트맵에서는 update 를 지원하는 항목별로 명시적으로 각각 처리한다.
1380
1384
  */
1381
1385
  //Position
1382
1386
  if (options.position && options.position instanceof Position) {
@@ -1796,7 +1800,8 @@ function (_super) {
1796
1800
  vendorEventName: naverEventName,
1797
1801
  param: {
1798
1802
  position: position,
1799
- offset: position.offset
1803
+ offset: position.offset,
1804
+ pointerEvent: e.pointerEvent
1800
1805
  }
1801
1806
  };
1802
1807
  callback(param);
@@ -2446,7 +2451,6 @@ function (_super) {
2446
2451
  };
2447
2452
  callback(param);
2448
2453
  } else if (eventName in _this.mapUIEvent) {
2449
- if (eventName.startsWith('DRAG')) console.log(eventName, e);
2450
2454
  var position = null;
2451
2455
 
2452
2456
  if (e) {
@@ -2462,7 +2466,8 @@ function (_super) {
2462
2466
  vendorEventName: googleEventName,
2463
2467
  param: {
2464
2468
  position: position,
2465
- offset: position === null || position === void 0 ? void 0 : position.offset
2469
+ offset: position === null || position === void 0 ? void 0 : position.offset,
2470
+ pointerEvent: e.domEvent
2466
2471
  }
2467
2472
  };
2468
2473
  callback(param);
@@ -2541,7 +2546,9 @@ function (_super) {
2541
2546
  _this.dragged = false;
2542
2547
  _this.eventMap = new Map(); //kakao only 이벤트이름 재정의 zoom_start
2543
2548
 
2544
- _this.mapEvent.ZOOMSTART = 'zoom_start';
2549
+ _this.mapEvent.ZOOMSTART = 'zoom_start'; //contextmenu 는 지원하지 않지만 호환성을 위해 rightclick 으로 대체
2550
+
2551
+ _this.mapUIEvent.CONTEXTMENU = 'rightclick';
2545
2552
  Object.freeze(_this.mapEvent);
2546
2553
  Object.freeze(_this.mapUIEvent);
2547
2554
  return _this; // console.log(`${this.type} controller loadded`);
@@ -3044,13 +3051,13 @@ function (_super) {
3044
3051
  };
3045
3052
 
3046
3053
  KakaoMintMapController.prototype.getSafeZoomValue = function (value) {
3047
- /**
3048
- * 카카오는 구글/네이버와 다르게 줌레벨이 작아질수록 확대된다 (가장 확대된 것이 0)
3049
- * - 가장 확대된 값 : 1
3050
- * - 가장 축소된 값 : 14
3051
- *
3052
- * 그래서 세계지도가 없는 카카오는 동일한 사정인 네이버와 매핑하기로 한다.
3053
- * 문제는 둘 간의 줌 레벨별 축척이 일치하지 않는다. 그래서 가장 유사한 레벨 끼리 매핑이 필요하다
3054
+ /**
3055
+ * 카카오는 구글/네이버와 다르게 줌레벨이 작아질수록 확대된다 (가장 확대된 것이 0)
3056
+ * - 가장 확대된 값 : 1
3057
+ * - 가장 축소된 값 : 14
3058
+ *
3059
+ * 그래서 세계지도가 없는 카카오는 동일한 사정인 네이버와 매핑하기로 한다.
3060
+ * 문제는 둘 간의 줌 레벨별 축척이 일치하지 않는다. 그래서 가장 유사한 레벨 끼리 매핑이 필요하다
3054
3061
  */
3055
3062
  var mapValue = this.getBaseToMapZoom(value);
3056
3063
 
@@ -3067,6 +3074,7 @@ function (_super) {
3067
3074
  var _a;
3068
3075
 
3069
3076
  try {
3077
+ this.removeAllEventListener();
3070
3078
  (_a = this.markerPool) === null || _a === void 0 ? void 0 : _a.destroy();
3071
3079
  } catch (e) {
3072
3080
  console.log('kakao map destroy error', e);
@@ -3234,12 +3242,12 @@ var DEFAULT_CENTER = {
3234
3242
  lat: 37.5036845,
3235
3243
  lng: 127.0448698
3236
3244
  };
3237
- /**
3238
- * Mint Map 컴포넌트
3239
- *
3240
- * @param {MintMapProps} MintMapProps
3241
- *
3242
- * @returns {JSX.Element} JSX
3245
+ /**
3246
+ * Mint Map 컴포넌트
3247
+ *
3248
+ * @param {MintMapProps} MintMapProps
3249
+ *
3250
+ * @returns {JSX.Element} JSX
3243
3251
  */
3244
3252
 
3245
3253
  function MintMap(_a) {
@@ -3376,12 +3384,12 @@ function SVGCircle(_a) {
3376
3384
  pointerEvents: "none",
3377
3385
  width: boxSize,
3378
3386
  height: boxSize,
3379
- viewBox: "0 0 100 100"
3387
+ viewBox: "0 0 ".concat(boxSize, " ").concat(boxSize)
3380
3388
  }, svgProperties), React.createElement("circle", __assign({
3381
3389
  pointerEvents: "visiblepainted",
3382
- cx: '50',
3383
- cy: '50',
3384
- r: '50',
3390
+ cx: radius,
3391
+ cy: radius,
3392
+ r: radius,
3385
3393
  fill: background
3386
3394
  }, shapeProperties))), React.createElement("div", {
3387
3395
  style: {
@@ -3669,8 +3677,8 @@ var Marker =
3669
3677
  /** @class */
3670
3678
  function (_super) {
3671
3679
  __extends(Marker, _super);
3672
- /**
3673
- * 지도에 표시할 마커정보
3680
+ /**
3681
+ * 지도에 표시할 마커정보
3674
3682
  */
3675
3683
 
3676
3684
 
@@ -3688,8 +3696,8 @@ var Polyline =
3688
3696
  /** @class */
3689
3697
  function (_super) {
3690
3698
  __extends(Polyline, _super);
3691
- /**
3692
- * 지도에 표시할 폴리곤정보
3699
+ /**
3700
+ * 지도에 표시할 폴리곤정보
3693
3701
  */
3694
3702
 
3695
3703
 
@@ -3707,8 +3715,8 @@ var Polygon =
3707
3715
  /** @class */
3708
3716
  function (_super) {
3709
3717
  __extends(Polygon, _super);
3710
- /**
3711
- * 지도에 표시할 폴리곤정보
3718
+ /**
3719
+ * 지도에 표시할 폴리곤정보
3712
3720
  */
3713
3721
 
3714
3722
 
@@ -3718,8 +3726,8 @@ function (_super) {
3718
3726
  _this.options = options;
3719
3727
  return _this;
3720
3728
  }
3721
- /**
3722
- * 폴리곤의 중점을 구한다.
3729
+ /**
3730
+ * 폴리곤의 중점을 구한다.
3723
3731
  */
3724
3732
 
3725
3733
 
@@ -3889,12 +3897,12 @@ var offsetCalibration = function (mapType, divElement, options) {
3889
3897
  divElement.style.transform = "translate(-".concat(options.anchor ? options.anchor.x : '0', "px, -").concat(options.anchor ? options.anchor.y : '0', "px)");
3890
3898
  }
3891
3899
  };
3892
- /**
3893
- * Mint Map 컴포넌트
3894
- *
3895
- * @param {MapControlWrapperProps} MapControlWrapperProps
3896
- *
3897
- * @returns {JSX.Element} JSX
3900
+ /**
3901
+ * Mint Map 컴포넌트
3902
+ *
3903
+ * @param {MapControlWrapperProps} MapControlWrapperProps
3904
+ *
3905
+ * @returns {JSX.Element} JSX
3898
3906
  */
3899
3907
 
3900
3908
 
@@ -4229,12 +4237,12 @@ var calculateAverage = function (nums) {
4229
4237
  return Number((sum / nums.length).toFixed(7));
4230
4238
  };
4231
4239
 
4232
- /**
4233
- * CircleMarker
4234
- *
4235
- * @param {CircleMarkerProps} CircleMarkerProps
4236
- *
4237
- * @returns {JSX.Element} JSX
4240
+ /**
4241
+ * CircleMarker
4242
+ *
4243
+ * @param {CircleMarkerProps} CircleMarkerProps
4244
+ *
4245
+ * @returns {JSX.Element} JSX
4238
4246
  */
4239
4247
 
4240
4248
  function CircleMarker(_a) {
@@ -4346,12 +4354,12 @@ function CircleMarker(_a) {
4346
4354
  }, children)));
4347
4355
  }
4348
4356
 
4349
- /**
4350
- *PolygonMarker
4351
- *
4352
- * @param {PolygonMarkerProps} PolygonMarkerProps
4353
- *
4354
- * @returns {JSX.Element} JSX
4357
+ /**
4358
+ *PolygonMarker
4359
+ *
4360
+ * @param {PolygonMarkerProps} PolygonMarkerProps
4361
+ *
4362
+ * @returns {JSX.Element} JSX
4355
4363
  */
4356
4364
 
4357
4365
  function PolygonMarker(_a) {
@@ -4514,12 +4522,12 @@ function PolygonMarker(_a) {
4514
4522
  }, children)));
4515
4523
  }
4516
4524
 
4517
- /**
4518
- * Mint Map 컴포넌트
4519
- *
4520
- * @param {MapControlWrapperProps} MapControlWrapperProps
4521
- *
4522
- * @returns {JSX.Element} JSX
4525
+ /**
4526
+ * Mint Map 컴포넌트
4527
+ *
4528
+ * @param {MapControlWrapperProps} MapControlWrapperProps
4529
+ *
4530
+ * @returns {JSX.Element} JSX
4523
4531
  */
4524
4532
 
4525
4533
  function MapPolygonWrapper(_a) {
@@ -5006,12 +5014,12 @@ var getAlignPosition = function (value, align) {
5006
5014
 
5007
5015
  throw new Error("Size [".concat(value, "] is not valid. (Should be % or pixel number)"));
5008
5016
  };
5009
- /**
5010
- * Mint Map 컴포넌트
5011
- *
5012
- * @param {MapControlWrapperProps} MapControlWrapperProps
5013
- *
5014
- * @returns {JSX.Element} JSX
5017
+ /**
5018
+ * Mint Map 컴포넌트
5019
+ *
5020
+ * @param {MapControlWrapperProps} MapControlWrapperProps
5021
+ *
5022
+ * @returns {JSX.Element} JSX
5015
5023
  */
5016
5024
 
5017
5025
 
@@ -5036,12 +5044,12 @@ function MapControlWrapper(_a) {
5036
5044
  }, children);
5037
5045
  }
5038
5046
 
5039
- /**
5040
- * Mint Map 컴포넌트
5041
- *
5042
- * @param {MapControlWrapperProps} MapControlWrapperProps
5043
- *
5044
- * @returns {JSX.Element} JSX
5047
+ /**
5048
+ * Mint Map 컴포넌트
5049
+ *
5050
+ * @param {MapControlWrapperProps} MapControlWrapperProps
5051
+ *
5052
+ * @returns {JSX.Element} JSX
5045
5053
  */
5046
5054
 
5047
5055
  function MapPolylineWrapper(_a) {
@@ -5081,12 +5089,12 @@ var console$1 = {
5081
5089
  log: function () {
5082
5090
  }
5083
5091
  };
5084
- /**
5085
- * Mint Map 컴포넌트
5086
- *
5087
- * @param {MapControlWrapperProps} MapControlWrapperProps
5088
- *
5089
- * @returns {JSX.Element} JSX
5092
+ /**
5093
+ * Mint Map 컴포넌트
5094
+ *
5095
+ * @param {MapControlWrapperProps} MapControlWrapperProps
5096
+ *
5097
+ * @returns {JSX.Element} JSX
5090
5098
  */
5091
5099
 
5092
5100
  function MapCanvasWrapper(_a) {
@@ -5405,12 +5413,12 @@ function MapCanvasWrapper(_a) {
5405
5413
  }), renderFlag && React.createElement(React.Fragment, null));
5406
5414
  }
5407
5415
 
5408
- /**
5409
- * Mint Map 컴포넌트
5410
- *
5411
- * @param {MapControlWrapperProps} MapControlWrapperProps
5412
- *
5413
- * @returns {JSX.Element} JSX
5416
+ /**
5417
+ * Mint Map 컴포넌트
5418
+ *
5419
+ * @param {MapControlWrapperProps} MapControlWrapperProps
5420
+ *
5421
+ * @returns {JSX.Element} JSX
5414
5422
  */
5415
5423
 
5416
5424
  function MapCanvasMarkerWrapper(_props) {