@mint-ui/map 0.5.12-beta → 0.6.1-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 (67) 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 +66 -65
  8. package/dist/components/mint-map/core/MintMapController.js +10 -10
  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 +22 -22
  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 +28 -28
  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/SVGPolygon.d.ts +12 -12
  19. package/dist/components/mint-map/core/advanced/shapes/base/SVGRect.d.ts +10 -10
  20. package/dist/components/mint-map/core/advanced/shapes/base/index.d.ts +3 -3
  21. package/dist/components/mint-map/core/advanced/shapes/index.d.ts +3 -3
  22. package/dist/components/mint-map/core/hooks/MarkerMovingHook.d.ts +6 -6
  23. package/dist/components/mint-map/core/hooks/index.d.ts +1 -1
  24. package/dist/components/mint-map/core/index.d.ts +8 -8
  25. package/dist/components/mint-map/core/provider/MintMapProvider.d.ts +8 -8
  26. package/dist/components/mint-map/core/provider/index.d.ts +1 -1
  27. package/dist/components/mint-map/core/util/animation.d.ts +16 -16
  28. package/dist/components/mint-map/core/util/cluster.d.ts +18 -18
  29. package/dist/components/mint-map/core/util/geo.d.ts +38 -38
  30. package/dist/components/mint-map/core/util/index.d.ts +7 -7
  31. package/dist/components/mint-map/core/util/log.d.ts +1 -1
  32. package/dist/components/mint-map/core/util/polygon.d.ts +42 -42
  33. package/dist/components/mint-map/core/util/status.d.ts +9 -9
  34. package/dist/components/mint-map/core/util/waiting.d.ts +1 -1
  35. package/dist/components/mint-map/core/wrapper/MapCanvasMarkerWrapper.d.ts +27 -27
  36. package/dist/components/mint-map/core/wrapper/MapCanvasMarkerWrapper.js +6 -6
  37. package/dist/components/mint-map/core/wrapper/MapCanvasWrapper.d.ts +11 -11
  38. package/dist/components/mint-map/core/wrapper/MapCanvasWrapper.js +6 -6
  39. package/dist/components/mint-map/core/wrapper/MapControlWrapper.d.ts +18 -18
  40. package/dist/components/mint-map/core/wrapper/MapControlWrapper.js +6 -6
  41. package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.d.ts +42 -42
  42. package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.js +8 -8
  43. package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.d.ts +12 -12
  44. package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.js +6 -6
  45. package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.d.ts +12 -12
  46. package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.js +6 -6
  47. package/dist/components/mint-map/core/wrapper/index.d.ts +6 -6
  48. package/dist/components/mint-map/google/GoogleMintMapController.d.ts +51 -51
  49. package/dist/components/mint-map/google/GoogleMintMapController.js +8 -1
  50. package/dist/components/mint-map/index.d.ts +5 -5
  51. package/dist/components/mint-map/kakao/KakaoMintMapController.d.ts +55 -55
  52. package/dist/components/mint-map/kakao/KakaoMintMapController.js +15 -8
  53. package/dist/components/mint-map/naver/NaverMintMapController.d.ts +53 -53
  54. package/dist/components/mint-map/naver/NaverMintMapController.js +13 -6
  55. package/dist/components/mint-map/types/CommonTypes.d.ts +11 -11
  56. package/dist/components/mint-map/types/MapDrawables.d.ts +118 -118
  57. package/dist/components/mint-map/types/MapDrawables.js +8 -8
  58. package/dist/components/mint-map/types/MapEventTypes.d.ts +44 -44
  59. package/dist/components/mint-map/types/MapTypes.d.ts +60 -60
  60. package/dist/components/mint-map/types/MapTypes.js +13 -13
  61. package/dist/components/mint-map/types/MintMapEvents.d.ts +25 -25
  62. package/dist/components/mint-map/types/MintMapProps.d.ts +101 -96
  63. package/dist/components/mint-map/types/index.d.ts +6 -6
  64. package/dist/index.d.ts +7 -7
  65. package/dist/index.es.js +123 -102
  66. package/dist/index.umd.js +123 -102
  67. package/package.json +77 -77
