@mint-ui/map 0.7.4-beta → 0.8.0-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 +27 -18
  6. package/dist/components/mint-map/core/MintMapCanvasRenderer.d.ts +4 -4
  7. package/dist/components/mint-map/core/MintMapController.d.ts +69 -69
  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 +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 +19 -19
  40. package/dist/components/mint-map/core/wrapper/MapControlWrapper.js +6 -6
  41. package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.d.ts +51 -51
  42. package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.js +6 -6
  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 +53 -53
  49. package/dist/components/mint-map/index.d.ts +5 -5
  50. package/dist/components/mint-map/kakao/KakaoMintMapController.d.ts +57 -57
  51. package/dist/components/mint-map/kakao/KakaoMintMapController.js +7 -7
  52. package/dist/components/mint-map/naver/NaverMintMapController.d.ts +55 -55
  53. package/dist/components/mint-map/naver/NaverMintMapController.js +6 -6
  54. package/dist/components/mint-map/types/CommonTypes.d.ts +11 -11
  55. package/dist/components/mint-map/types/MapDrawables.d.ts +118 -118
  56. package/dist/components/mint-map/types/MapDrawables.js +8 -8
  57. package/dist/components/mint-map/types/MapEventTypes.d.ts +44 -44
  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 +106 -106
  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 +118 -109
  65. package/dist/index.umd.js +118 -109
  66. 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
 
