@mint-ui/map 0.5.11-beta → 0.6.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.
- package/dist/components/mint-map/core/MintMapController.d.ts +1 -0
- package/dist/components/mint-map/core/MintMapController.js +1 -1
- package/dist/components/mint-map/core/advanced/shapes/base/SVGCircle.js +2 -1
- package/dist/components/mint-map/core/advanced/shapes/base/SVGRect.js +2 -1
- package/dist/components/mint-map/core/wrapper/MapControlWrapper.d.ts +2 -2
- package/dist/components/mint-map/core/wrapper/MapControlWrapper.js +11 -50
- package/dist/components/mint-map/core/wrapper/MintMapWrapper.module.scss.js +2 -2
- package/dist/components/mint-map/google/GoogleMintMapController.js +8 -1
- package/dist/components/mint-map/kakao/KakaoMintMapController.js +8 -1
- package/dist/components/mint-map/naver/NaverMintMapController.js +8 -1
- package/dist/components/mint-map/types/MintMapProps.d.ts +5 -0
- package/dist/index.es.js +42 -58
- package/dist/index.umd.js +42 -58
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@ export declare abstract class MintMapController {
|
|
|
7
7
|
abstract type: MapType;
|
|
8
8
|
abstract map: MapVendorType | null;
|
|
9
9
|
abstract scriptUrl: string;
|
|
10
|
+
abstract scriptModules: string[];
|
|
10
11
|
abstract initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
|
|
11
12
|
abstract destroyMap(): void;
|
|
12
13
|
abstract loadMapApi(): Promise<boolean>;
|
|
@@ -124,7 +124,7 @@ function () {
|
|
|
124
124
|
var params = Object.entries(param).map(function (_a) {
|
|
125
125
|
var key = _a[0],
|
|
126
126
|
value = _a[1];
|
|
127
|
-
var temp =
|
|
127
|
+
var temp = Array.isArray(value) ? value.join(',') : value;
|
|
128
128
|
return "".concat(key, "=").concat(temp);
|
|
129
129
|
}).join('&');
|
|
130
130
|
return "".concat(baseUrl, "?").concat(params);
|
|
@@ -32,7 +32,8 @@ function SVGCircle(_a) {
|
|
|
32
32
|
pointerEvents: "none",
|
|
33
33
|
width: boxSize,
|
|
34
34
|
height: boxSize,
|
|
35
|
-
viewBox: "0 0 ".concat(boxSize, " ").concat(boxSize)
|
|
35
|
+
viewBox: "0 0 ".concat(boxSize, " ").concat(boxSize),
|
|
36
|
+
overflow: 'visible'
|
|
36
37
|
}, svgProperties), React__default["default"].createElement("circle", tslib.__assign({
|
|
37
38
|
pointerEvents: "visiblepainted",
|
|
38
39
|
cx: radius,
|
|
@@ -37,7 +37,8 @@ function SVGRect(_a) {
|
|
|
37
37
|
pointerEvents: "none",
|
|
38
38
|
width: width,
|
|
39
39
|
height: height,
|
|
40
|
-
viewBox: "0 0 ".concat(viewWidth.current, " ").concat(viewHeight)
|
|
40
|
+
viewBox: "0 0 ".concat(viewWidth.current, " ").concat(viewHeight),
|
|
41
|
+
overflow: 'visible'
|
|
41
42
|
}, svgProperties), React__default["default"].createElement("rect", tslib.__assign({
|
|
42
43
|
pointerEvents: "visiblepainted",
|
|
43
44
|
x: "0",
|
|
@@ -2,8 +2,8 @@ import { PropsWithChildren } from "react";
|
|
|
2
2
|
declare type AlignHorizontal = 'left' | 'right' | 'center';
|
|
3
3
|
declare type AlignVertical = 'top' | 'bottom' | 'center';
|
|
4
4
|
export interface MapControlWrapperProps {
|
|
5
|
-
width?:
|
|
6
|
-
height?:
|
|
5
|
+
width?: string | number;
|
|
6
|
+
height?: string | number;
|
|
7
7
|
positionHorizontal?: AlignHorizontal;
|
|
8
8
|
positionVertical?: AlignVertical;
|
|
9
9
|
}
|
|
@@ -12,48 +12,6 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
12
12
|
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
13
13
|
|
|
14
14
|
var cn = classNames__default["default"].bind(MintMapWrapper_module);
|
|
15
|
-
|
|
16
|
-
var getSizeString = function (size) {
|
|
17
|
-
return typeof size === 'string' ? size.replace(/ /g, '') : "".concat(size, "px");
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
var getAlignPosition = function (value, align) {
|
|
21
|
-
if (typeof value === 'string') {
|
|
22
|
-
var trimmed = value.replace(/ /g, '');
|
|
23
|
-
console.log('trimmed:', trimmed);
|
|
24
|
-
var isPercent = trimmed.endsWith('%');
|
|
25
|
-
|
|
26
|
-
if (!isPercent && !trimmed.endsWith('px')) {
|
|
27
|
-
throw new Error("Size [".concat(value, "] is not valid string value."));
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
var numberPart = isPercent ? trimmed.substring(0, trimmed.length - 2) : trimmed.substring(0, trimmed.length - 3);
|
|
31
|
-
var unit = isPercent ? '%' : 'px';
|
|
32
|
-
var numberValue = Number(numberPart);
|
|
33
|
-
|
|
34
|
-
if (isNaN(numberValue)) {
|
|
35
|
-
throw new Error("Size [".concat(value, "] is not valid % or pixel number value."));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
if (align === 'center') {
|
|
39
|
-
return "calc(50% - ".concat(numberValue / 2).concat(unit, ")");
|
|
40
|
-
} else if (align === 'right' || align === 'bottom') {
|
|
41
|
-
return "calc(100% - ".concat(numberValue).concat(unit, ")");
|
|
42
|
-
} else {
|
|
43
|
-
return '0px';
|
|
44
|
-
}
|
|
45
|
-
} else if (typeof value === 'number') {
|
|
46
|
-
if (align === 'center') {
|
|
47
|
-
return "calc(50% - ".concat(value / 2, "px)");
|
|
48
|
-
} else if (align === 'right' || align === 'bottom') {
|
|
49
|
-
return "calc(100% - ".concat(value, "px)");
|
|
50
|
-
} else {
|
|
51
|
-
return '0px';
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
throw new Error("Size [".concat(value, "] is not valid. (Should be % or pixel number)"));
|
|
56
|
-
};
|
|
57
15
|
/**
|
|
58
16
|
* Mint Map 컴포넌트
|
|
59
17
|
*
|
|
@@ -62,26 +20,29 @@ var getAlignPosition = function (value, align) {
|
|
|
62
20
|
* @returns {JSX.Element} JSX
|
|
63
21
|
*/
|
|
64
22
|
|
|
65
|
-
|
|
66
23
|
function MapControlWrapper(_a) {
|
|
67
24
|
var _b = _a.width,
|
|
68
|
-
width = _b === void 0 ?
|
|
25
|
+
width = _b === void 0 ? 'fit-content' : _b,
|
|
69
26
|
_c = _a.height,
|
|
70
|
-
height = _c === void 0 ?
|
|
27
|
+
height = _c === void 0 ? 'fit-content' : _c,
|
|
71
28
|
_d = _a.positionHorizontal,
|
|
72
29
|
positionHorizontal = _d === void 0 ? 'left' : _d,
|
|
73
30
|
_e = _a.positionVertical,
|
|
74
31
|
positionVertical = _e === void 0 ? 'top' : _e,
|
|
75
32
|
children = _a.children;
|
|
76
33
|
return React__default["default"].createElement("div", {
|
|
34
|
+
className: cn('mint-map-control-wrapper-container'),
|
|
35
|
+
style: {
|
|
36
|
+
justifyContent: positionHorizontal === 'center' ? 'center' : positionHorizontal === 'right' ? 'flex-end' : 'flex-start',
|
|
37
|
+
alignItems: positionVertical === 'center' ? 'center' : positionVertical === 'bottom' ? 'flex-end' : 'flex-start'
|
|
38
|
+
}
|
|
39
|
+
}, React__default["default"].createElement("div", {
|
|
77
40
|
className: cn('mint-map-control-wrapper'),
|
|
78
41
|
style: {
|
|
79
|
-
width:
|
|
80
|
-
height:
|
|
81
|
-
left: getAlignPosition(width, positionHorizontal),
|
|
82
|
-
top: getAlignPosition(height, positionVertical)
|
|
42
|
+
width: width,
|
|
43
|
+
height: height
|
|
83
44
|
}
|
|
84
|
-
}, children);
|
|
45
|
+
}, children));
|
|
85
46
|
}
|
|
86
47
|
|
|
87
48
|
exports.MapControlWrapper = MapControlWrapper;
|
|
@@ -6,8 +6,8 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
6
6
|
|
|
7
7
|
var styleInject__default = /*#__PURE__*/_interopDefaultLegacy(styleInject);
|
|
8
8
|
|
|
9
|
-
var css_248z = ".MintMapWrapper-module_mint-map-control-
|
|
10
|
-
var styles = {"mint-map-control-wrapper":"MintMapWrapper-module_mint-map-control-wrapper__DDb4y","mint-map-overlay-wrapper":"MintMapWrapper-module_mint-map-overlay-wrapper__Jn4wV"};
|
|
9
|
+
var css_248z = ".MintMapWrapper-module_mint-map-control-wrapper-container__DONh7 {\n position: absolute;\n width: 100%;\n height: 100%;\n display: flex;\n pointer-events: none;\n z-index: 101;\n}\n\n.MintMapWrapper-module_mint-map-control-wrapper__DDb4y {\n pointer-events: auto;\n}\n\n.MintMapWrapper-module_mint-map-overlay-wrapper__Jn4wV {\n position: absolute;\n z-index: 1;\n}";
|
|
10
|
+
var styles = {"mint-map-control-wrapper-container":"MintMapWrapper-module_mint-map-control-wrapper-container__DONh7","mint-map-control-wrapper":"MintMapWrapper-module_mint-map-control-wrapper__DDb4y","mint-map-overlay-wrapper":"MintMapWrapper-module_mint-map-overlay-wrapper__Jn4wV"};
|
|
11
11
|
styleInject__default["default"](css_248z);
|
|
12
12
|
|
|
13
13
|
module.exports = styles;
|
|
@@ -16,6 +16,8 @@ function (_super) {
|
|
|
16
16
|
tslib.__extends(GoogleMintMapController, _super);
|
|
17
17
|
|
|
18
18
|
function GoogleMintMapController(props) {
|
|
19
|
+
var _a;
|
|
20
|
+
|
|
19
21
|
var _this = _super.call(this, props) || this;
|
|
20
22
|
|
|
21
23
|
_this.type = 'google';
|
|
@@ -42,9 +44,14 @@ function (_super) {
|
|
|
42
44
|
|
|
43
45
|
};
|
|
44
46
|
|
|
45
|
-
_this.eventMap = new Map(); //
|
|
47
|
+
_this.eventMap = new Map(); //scriptModules 병합
|
|
48
|
+
|
|
49
|
+
if (props.scriptModules) {
|
|
50
|
+
(_a = _this.scriptModules).push.apply(_a, props.scriptModules);
|
|
51
|
+
} //google 은 zoomstart 가 없으므로 zoom_changed 로 대체 (하지만 zooming 되는 내내 여러번 호출됨)
|
|
46
52
|
//나중에 naver 와 마찬가지로 zoomstart 1번 zoom_changed 1번 호출되도록 바꾸는것 고려중
|
|
47
53
|
|
|
54
|
+
|
|
48
55
|
_this.mapEvent.ZOOMSTART = 'zoom_changed';
|
|
49
56
|
Object.freeze(_this.mapEvent);
|
|
50
57
|
Object.freeze(_this.mapUIEvent);
|
|
@@ -17,6 +17,8 @@ function (_super) {
|
|
|
17
17
|
tslib.__extends(KakaoMintMapController, _super);
|
|
18
18
|
|
|
19
19
|
function KakaoMintMapController(props) {
|
|
20
|
+
var _a;
|
|
21
|
+
|
|
20
22
|
var _this = _super.call(this, props) || this;
|
|
21
23
|
|
|
22
24
|
_this.type = 'kakao';
|
|
@@ -30,7 +32,12 @@ function (_super) {
|
|
|
30
32
|
_this.polygonEvents = ['mouseover', 'mouseout'];
|
|
31
33
|
_this.markerEvents = ['click', 'mouseover', 'mouseout'];
|
|
32
34
|
_this.dragged = false;
|
|
33
|
-
_this.eventMap = new Map(); //
|
|
35
|
+
_this.eventMap = new Map(); //scriptModules 병합
|
|
36
|
+
|
|
37
|
+
if (props.scriptModules) {
|
|
38
|
+
(_a = _this.scriptModules).push.apply(_a, props.scriptModules);
|
|
39
|
+
} //kakao only 이벤트이름 재정의 zoom_start
|
|
40
|
+
|
|
34
41
|
|
|
35
42
|
_this.mapEvent.ZOOMSTART = 'zoom_start'; //contextmenu 는 지원하지 않지만 호환성을 위해 rightclick 으로 대체
|
|
36
43
|
|
|
@@ -17,6 +17,8 @@ function (_super) {
|
|
|
17
17
|
tslib.__extends(NaverMintMapController, _super);
|
|
18
18
|
|
|
19
19
|
function NaverMintMapController(props) {
|
|
20
|
+
var _a;
|
|
21
|
+
|
|
20
22
|
var _this = _super.call(this, props) || this;
|
|
21
23
|
|
|
22
24
|
_this.type = 'naver';
|
|
@@ -30,7 +32,12 @@ function (_super) {
|
|
|
30
32
|
_this.polygonEvents = ['mouseover', 'mouseout'];
|
|
31
33
|
_this.markerEvents = ['click', 'mouseover', 'mouseout'];
|
|
32
34
|
_this.dragged = false;
|
|
33
|
-
_this.eventMap = new Map(); //
|
|
35
|
+
_this.eventMap = new Map(); //scriptModules 병합
|
|
36
|
+
|
|
37
|
+
if (props.scriptModules) {
|
|
38
|
+
(_a = _this.scriptModules).push.apply(_a, props.scriptModules);
|
|
39
|
+
} //contextmenu 는 지원하지 않지만 호환성을 위해 rightclick 으로 대체
|
|
40
|
+
|
|
34
41
|
|
|
35
42
|
_this.mapUIEvent.CONTEXTMENU = 'rightclick';
|
|
36
43
|
Object.freeze(_this.mapEvent);
|
|
@@ -15,6 +15,11 @@ export interface MintMapProps extends MintMapEvents {
|
|
|
15
15
|
* @description 각 지도 타입에 맞는 키를 입력해야한다.
|
|
16
16
|
*/
|
|
17
17
|
mapKey: string;
|
|
18
|
+
/**
|
|
19
|
+
* Map Script 로드시에 지도 타입에 따라 로드할 서브 모듈 목록
|
|
20
|
+
* @description 각 지도 타입에 맞는 서브모듈을 지정해야한다.
|
|
21
|
+
*/
|
|
22
|
+
scriptModules?: string[];
|
|
18
23
|
/**
|
|
19
24
|
* Map 종류에 따른 추가 맵 ID
|
|
20
25
|
* @description 특정 지도에서는 맵ID 가 추가로 요구된다 (ex: Google Maps)
|
package/dist/index.es.js
CHANGED
|
@@ -1149,7 +1149,7 @@ 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 =
|
|
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);
|
|
@@ -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(); //
|
|
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);
|
|
@@ -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(); //
|
|
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(); //
|
|
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
|
|
|
@@ -3725,7 +3746,8 @@ function SVGCircle(_a) {
|
|
|
3725
3746
|
pointerEvents: "none",
|
|
3726
3747
|
width: boxSize,
|
|
3727
3748
|
height: boxSize,
|
|
3728
|
-
viewBox: "0 0 ".concat(boxSize, " ").concat(boxSize)
|
|
3749
|
+
viewBox: "0 0 ".concat(boxSize, " ").concat(boxSize),
|
|
3750
|
+
overflow: 'visible'
|
|
3729
3751
|
}, svgProperties), React.createElement("circle", __assign({
|
|
3730
3752
|
pointerEvents: "visiblepainted",
|
|
3731
3753
|
cx: radius,
|
|
@@ -3984,7 +4006,8 @@ function SVGRect(_a) {
|
|
|
3984
4006
|
pointerEvents: "none",
|
|
3985
4007
|
width: width,
|
|
3986
4008
|
height: height,
|
|
3987
|
-
viewBox: "0 0 ".concat(viewWidth.current, " ").concat(viewHeight)
|
|
4009
|
+
viewBox: "0 0 ".concat(viewWidth.current, " ").concat(viewHeight),
|
|
4010
|
+
overflow: 'visible'
|
|
3988
4011
|
}, svgProperties), React.createElement("rect", __assign({
|
|
3989
4012
|
pointerEvents: "visiblepainted",
|
|
3990
4013
|
x: "0",
|
|
@@ -5067,53 +5090,11 @@ function LoadingImage(_a) {
|
|
|
5067
5090
|
}))));
|
|
5068
5091
|
}
|
|
5069
5092
|
|
|
5070
|
-
var css_248z = ".MintMapWrapper-module_mint-map-control-
|
|
5071
|
-
var styles = {"mint-map-control-wrapper":"MintMapWrapper-module_mint-map-control-wrapper__DDb4y","mint-map-overlay-wrapper":"MintMapWrapper-module_mint-map-overlay-wrapper__Jn4wV"};
|
|
5093
|
+
var css_248z = ".MintMapWrapper-module_mint-map-control-wrapper-container__DONh7 {\n position: absolute;\n width: 100%;\n height: 100%;\n display: flex;\n pointer-events: none;\n z-index: 101;\n}\n\n.MintMapWrapper-module_mint-map-control-wrapper__DDb4y {\n pointer-events: auto;\n}\n\n.MintMapWrapper-module_mint-map-overlay-wrapper__Jn4wV {\n position: absolute;\n z-index: 1;\n}";
|
|
5094
|
+
var styles = {"mint-map-control-wrapper-container":"MintMapWrapper-module_mint-map-control-wrapper-container__DONh7","mint-map-control-wrapper":"MintMapWrapper-module_mint-map-control-wrapper__DDb4y","mint-map-overlay-wrapper":"MintMapWrapper-module_mint-map-overlay-wrapper__Jn4wV"};
|
|
5072
5095
|
styleInject(css_248z);
|
|
5073
5096
|
|
|
5074
5097
|
var cn = classNames.bind(styles);
|
|
5075
|
-
|
|
5076
|
-
var getSizeString = function (size) {
|
|
5077
|
-
return typeof size === 'string' ? size.replace(/ /g, '') : "".concat(size, "px");
|
|
5078
|
-
};
|
|
5079
|
-
|
|
5080
|
-
var getAlignPosition = function (value, align) {
|
|
5081
|
-
if (typeof value === 'string') {
|
|
5082
|
-
var trimmed = value.replace(/ /g, '');
|
|
5083
|
-
console.log('trimmed:', trimmed);
|
|
5084
|
-
var isPercent = trimmed.endsWith('%');
|
|
5085
|
-
|
|
5086
|
-
if (!isPercent && !trimmed.endsWith('px')) {
|
|
5087
|
-
throw new Error("Size [".concat(value, "] is not valid string value."));
|
|
5088
|
-
}
|
|
5089
|
-
|
|
5090
|
-
var numberPart = isPercent ? trimmed.substring(0, trimmed.length - 2) : trimmed.substring(0, trimmed.length - 3);
|
|
5091
|
-
var unit = isPercent ? '%' : 'px';
|
|
5092
|
-
var numberValue = Number(numberPart);
|
|
5093
|
-
|
|
5094
|
-
if (isNaN(numberValue)) {
|
|
5095
|
-
throw new Error("Size [".concat(value, "] is not valid % or pixel number value."));
|
|
5096
|
-
}
|
|
5097
|
-
|
|
5098
|
-
if (align === 'center') {
|
|
5099
|
-
return "calc(50% - ".concat(numberValue / 2).concat(unit, ")");
|
|
5100
|
-
} else if (align === 'right' || align === 'bottom') {
|
|
5101
|
-
return "calc(100% - ".concat(numberValue).concat(unit, ")");
|
|
5102
|
-
} else {
|
|
5103
|
-
return '0px';
|
|
5104
|
-
}
|
|
5105
|
-
} else if (typeof value === 'number') {
|
|
5106
|
-
if (align === 'center') {
|
|
5107
|
-
return "calc(50% - ".concat(value / 2, "px)");
|
|
5108
|
-
} else if (align === 'right' || align === 'bottom') {
|
|
5109
|
-
return "calc(100% - ".concat(value, "px)");
|
|
5110
|
-
} else {
|
|
5111
|
-
return '0px';
|
|
5112
|
-
}
|
|
5113
|
-
}
|
|
5114
|
-
|
|
5115
|
-
throw new Error("Size [".concat(value, "] is not valid. (Should be % or pixel number)"));
|
|
5116
|
-
};
|
|
5117
5098
|
/**
|
|
5118
5099
|
* Mint Map 컴포넌트
|
|
5119
5100
|
*
|
|
@@ -5122,26 +5103,29 @@ var getAlignPosition = function (value, align) {
|
|
|
5122
5103
|
* @returns {JSX.Element} JSX
|
|
5123
5104
|
*/
|
|
5124
5105
|
|
|
5125
|
-
|
|
5126
5106
|
function MapControlWrapper(_a) {
|
|
5127
5107
|
var _b = _a.width,
|
|
5128
|
-
width = _b === void 0 ?
|
|
5108
|
+
width = _b === void 0 ? 'fit-content' : _b,
|
|
5129
5109
|
_c = _a.height,
|
|
5130
|
-
height = _c === void 0 ?
|
|
5110
|
+
height = _c === void 0 ? 'fit-content' : _c,
|
|
5131
5111
|
_d = _a.positionHorizontal,
|
|
5132
5112
|
positionHorizontal = _d === void 0 ? 'left' : _d,
|
|
5133
5113
|
_e = _a.positionVertical,
|
|
5134
5114
|
positionVertical = _e === void 0 ? 'top' : _e,
|
|
5135
5115
|
children = _a.children;
|
|
5136
5116
|
return React.createElement("div", {
|
|
5117
|
+
className: cn('mint-map-control-wrapper-container'),
|
|
5118
|
+
style: {
|
|
5119
|
+
justifyContent: positionHorizontal === 'center' ? 'center' : positionHorizontal === 'right' ? 'flex-end' : 'flex-start',
|
|
5120
|
+
alignItems: positionVertical === 'center' ? 'center' : positionVertical === 'bottom' ? 'flex-end' : 'flex-start'
|
|
5121
|
+
}
|
|
5122
|
+
}, React.createElement("div", {
|
|
5137
5123
|
className: cn('mint-map-control-wrapper'),
|
|
5138
5124
|
style: {
|
|
5139
|
-
width:
|
|
5140
|
-
height:
|
|
5141
|
-
left: getAlignPosition(width, positionHorizontal),
|
|
5142
|
-
top: getAlignPosition(height, positionVertical)
|
|
5125
|
+
width: width,
|
|
5126
|
+
height: height
|
|
5143
5127
|
}
|
|
5144
|
-
}, children);
|
|
5128
|
+
}, children));
|
|
5145
5129
|
}
|
|
5146
5130
|
|
|
5147
5131
|
/**
|
package/dist/index.umd.js
CHANGED
|
@@ -1153,7 +1153,7 @@
|
|
|
1153
1153
|
var params = Object.entries(param).map(function (_a) {
|
|
1154
1154
|
var key = _a[0],
|
|
1155
1155
|
value = _a[1];
|
|
1156
|
-
var temp =
|
|
1156
|
+
var temp = Array.isArray(value) ? value.join(',') : value;
|
|
1157
1157
|
return "".concat(key, "=").concat(temp);
|
|
1158
1158
|
}).join('&');
|
|
1159
1159
|
return "".concat(baseUrl, "?").concat(params);
|
|
@@ -1461,6 +1461,8 @@
|
|
|
1461
1461
|
tslib.__extends(NaverMintMapController, _super);
|
|
1462
1462
|
|
|
1463
1463
|
function NaverMintMapController(props) {
|
|
1464
|
+
var _a;
|
|
1465
|
+
|
|
1464
1466
|
var _this = _super.call(this, props) || this;
|
|
1465
1467
|
|
|
1466
1468
|
_this.type = 'naver';
|
|
@@ -1474,7 +1476,12 @@
|
|
|
1474
1476
|
_this.polygonEvents = ['mouseover', 'mouseout'];
|
|
1475
1477
|
_this.markerEvents = ['click', 'mouseover', 'mouseout'];
|
|
1476
1478
|
_this.dragged = false;
|
|
1477
|
-
_this.eventMap = new Map(); //
|
|
1479
|
+
_this.eventMap = new Map(); //scriptModules 병합
|
|
1480
|
+
|
|
1481
|
+
if (props.scriptModules) {
|
|
1482
|
+
(_a = _this.scriptModules).push.apply(_a, props.scriptModules);
|
|
1483
|
+
} //contextmenu 는 지원하지 않지만 호환성을 위해 rightclick 으로 대체
|
|
1484
|
+
|
|
1478
1485
|
|
|
1479
1486
|
_this.mapUIEvent.CONTEXTMENU = 'rightclick';
|
|
1480
1487
|
Object.freeze(_this.mapEvent);
|
|
@@ -2185,6 +2192,8 @@
|
|
|
2185
2192
|
tslib.__extends(GoogleMintMapController, _super);
|
|
2186
2193
|
|
|
2187
2194
|
function GoogleMintMapController(props) {
|
|
2195
|
+
var _a;
|
|
2196
|
+
|
|
2188
2197
|
var _this = _super.call(this, props) || this;
|
|
2189
2198
|
|
|
2190
2199
|
_this.type = 'google';
|
|
@@ -2211,9 +2220,14 @@
|
|
|
2211
2220
|
|
|
2212
2221
|
};
|
|
2213
2222
|
|
|
2214
|
-
_this.eventMap = new Map(); //
|
|
2223
|
+
_this.eventMap = new Map(); //scriptModules 병합
|
|
2224
|
+
|
|
2225
|
+
if (props.scriptModules) {
|
|
2226
|
+
(_a = _this.scriptModules).push.apply(_a, props.scriptModules);
|
|
2227
|
+
} //google 은 zoomstart 가 없으므로 zoom_changed 로 대체 (하지만 zooming 되는 내내 여러번 호출됨)
|
|
2215
2228
|
//나중에 naver 와 마찬가지로 zoomstart 1번 zoom_changed 1번 호출되도록 바꾸는것 고려중
|
|
2216
2229
|
|
|
2230
|
+
|
|
2217
2231
|
_this.mapEvent.ZOOMSTART = 'zoom_changed';
|
|
2218
2232
|
Object.freeze(_this.mapEvent);
|
|
2219
2233
|
Object.freeze(_this.mapUIEvent);
|
|
@@ -2869,6 +2883,8 @@
|
|
|
2869
2883
|
tslib.__extends(KakaoMintMapController, _super);
|
|
2870
2884
|
|
|
2871
2885
|
function KakaoMintMapController(props) {
|
|
2886
|
+
var _a;
|
|
2887
|
+
|
|
2872
2888
|
var _this = _super.call(this, props) || this;
|
|
2873
2889
|
|
|
2874
2890
|
_this.type = 'kakao';
|
|
@@ -2882,7 +2898,12 @@
|
|
|
2882
2898
|
_this.polygonEvents = ['mouseover', 'mouseout'];
|
|
2883
2899
|
_this.markerEvents = ['click', 'mouseover', 'mouseout'];
|
|
2884
2900
|
_this.dragged = false;
|
|
2885
|
-
_this.eventMap = new Map(); //
|
|
2901
|
+
_this.eventMap = new Map(); //scriptModules 병합
|
|
2902
|
+
|
|
2903
|
+
if (props.scriptModules) {
|
|
2904
|
+
(_a = _this.scriptModules).push.apply(_a, props.scriptModules);
|
|
2905
|
+
} //kakao only 이벤트이름 재정의 zoom_start
|
|
2906
|
+
|
|
2886
2907
|
|
|
2887
2908
|
_this.mapEvent.ZOOMSTART = 'zoom_start'; //contextmenu 는 지원하지 않지만 호환성을 위해 rightclick 으로 대체
|
|
2888
2909
|
|
|
@@ -3729,7 +3750,8 @@
|
|
|
3729
3750
|
pointerEvents: "none",
|
|
3730
3751
|
width: boxSize,
|
|
3731
3752
|
height: boxSize,
|
|
3732
|
-
viewBox: "0 0 ".concat(boxSize, " ").concat(boxSize)
|
|
3753
|
+
viewBox: "0 0 ".concat(boxSize, " ").concat(boxSize),
|
|
3754
|
+
overflow: 'visible'
|
|
3733
3755
|
}, svgProperties), React__default["default"].createElement("circle", tslib.__assign({
|
|
3734
3756
|
pointerEvents: "visiblepainted",
|
|
3735
3757
|
cx: radius,
|
|
@@ -3988,7 +4010,8 @@
|
|
|
3988
4010
|
pointerEvents: "none",
|
|
3989
4011
|
width: width,
|
|
3990
4012
|
height: height,
|
|
3991
|
-
viewBox: "0 0 ".concat(viewWidth.current, " ").concat(viewHeight)
|
|
4013
|
+
viewBox: "0 0 ".concat(viewWidth.current, " ").concat(viewHeight),
|
|
4014
|
+
overflow: 'visible'
|
|
3992
4015
|
}, svgProperties), React__default["default"].createElement("rect", tslib.__assign({
|
|
3993
4016
|
pointerEvents: "visiblepainted",
|
|
3994
4017
|
x: "0",
|
|
@@ -5071,53 +5094,11 @@
|
|
|
5071
5094
|
}))));
|
|
5072
5095
|
}
|
|
5073
5096
|
|
|
5074
|
-
var css_248z = ".MintMapWrapper-module_mint-map-control-
|
|
5075
|
-
var styles = {"mint-map-control-wrapper":"MintMapWrapper-module_mint-map-control-wrapper__DDb4y","mint-map-overlay-wrapper":"MintMapWrapper-module_mint-map-overlay-wrapper__Jn4wV"};
|
|
5097
|
+
var css_248z = ".MintMapWrapper-module_mint-map-control-wrapper-container__DONh7 {\n position: absolute;\n width: 100%;\n height: 100%;\n display: flex;\n pointer-events: none;\n z-index: 101;\n}\n\n.MintMapWrapper-module_mint-map-control-wrapper__DDb4y {\n pointer-events: auto;\n}\n\n.MintMapWrapper-module_mint-map-overlay-wrapper__Jn4wV {\n position: absolute;\n z-index: 1;\n}";
|
|
5098
|
+
var styles = {"mint-map-control-wrapper-container":"MintMapWrapper-module_mint-map-control-wrapper-container__DONh7","mint-map-control-wrapper":"MintMapWrapper-module_mint-map-control-wrapper__DDb4y","mint-map-overlay-wrapper":"MintMapWrapper-module_mint-map-overlay-wrapper__Jn4wV"};
|
|
5076
5099
|
styleInject__default["default"](css_248z);
|
|
5077
5100
|
|
|
5078
5101
|
var cn = classNames__default["default"].bind(styles);
|
|
5079
|
-
|
|
5080
|
-
var getSizeString = function (size) {
|
|
5081
|
-
return typeof size === 'string' ? size.replace(/ /g, '') : "".concat(size, "px");
|
|
5082
|
-
};
|
|
5083
|
-
|
|
5084
|
-
var getAlignPosition = function (value, align) {
|
|
5085
|
-
if (typeof value === 'string') {
|
|
5086
|
-
var trimmed = value.replace(/ /g, '');
|
|
5087
|
-
console.log('trimmed:', trimmed);
|
|
5088
|
-
var isPercent = trimmed.endsWith('%');
|
|
5089
|
-
|
|
5090
|
-
if (!isPercent && !trimmed.endsWith('px')) {
|
|
5091
|
-
throw new Error("Size [".concat(value, "] is not valid string value."));
|
|
5092
|
-
}
|
|
5093
|
-
|
|
5094
|
-
var numberPart = isPercent ? trimmed.substring(0, trimmed.length - 2) : trimmed.substring(0, trimmed.length - 3);
|
|
5095
|
-
var unit = isPercent ? '%' : 'px';
|
|
5096
|
-
var numberValue = Number(numberPart);
|
|
5097
|
-
|
|
5098
|
-
if (isNaN(numberValue)) {
|
|
5099
|
-
throw new Error("Size [".concat(value, "] is not valid % or pixel number value."));
|
|
5100
|
-
}
|
|
5101
|
-
|
|
5102
|
-
if (align === 'center') {
|
|
5103
|
-
return "calc(50% - ".concat(numberValue / 2).concat(unit, ")");
|
|
5104
|
-
} else if (align === 'right' || align === 'bottom') {
|
|
5105
|
-
return "calc(100% - ".concat(numberValue).concat(unit, ")");
|
|
5106
|
-
} else {
|
|
5107
|
-
return '0px';
|
|
5108
|
-
}
|
|
5109
|
-
} else if (typeof value === 'number') {
|
|
5110
|
-
if (align === 'center') {
|
|
5111
|
-
return "calc(50% - ".concat(value / 2, "px)");
|
|
5112
|
-
} else if (align === 'right' || align === 'bottom') {
|
|
5113
|
-
return "calc(100% - ".concat(value, "px)");
|
|
5114
|
-
} else {
|
|
5115
|
-
return '0px';
|
|
5116
|
-
}
|
|
5117
|
-
}
|
|
5118
|
-
|
|
5119
|
-
throw new Error("Size [".concat(value, "] is not valid. (Should be % or pixel number)"));
|
|
5120
|
-
};
|
|
5121
5102
|
/**
|
|
5122
5103
|
* Mint Map 컴포넌트
|
|
5123
5104
|
*
|
|
@@ -5126,26 +5107,29 @@
|
|
|
5126
5107
|
* @returns {JSX.Element} JSX
|
|
5127
5108
|
*/
|
|
5128
5109
|
|
|
5129
|
-
|
|
5130
5110
|
function MapControlWrapper(_a) {
|
|
5131
5111
|
var _b = _a.width,
|
|
5132
|
-
width = _b === void 0 ?
|
|
5112
|
+
width = _b === void 0 ? 'fit-content' : _b,
|
|
5133
5113
|
_c = _a.height,
|
|
5134
|
-
height = _c === void 0 ?
|
|
5114
|
+
height = _c === void 0 ? 'fit-content' : _c,
|
|
5135
5115
|
_d = _a.positionHorizontal,
|
|
5136
5116
|
positionHorizontal = _d === void 0 ? 'left' : _d,
|
|
5137
5117
|
_e = _a.positionVertical,
|
|
5138
5118
|
positionVertical = _e === void 0 ? 'top' : _e,
|
|
5139
5119
|
children = _a.children;
|
|
5140
5120
|
return React__default["default"].createElement("div", {
|
|
5121
|
+
className: cn('mint-map-control-wrapper-container'),
|
|
5122
|
+
style: {
|
|
5123
|
+
justifyContent: positionHorizontal === 'center' ? 'center' : positionHorizontal === 'right' ? 'flex-end' : 'flex-start',
|
|
5124
|
+
alignItems: positionVertical === 'center' ? 'center' : positionVertical === 'bottom' ? 'flex-end' : 'flex-start'
|
|
5125
|
+
}
|
|
5126
|
+
}, React__default["default"].createElement("div", {
|
|
5141
5127
|
className: cn('mint-map-control-wrapper'),
|
|
5142
5128
|
style: {
|
|
5143
|
-
width:
|
|
5144
|
-
height:
|
|
5145
|
-
left: getAlignPosition(width, positionHorizontal),
|
|
5146
|
-
top: getAlignPosition(height, positionVertical)
|
|
5129
|
+
width: width,
|
|
5130
|
+
height: height
|
|
5147
5131
|
}
|
|
5148
|
-
}, children);
|
|
5132
|
+
}, children));
|
|
5149
5133
|
}
|
|
5150
5134
|
|
|
5151
5135
|
/**
|