package/dist/index.es.js CHANGED
@@ -473,23 +473,23 @@ function () {
473
473
  return PolygonCalculator;
474
474
  }();
475
475
 
476
- /**
477
- * 좌표값
478
- * @description 위도/경도, DOM 상의 X/Y 좌표
476
+ /**
477
+ * 좌표값
478
+ * @description 위도/경도, DOM 상의 X/Y 좌표
479
479
  */
480
480
 
481
481
  var Position =
482
482
  /** @class */
483
483
  function () {
484
484
  function Position(lat, lng) {
485
- /**
486
- * 위도
487
- * @description 위도(latitude)
485
+ /**
486
+ * 위도
487
+ * @description 위도(latitude)
488
488
  */
489
489
  this.lat = 0;
490
- /**
491
- * 경도
492
- * @description 경도(longitude)
490
+ /**
491
+ * 경도
492
+ * @description 경도(longitude)
493
493
  */
494
494
 
495
495
  this.lng = 0;
@@ -597,15 +597,15 @@ function () {
597
597
 
598
598
  return Bounds;
599
599
  }();
600
- /**
601
- * DOM 상에서의 좌표를 표현 (픽셀을 나타내는 숫자)
600
+ /**
601
+ * DOM 상에서의 좌표를 표현 (픽셀을 나타내는 숫자)
602
602
  */
603
603
 
604
604
  var Offset =
605
605
  /** @class */
606
606
  function () {
607
- /**
608
- * DOM 상에서의 좌표를 표현 (픽셀을 나타내는 숫자)
607
+ /**
608
+ * DOM 상에서의 좌표를 표현 (픽셀을 나타내는 숫자)
609
609
  */
610
610
  function Offset(x, y) {
611
611
  this.x = x;
@@ -1136,12 +1136,12 @@ function () {
1136
1136
  MintMapController.prototype.getRandomFunctionName = function (prefix) {
1137
1137
  return "".concat(prefix, "_").concat(v4().replace(/-/g, '_'));
1138
1138
  };
1139
- /**
1140
- * URL 빌더 메서드
1141
- *
1142
- * @param {string} baseUrl: 기본 URL
1143
- * @param {{ [ key: string ]: string | string[] }} param: 파라미터 JSON
1144
- * @returns {string} URL
1139
+ /**
1140
+ * URL 빌더 메서드
1141
+ *
1142
+ * @param {string} baseUrl: 기본 URL
1143
+ * @param {{ [ key: string ]: string | string[] }} param: 파라미터 JSON
1144
+ * @returns {string} URL
1145
1145
  */
1146
1146
 
1147
1147
 
@@ -1149,14 +1149,14 @@ function () {
1149
1149
  var params = Object.entries(param).map(function (_a) {
1150
1150
  var key = _a[0],
1151
1151
  value = _a[1];
1152
- var temp = encodeURIComponent(Array.isArray(value) ? value.join(',') : value);
1152
+ var temp = Array.isArray(value) ? value.join(',') : value;
1153
1153
  return "".concat(key, "=").concat(temp);
1154
1154
  }).join('&');
1155
1155
  return "".concat(baseUrl, "?").concat(params);
1156
1156
  };
1157
- /**
1158
- * 쓰로틀링 처리
1159
- * @returns
1157
+ /**
1158
+ * 쓰로틀링 처리
1159
+ * @returns
1160
1160
  */
1161
1161
 
1162
1162
 
@@ -1457,6 +1457,8 @@ function (_super) {
1457
1457
  __extends(NaverMintMapController, _super);
1458
1458
 
1459
1459
  function NaverMintMapController(props) {
1460
+ var _a;
1461
+
1460
1462
  var _this = _super.call(this, props) || this;
1461
1463
 
1462
1464
  _this.type = 'naver';
@@ -1470,7 +1472,12 @@ function (_super) {
1470
1472
  _this.polygonEvents = ['mouseover', 'mouseout'];
1471
1473
  _this.markerEvents = ['click', 'mouseover', 'mouseout'];
1472
1474
  _this.dragged = false;
1473
- _this.eventMap = new Map(); //contextmenu 는 지원하지 않지만 호환성을 위해 rightclick 으로 대체
1475
+ _this.eventMap = new Map(); //scriptModules 병합
1476
+
1477
+ if (props.scriptModules) {
1478
+ (_a = _this.scriptModules).push.apply(_a, props.scriptModules);
1479
+ } //contextmenu 는 지원하지 않지만 호환성을 위해 rightclick 으로 대체
1480
+
1474
1481
 
1475
1482
  _this.mapUIEvent.CONTEXTMENU = 'rightclick';
1476
1483
  Object.freeze(_this.mapEvent);
@@ -1691,11 +1698,11 @@ function (_super) {
1691
1698
  var map = marker.native.getMap();
1692
1699
 
1693
1700
  if (map) {
1694
- /** 중요!!!!
1695
- * naver 마커의 setOption(MarkerOptions) 은 내부적으로 setMap 을 무조건 강제 처리한다!!!
1696
- * setMap 을 처리하면 맵의 이벤트리스너 등등이 모두 초기화 되고 다시 맵을 add 하면서 마커관련된 모든 초기화가 다시 일어난다.
1697
- * (심지어 map 이 기존과 같은 객체인데도 초기화 처리함)
1698
- * 그래서 민트맵에서는 update 를 지원하는 항목별로 명시적으로 각각 처리한다.
1701
+ /** 중요!!!!
1702
+ * naver 마커의 setOption(MarkerOptions) 은 내부적으로 setMap 을 무조건 강제 처리한다!!!
1703
+ * setMap 을 처리하면 맵의 이벤트리스너 등등이 모두 초기화 되고 다시 맵을 add 하면서 마커관련된 모든 초기화가 다시 일어난다.
1704
+ * (심지어 map 이 기존과 같은 객체인데도 초기화 처리함)
1705
+ * 그래서 민트맵에서는 update 를 지원하는 항목별로 명시적으로 각각 처리한다.
1699
1706
  */
1700
1707
  //Position
1701
1708
  if (options.position && options.position instanceof Position) {
@@ -2181,6 +2188,8 @@ function (_super) {
2181
2188
  __extends(GoogleMintMapController, _super);
2182
2189
 
2183
2190
  function GoogleMintMapController(props) {
2191
+ var _a;
2192
+
2184
2193
  var _this = _super.call(this, props) || this;
2185
2194
 
2186
2195
  _this.type = 'google';
@@ -2207,9 +2216,14 @@ function (_super) {
2207
2216
 
2208
2217
  };
2209
2218
 
2210
- _this.eventMap = new Map(); //google 은 zoomstart 가 없으므로 zoom_changed 로 대체 (하지만 zooming 되는 내내 여러번 호출됨)
2219
+ _this.eventMap = new Map(); //scriptModules 병합
2220
+
2221
+ if (props.scriptModules) {
2222
+ (_a = _this.scriptModules).push.apply(_a, props.scriptModules);
2223
+ } //google 은 zoomstart 가 없으므로 zoom_changed 로 대체 (하지만 zooming 되는 내내 여러번 호출됨)
2211
2224
  //나중에 naver 와 마찬가지로 zoomstart 1번 zoom_changed 1번 호출되도록 바꾸는것 고려중
2212
2225
 
2226
+
2213
2227
  _this.mapEvent.ZOOMSTART = 'zoom_changed';
2214
2228
  Object.freeze(_this.mapEvent);
2215
2229
  Object.freeze(_this.mapUIEvent);
@@ -2865,6 +2879,8 @@ function (_super) {
2865
2879
  __extends(KakaoMintMapController, _super);
2866
2880
 
2867
2881
  function KakaoMintMapController(props) {
2882
+ var _a;
2883
+
2868
2884
  var _this = _super.call(this, props) || this;
2869
2885
 
2870
2886
  _this.type = 'kakao';
@@ -2878,7 +2894,12 @@ function (_super) {
2878
2894
  _this.polygonEvents = ['mouseover', 'mouseout'];
2879
2895
  _this.markerEvents = ['click', 'mouseover', 'mouseout'];
2880
2896
  _this.dragged = false;
2881
- _this.eventMap = new Map(); //kakao only 이벤트이름 재정의 zoom_start
2897
+ _this.eventMap = new Map(); //scriptModules 병합
2898
+
2899
+ if (props.scriptModules) {
2900
+ (_a = _this.scriptModules).push.apply(_a, props.scriptModules);
2901
+ } //kakao only 이벤트이름 재정의 zoom_start
2902
+
2882
2903
 
2883
2904
  _this.mapEvent.ZOOMSTART = 'zoom_start'; //contextmenu 는 지원하지 않지만 호환성을 위해 rightclick 으로 대체
2884
2905
 
@@ -3399,13 +3420,13 @@ function (_super) {
3399
3420
  };
3400
3421
 
3401
3422
  KakaoMintMapController.prototype.getSafeZoomValue = function (value) {
3402
- /**
3403
- * 카카오는 구글/네이버와 다르게 줌레벨이 작아질수록 확대된다 (가장 확대된 것이 0)
3404
- * - 가장 확대된 값 : 1
3405
- * - 가장 축소된 값 : 14
3406
- *
3407
- * 그래서 세계지도가 없는 카카오는 동일한 사정인 네이버와 매핑하기로 한다.
3408
- * 문제는 둘 간의 줌 레벨별 축척이 일치하지 않는다. 그래서 가장 유사한 레벨 끼리 매핑이 필요하다
3423
+ /**
3424
+ * 카카오는 구글/네이버와 다르게 줌레벨이 작아질수록 확대된다 (가장 확대된 것이 0)
3425
+ * - 가장 확대된 값 : 1
3426
+ * - 가장 축소된 값 : 14
3427
+ *
3428
+ * 그래서 세계지도가 없는 카카오는 동일한 사정인 네이버와 매핑하기로 한다.
3429
+ * 문제는 둘 간의 줌 레벨별 축척이 일치하지 않는다. 그래서 가장 유사한 레벨 끼리 매핑이 필요하다
3409
3430
  */
3410
3431
  var mapValue = this.getBaseToMapZoom(value);
3411
3432
 
@@ -3590,12 +3611,12 @@ var DEFAULT_CENTER = {
3590
3611
  lat: 37.5036845,
3591
3612
  lng: 127.0448698
3592
3613
  };
3593
- /**
3594
- * Mint Map 컴포넌트
3595
- *
3596
- * @param {MintMapProps} MintMapProps
3597
- *
3598
- * @returns {JSX.Element} JSX
3614
+ /**
3615
+ * Mint Map 컴포넌트
3616
+ *
3617
+ * @param {MintMapProps} MintMapProps
3618
+ *
3619
+ * @returns {JSX.Element} JSX
3599
3620
  */
3600
3621
 
3601
3622
  function MintMap(_a) {
@@ -3757,8 +3778,8 @@ var Marker =
3757
3778
  /** @class */
3758
3779
  function (_super) {
3759
3780
  __extends(Marker, _super);
3760
- /**
3761
- * 지도에 표시할 마커정보
3781
+ /**
3782
+ * 지도에 표시할 마커정보
3762
3783
  */
3763
3784
 
3764
3785
 
@@ -3776,8 +3797,8 @@ var Polyline =
3776
3797
  /** @class */
3777
3798
  function (_super) {
3778
3799
  __extends(Polyline, _super);
3779
- /**
3780
- * 지도에 표시할 폴리곤정보
3800
+ /**
3801
+ * 지도에 표시할 폴리곤정보
3781
3802
  */
3782
3803
 
3783
3804
 
@@ -3795,8 +3816,8 @@ var Polygon =
3795
3816
  /** @class */
3796
3817
  function (_super) {
3797
3818
  __extends(Polygon, _super);
3798
- /**
3799
- * 지도에 표시할 폴리곤정보
3819
+ /**
3820
+ * 지도에 표시할 폴리곤정보
3800
3821
  */
3801
3822
 
3802
3823
 
@@ -3806,8 +3827,8 @@ function (_super) {
3806
3827
  _this.options = options;
3807
3828
  return _this;
3808
3829
  }
3809
- /**
3810
- * 폴리곤의 중점을 구한다.
3830
+ /**
3831
+ * 폴리곤의 중점을 구한다.
3811
3832
  */
3812
3833
 
3813
3834
 
@@ -4153,17 +4174,17 @@ function useMarkerMoving(_a) {
4153
4174
  var offsetCalibration = function (mapType, divElement, options) {
4154
4175
  //google 맵의 anchor 보정 (네이버와 같이 왼쪽/위 기준으로 처리)
4155
4176
  if (mapType === 'google') {
4156
- divElement.style.transform = "translate(50%, 100%) translate(-".concat(options.anchor ? options.anchor.x : '0', "px, -").concat(options.anchor ? options.anchor.y : '0', "px)");
4177
+ divElement.style.transform = "translate(50%, 100%) translate(".concat(options.anchor ? options.anchor.x * -1 : '0', "px, ").concat(options.anchor ? options.anchor.y * -1 : '0', "px)");
4157
4178
  } else if (mapType === 'kakao') {
4158
- divElement.style.transform = "translate(-".concat(options.anchor ? options.anchor.x : '0', "px, -").concat(options.anchor ? options.anchor.y : '0', "px)");
4179
+ divElement.style.transform = "translate(".concat(options.anchor ? options.anchor.x * -1 : '0', "px, ").concat(options.anchor ? options.anchor.y * -1 : '0', "px)");
4159
4180
  }
4160
4181
  };
4161
- /**
4162
- * Mint Map 컴포넌트
4163
- *
4164
- * @param {MapControlWrapperProps} MapControlWrapperProps
4165
- *
4166
- * @returns {JSX.Element} JSX
4182
+ /**
4183
+ * Mint Map 컴포넌트
4184
+ *
4185
+ * @param {MapControlWrapperProps} MapControlWrapperProps
4186
+ *
4187
+ * @returns {JSX.Element} JSX
4167
4188
  */
4168
4189
 
4169
4190
 
@@ -4326,12 +4347,12 @@ function MapMarkerWrapper(_a) {
4326
4347
  return createPortal(children, divElement);
4327
4348
  }
4328
4349
 
4329
- /**
4330
- * CircleMarker
4331
- *
4332
- * @param {CircleMarkerProps} CircleMarkerProps
4333
- *
4334
- * @returns {JSX.Element} JSX
4350
+ /**
4351
+ * CircleMarker
4352
+ *
4353
+ * @param {CircleMarkerProps} CircleMarkerProps
4354
+ *
4355
+ * @returns {JSX.Element} JSX
4335
4356
  */
4336
4357
 
4337
4358
  function CircleMarker(_a) {
@@ -4447,12 +4468,12 @@ function CircleMarker(_a) {
4447
4468
  }, children)));
4448
4469
  }
4449
4470
 
4450
- /**
4451
- *PolygonMarker
4452
- *
4453
- * @param {PolygonMarkerProps} PolygonMarkerProps
4454
- *
4455
- * @returns {JSX.Element} JSX
4471
+ /**
4472
+ *PolygonMarker
4473
+ *
4474
+ * @param {PolygonMarkerProps} PolygonMarkerProps
4475
+ *
4476
+ * @returns {JSX.Element} JSX
4456
4477
  */
4457
4478
 
4458
4479
  function PolygonMarker(_a) {
@@ -4623,12 +4644,12 @@ function PolygonMarker(_a) {
4623
4644
  }, children)));
4624
4645
  }
4625
4646
 
4626
- /**
4627
- * Mint Map 컴포넌트
4628
- *
4629
- * @param {MapControlWrapperProps} MapControlWrapperProps
4630
- *
4631
- * @returns {JSX.Element} JSX
4647
+ /**
4648
+ * Mint Map 컴포넌트
4649
+ *
4650
+ * @param {MapControlWrapperProps} MapControlWrapperProps
4651
+ *
4652
+ * @returns {JSX.Element} JSX
4632
4653
  */
4633
4654
 
4634
4655
  function MapPolygonWrapper(_a) {
@@ -5074,12 +5095,12 @@ var styles = {"mint-map-control-wrapper-container":"MintMapWrapper-module_mint-m
5074
5095
  styleInject(css_248z);
5075
5096
 
5076
5097
  var cn = classNames.bind(styles);
5077
- /**
5078
- * Mint Map 컴포넌트
5079
- *
5080
- * @param {MapControlWrapperProps} MapControlWrapperProps
5081
- *
5082
- * @returns {JSX.Element} JSX
5098
+ /**
5099
+ * Mint Map 컴포넌트
5100
+ *
5101
+ * @param {MapControlWrapperProps} MapControlWrapperProps
5102
+ *
5103
+ * @returns {JSX.Element} JSX
5083
5104
  */
5084
5105
 
5085
5106
  function MapControlWrapper(_a) {
@@ -5107,12 +5128,12 @@ function MapControlWrapper(_a) {
5107
5128
  }, children));
5108
5129
  }
5109
5130
 
5110
- /**
5111
- * Mint Map 컴포넌트
5112
- *
5113
- * @param {MapControlWrapperProps} MapControlWrapperProps
5114
- *
5115
- * @returns {JSX.Element} JSX
5131
+ /**
5132
+ * Mint Map 컴포넌트
5133
+ *
5134
+ * @param {MapControlWrapperProps} MapControlWrapperProps
5135
+ *
5136
+ * @returns {JSX.Element} JSX
5116
5137
  */
5117
5138
 
5118
5139
  function MapPolylineWrapper(_a) {
@@ -5153,12 +5174,12 @@ var console$1 = {
5153
5174
  log: function () {
5154
5175
  }
5155
5176
  };
5156
- /**
5157
- * Mint Map 컴포넌트
5158
- *
5159
- * @param {MapControlWrapperProps} MapControlWrapperProps
5160
- *
5161
- * @returns {JSX.Element} JSX
5177
+ /**
5178
+ * Mint Map 컴포넌트
5179
+ *
5180
+ * @param {MapControlWrapperProps} MapControlWrapperProps
5181
+ *
5182
+ * @returns {JSX.Element} JSX
5162
5183
  */
5163
5184
 
5164
5185
  function MapCanvasWrapper(_a) {
@@ -5477,12 +5498,12 @@ function MapCanvasWrapper(_a) {
5477
5498
  }), renderFlag && React.createElement(React.Fragment, null));
5478
5499
  }
5479
5500
 
5480
- /**
5481
- * Mint Map 컴포넌트
5482
- *
5483
- * @param {MapControlWrapperProps} MapControlWrapperProps
5484
- *
5485
- * @returns {JSX.Element} JSX
5501
+ /**
5502
+ * Mint Map 컴포넌트
5503
+ *
5504
+ * @param {MapControlWrapperProps} MapControlWrapperProps
5505
+ *
5506
+ * @returns {JSX.Element} JSX
5486
5507
  */
5487
5508
 
5488
5509
  function MapCanvasMarkerWrapper(_props) {