@@ -1154,9 +1154,9 @@ function () {
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
 
@@ -1515,7 +1515,7 @@ function (_super) {
1515
1515
 
1516
1516
  _this.type = 'naver';
1517
1517
  _this.map = null;
1518
- _this.scriptUrl = 'https://openapi.map.naver.com/openapi/v3/maps.js';
1518
+ _this.scriptUrl = 'https://oapi.map.naver.com/openapi/v3/maps.js';
1519
1519
  _this.scriptModules = ['drawing']; // , 'geocoder' , 'panorama' , 'visualization']
1520
1520
 
1521
1521
  _this.mapEvent = new MapEvent();
@@ -1750,11 +1750,11 @@ function (_super) {
1750
1750
  var map = marker.native.getMap();
1751
1751
 
1752
1752
  if (map) {
1753
- /** 중요!!!!
1754
- * naver 마커의 setOption(MarkerOptions) 은 내부적으로 setMap 을 무조건 강제 처리한다!!!
1755
- * setMap 을 처리하면 맵의 이벤트리스너 등등이 모두 초기화 되고 다시 맵을 add 하면서 마커관련된 모든 초기화가 다시 일어난다.
1756
- * (심지어 map 이 기존과 같은 객체인데도 초기화 처리함)
1757
- * 그래서 민트맵에서는 update 를 지원하는 항목별로 명시적으로 각각 처리한다.
1753
+ /** 중요!!!!
1754
+ * naver 마커의 setOption(MarkerOptions) 은 내부적으로 setMap 을 무조건 강제 처리한다!!!
1755
+ * setMap 을 처리하면 맵의 이벤트리스너 등등이 모두 초기화 되고 다시 맵을 add 하면서 마커관련된 모든 초기화가 다시 일어난다.
1756
+ * (심지어 map 이 기존과 같은 객체인데도 초기화 처리함)
1757
+ * 그래서 민트맵에서는 update 를 지원하는 항목별로 명시적으로 각각 처리한다.
1758
1758
  */
1759
1759
  //Position
1760
1760
  if (options.position && options.position instanceof Position) {
@@ -3494,13 +3494,13 @@ function (_super) {
3494
3494
  };
3495
3495
 
3496
3496
  KakaoMintMapController.prototype.getSafeZoomValue = function (value) {
3497
- /**
3498
- * 카카오는 구글/네이버와 다르게 줌레벨이 작아질수록 확대된다 (가장 확대된 것이 0)
3499
- * - 가장 확대된 값 : 1
3500
- * - 가장 축소된 값 : 14
3501
- *
3502
- * 그래서 세계지도가 없는 카카오는 동일한 사정인 네이버와 매핑하기로 한다.
3503
- * 문제는 둘 간의 줌 레벨별 축척이 일치하지 않는다. 그래서 가장 유사한 레벨 끼리 매핑이 필요하다
3497
+ /**
3498
+ * 카카오는 구글/네이버와 다르게 줌레벨이 작아질수록 확대된다 (가장 확대된 것이 0)
3499
+ * - 가장 확대된 값 : 1
3500
+ * - 가장 축소된 값 : 14
3501
+ *
3502
+ * 그래서 세계지도가 없는 카카오는 동일한 사정인 네이버와 매핑하기로 한다.
3503
+ * 문제는 둘 간의 줌 레벨별 축척이 일치하지 않는다. 그래서 가장 유사한 레벨 끼리 매핑이 필요하다
3504
3504
  */
3505
3505
  var mapValue = this.getBaseToMapZoom(value);
3506
3506
 
@@ -3692,32 +3692,41 @@ var DEFAULT_CENTER = {
3692
3692
  lat: 37.5036845,
3693
3693
  lng: 127.0448698
3694
3694
  };
3695
- /**
3696
- * Mint Map 컴포넌트
3697
- *
3698
- * @param {MintMapProps} MintMapProps
3699
- *
3700
- * @returns {JSX.Element} JSX
3695
+ var DEFAULT_ZOOM_LEVEL = 12;
3696
+ var DEFAULT_MAP_BASE_CONFIG = {
3697
+ center: DEFAULT_CENTER,
3698
+ zoomLevel: DEFAULT_ZOOM_LEVEL
3699
+ };
3700
+
3701
+ function makeBaseProps(base) {
3702
+ !base.center && (base.center = DEFAULT_CENTER);
3703
+ !base.zoomLevel && (base.zoomLevel = DEFAULT_ZOOM_LEVEL);
3704
+ return base;
3705
+ }
3706
+ /**
3707
+ * Mint Map 컴포넌트
3708
+ *
3709
+ * @param {MintMapProps} MintMapProps
3710
+ *
3711
+ * @returns {JSX.Element} JSX
3701
3712
  */
3702
3713
 
3714
+
3703
3715
  function MintMap(_a) {
3704
3716
  var mapLoadingComponent = _a.mapLoadingComponent,
3705
3717
  _b = _a.dissolveEffectWhenLoaded,
3706
3718
  dissolveEffectWhenLoaded = _b === void 0 ? true : _b,
3707
3719
  mapType = _a.mapType,
3708
3720
  children = _a.children,
3709
- _c = _a.base,
3710
- base = _c === void 0 ? {
3711
- center: DEFAULT_CENTER,
3712
- zoomLevel: 12
3713
- } : _c,
3721
+ base = _a.base,
3714
3722
  props = __rest(_a, ["mapLoadingComponent", "dissolveEffectWhenLoaded", "mapType", "children", "base"]);
3715
3723
 
3724
+ var mapBaseConfig = base ? makeBaseProps(base) : DEFAULT_MAP_BASE_CONFIG;
3716
3725
  var loadingRef = useRef(null);
3717
3726
 
3718
- var _d = useState(),
3719
- controller = _d[0],
3720
- setController = _d[1];
3727
+ var _c = useState(),
3728
+ controller = _c[0],
3729
+ setController = _c[1];
3721
3730
 
3722
3731
  var loading = useMemo(function () {
3723
3732
  return mapLoadingComponent ? mapLoadingComponent() : React.createElement(React.Fragment, null);
@@ -3734,15 +3743,15 @@ function MintMap(_a) {
3734
3743
  var newController_1 = mapType === 'naver' ? new NaverMintMapController(__assign(__assign({
3735
3744
  mapType: mapType
3736
3745
  }, props), {
3737
- base: base
3746
+ base: mapBaseConfig
3738
3747
  })) : mapType === 'google' ? new GoogleMintMapController(__assign(__assign({
3739
3748
  mapType: mapType
3740
3749
  }, props), {
3741
- base: base
3750
+ base: mapBaseConfig
3742
3751
  })) : mapType === 'kakao' ? new KakaoMintMapController(__assign(__assign({
3743
3752
  mapType: mapType
3744
3753
  }, props), {
3745
- base: base
3754
+ base: mapBaseConfig
3746
3755
  })) : null;
3747
3756
  newController_1 && (prevController.current = newController_1);
3748
3757
 
@@ -3778,7 +3787,7 @@ function MintMap(_a) {
3778
3787
  }), React.createElement(MintMapCore, __assign({
3779
3788
  mapType: mapType
3780
3789
  }, props, {
3781
- base: base
3790
+ base: mapBaseConfig
3782
3791
  }), children)) : React.createElement(React.Fragment, null, dissolveEffectWhenLoaded && React.createElement("div", {
3783
3792
  ref: function (refs) {
3784
3793
  loadingRef.current = refs;
@@ -3859,8 +3868,8 @@ var Marker =
3859
3868
  /** @class */
3860
3869
  function (_super) {
3861
3870
  __extends(Marker, _super);
3862
- /**
3863
- * 지도에 표시할 마커정보
3871
+ /**
3872
+ * 지도에 표시할 마커정보
3864
3873
  */
3865
3874
 
3866
3875
 
@@ -3878,8 +3887,8 @@ var Polyline =
3878
3887
  /** @class */
3879
3888
  function (_super) {
3880
3889
  __extends(Polyline, _super);
3881
- /**
3882
- * 지도에 표시할 폴리곤정보
3890
+ /**
3891
+ * 지도에 표시할 폴리곤정보
3883
3892
  */
3884
3893
 
3885
3894
 
@@ -3897,8 +3906,8 @@ var Polygon =
3897
3906
  /** @class */
3898
3907
  function (_super) {
3899
3908
  __extends(Polygon, _super);
3900
- /**
3901
- * 지도에 표시할 폴리곤정보
3909
+ /**
3910
+ * 지도에 표시할 폴리곤정보
3902
3911
  */
3903
3912
 
3904
3913
 
@@ -3908,8 +3917,8 @@ function (_super) {
3908
3917
  _this.options = options;
3909
3918
  return _this;
3910
3919
  }
3911
- /**
3912
- * 폴리곤의 중점을 구한다.
3920
+ /**
3921
+ * 폴리곤의 중점을 구한다.
3913
3922
  */
3914
3923
 
3915
3924
 
@@ -4329,12 +4338,12 @@ var getMarkersFitPosition = function (containerPosition, containerSize, markerPo
4329
4338
 
4330
4339
  return 0;
4331
4340
  };
4332
- /**
4333
- * Mint Map 컴포넌트
4334
- *
4335
- * @param {MapControlWrapperProps} MapControlWrapperProps
4336
- *
4337
- * @returns {JSX.Element} JSX
4341
+ /**
4342
+ * Mint Map 컴포넌트
4343
+ *
4344
+ * @param {MapControlWrapperProps} MapControlWrapperProps
4345
+ *
4346
+ * @returns {JSX.Element} JSX
4338
4347
  */
4339
4348
 
4340
4349
 
@@ -4504,12 +4513,12 @@ function MapMarkerWrapper(_a) {
4504
4513
  return createPortal(children, divElement);
4505
4514
  }
4506
4515
 
4507
- /**
4508
- * CircleMarker
4509
- *
4510
- * @param {CircleMarkerProps} CircleMarkerProps
4511
- *
4512
- * @returns {JSX.Element} JSX
4516
+ /**
4517
+ * CircleMarker
4518
+ *
4519
+ * @param {CircleMarkerProps} CircleMarkerProps
4520
+ *
4521
+ * @returns {JSX.Element} JSX
4513
4522
  */
4514
4523
 
4515
4524
  function CircleMarker(_a) {
@@ -4625,12 +4634,12 @@ function CircleMarker(_a) {
4625
4634
  }, children)));
4626
4635
  }
4627
4636
 
4628
- /**
4629
- *PolygonMarker
4630
- *
4631
- * @param {PolygonMarkerProps} PolygonMarkerProps
4632
- *
4633
- * @returns {JSX.Element} JSX
4637
+ /**
4638
+ *PolygonMarker
4639
+ *
4640
+ * @param {PolygonMarkerProps} PolygonMarkerProps
4641
+ *
4642
+ * @returns {JSX.Element} JSX
4634
4643
  */
4635
4644
 
4636
4645
  function PolygonMarker(_a) {
@@ -4799,12 +4808,12 @@ function PolygonMarker(_a) {
4799
4808
  }, children)));
4800
4809
  }
4801
4810
 
4802
- /**
4803
- * Mint Map 컴포넌트
4804
- *
4805
- * @param {MapControlWrapperProps} MapControlWrapperProps
4806
- *
4807
- * @returns {JSX.Element} JSX
4811
+ /**
4812
+ * Mint Map 컴포넌트
4813
+ *
4814
+ * @param {MapControlWrapperProps} MapControlWrapperProps
4815
+ *
4816
+ * @returns {JSX.Element} JSX
4808
4817
  */
4809
4818
 
4810
4819
  function MapPolygonWrapper(_a) {
@@ -5250,12 +5259,12 @@ var styles = {"mint-map-control-wrapper-container":"MintMapWrapper-module_mint-m
5250
5259
  styleInject(css_248z);
5251
5260
 
5252
5261
  var cn = classNames.bind(styles);
5253
- /**
5254
- * Mint Map 컴포넌트
5255
- *
5256
- * @param {MapControlWrapperProps} MapControlWrapperProps
5257
- *
5258
- * @returns {JSX.Element} JSX
5262
+ /**
5263
+ * Mint Map 컴포넌트
5264
+ *
5265
+ * @param {MapControlWrapperProps} MapControlWrapperProps
5266
+ *
5267
+ * @returns {JSX.Element} JSX
5259
5268
  */
5260
5269
 
5261
5270
  function MapControlWrapper(_a) {
@@ -5285,12 +5294,12 @@ function MapControlWrapper(_a) {
5285
5294
  }, children));
5286
5295
  }
5287
5296
 
5288
- /**
5289
- * Mint Map 컴포넌트
5290
- *
5291
- * @param {MapControlWrapperProps} MapControlWrapperProps
5292
- *
5293
- * @returns {JSX.Element} JSX
5297
+ /**
5298
+ * Mint Map 컴포넌트
5299
+ *
5300
+ * @param {MapControlWrapperProps} MapControlWrapperProps
5301
+ *
5302
+ * @returns {JSX.Element} JSX
5294
5303
  */
5295
5304
 
5296
5305
  function MapPolylineWrapper(_a) {
@@ -5331,12 +5340,12 @@ var console$1 = {
5331
5340
  log: function () {
5332
5341
  }
5333
5342
  };
5334
- /**
5335
- * Mint Map 컴포넌트
5336
- *
5337
- * @param {MapControlWrapperProps} MapControlWrapperProps
5338
- *
5339
- * @returns {JSX.Element} JSX
5343
+ /**
5344
+ * Mint Map 컴포넌트
5345
+ *
5346
+ * @param {MapControlWrapperProps} MapControlWrapperProps
5347
+ *
5348
+ * @returns {JSX.Element} JSX
5340
5349
  */
5341
5350
 
5342
5351
  function MapCanvasWrapper(_a) {
@@ -5655,12 +5664,12 @@ function MapCanvasWrapper(_a) {
5655
5664
  }), renderFlag && React.createElement(React.Fragment, null));
5656
5665
  }
5657
5666
 
5658
- /**
5659
- * Mint Map 컴포넌트
5660
- *
5661
- * @param {MapControlWrapperProps} MapControlWrapperProps
5662
- *
5663
- * @returns {JSX.Element} JSX
5667
+ /**
5668
+ * Mint Map 컴포넌트
5669
+ *
5670
+ * @param {MapControlWrapperProps} MapControlWrapperProps
5671
+ *
5672
+ * @returns {JSX.Element} JSX
5664
5673
  */
5665
5674
 
5666
5675
  function MapCanvasMarkerWrapper(_props) {