@mint-ui/map 0.7.4-beta → 0.7.5-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 +5 -5
  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 +117 -108
  65. package/dist/index.umd.js +117 -108
  66. package/package.json +77 -77
package/.eslintrc.js CHANGED
@@ -1,110 +1,110 @@
1
- module.exports = {
2
- env: {
3
- browser: true,
4
- node: true
5
- },
6
- extends: [ 'airbnb', 'airbnb/hooks', 'eslint:recommended', 'plugin:react/recommended', 'plugin:import/recommended', 'plugin:storybook/recommended' ],
7
- ignorePatterns: [ '.storybook', '*.d.ts', 'node_modules', 'build', 'dist', '**/env/*.js' ],
8
- overrides: [
9
- {
10
- files: [ '*.ts', '*.tsx' ],
11
- rules: { 'no-undef': 'off' }
12
- }
13
- ],
14
- parser: '@typescript-eslint/parser',
15
- parserOptions: { warnOnUnsupportedTypeScriptVersion: false },
16
- plugins: [ '@typescript-eslint', 'sort-keys-fix', 'prettier' ],
17
- rules: {
18
- '@typescript-eslint/ban-ts-comment': [
19
- 'error',
20
- { 'ts-ignore': 'allow-with-description' }
21
- ],
22
- '@typescript-eslint/no-explicit-any': 'warn',
23
- '@typescript-eslint/no-unused-vars': 'error',
24
- 'array-bracket-spacing': [
25
- 'error',
26
- 'always',
27
- {
28
- arraysInArrays: false,
29
- objectsInArrays: false
30
- }
31
- ],
32
- 'brace-style': [ 'error', 'allman' ],
33
- 'class-methods-use-this': 'off',
34
- 'comma-dangle': [ 'error', 'never' ],
35
- 'eol-last': [ 'error', 'never' ],
36
- 'import/extensions': 'off',
37
- 'import/named': 'off',
38
- 'import/no-anonymous-default-export': 'off',
39
- 'import/no-cycle': 'off',
40
- 'import/no-extraneous-dependencies': 'off',
41
- 'import/no-named-as-default': 'off',
42
- 'import/no-unresolved': 'off',
43
- 'import/order': [
44
- 'error',
45
- {
46
- alphabetize: {
47
- caseInsensitive: true,
48
- order: 'asc'
49
- },
50
- groups: [ 'external', 'builtin', 'internal', 'sibling', 'parent', 'index' ],
51
- 'newlines-between': 'always'
52
- }
53
- ],
54
- indent: [ 'error', 'tab', { SwitchCase: 1 }],
55
- 'jsx-a11y/control-has-associated-label': 'off',
56
- 'jsx-quotes': [ 'error', 'prefer-single' ],
57
- 'linebreak-style': 'off',
58
- 'max-len': 'off',
59
- 'no-console': 'off',
60
- 'no-plusplus': 'off',
61
- 'no-restricted-exports': 'off',
62
- 'no-tabs': [ 'error', { allowIndentationTabs: true }],
63
- 'no-unused-vars': 'off',
64
- 'object-curly-newline': [ 'error', {
65
- ExportDeclaration: 'never',
66
- ImportDeclaration: 'never',
67
- ObjectExpression: {
68
- minProperties: 3,
69
- multiline: true
70
- },
71
- ObjectPattern: { multiline: true }
72
- }],
73
- 'react-hooks/exhaustive-deps': 'off',
74
- 'react/button-has-type': 'off',
75
- 'react/destructuring-assignment': 'off',
76
- 'react/function-component-definition': 'off',
77
- 'react/jsx-curly-brace-presence': [
78
- 'error',
79
- {
80
- children: 'never',
81
- props: 'never'
82
- }
83
- ],
84
- 'react/jsx-filename-extension': 'off',
85
- 'react/jsx-indent': [ 'error', 'tab' ],
86
- 'react/jsx-indent-props': [ 2, 'tab' ],
87
- 'react/jsx-props-no-spreading': 'off',
88
- 'react/jsx-sort-props': [
89
- 'error',
90
- {
91
- callbacksLast: true,
92
- ignoreCase: true,
93
- multiline: 'last',
94
- noSortAlphabetically: false,
95
- reservedFirst: false,
96
- shorthandFirst: false,
97
- shorthandLast: true
98
- }
99
- ],
100
- 'react/prop-types': 'off',
101
- 'react/react-in-jsx-scope': 'off',
102
- 'react/require-default-props': 'off',
103
- 'require-jsdoc': 'off',
104
- 'sort-keys-fix/sort-keys-fix': 'error'
105
- },
106
- settings: {
107
- 'import/parsers': { '@typescript-eslint/parser': [ '.ts', '.tsx', '.js' ] },
108
- react: { version: 'detect' }
109
- }
1
+ module.exports = {
2
+ env: {
3
+ browser: true,
4
+ node: true
5
+ },
6
+ extends: [ 'airbnb', 'airbnb/hooks', 'eslint:recommended', 'plugin:react/recommended', 'plugin:import/recommended', 'plugin:storybook/recommended' ],
7
+ ignorePatterns: [ '.storybook', '*.d.ts', 'node_modules', 'build', 'dist', '**/env/*.js' ],
8
+ overrides: [
9
+ {
10
+ files: [ '*.ts', '*.tsx' ],
11
+ rules: { 'no-undef': 'off' }
12
+ }
13
+ ],
14
+ parser: '@typescript-eslint/parser',
15
+ parserOptions: { warnOnUnsupportedTypeScriptVersion: false },
16
+ plugins: [ '@typescript-eslint', 'sort-keys-fix', 'prettier' ],
17
+ rules: {
18
+ '@typescript-eslint/ban-ts-comment': [
19
+ 'error',
20
+ { 'ts-ignore': 'allow-with-description' }
21
+ ],
22
+ '@typescript-eslint/no-explicit-any': 'warn',
23
+ '@typescript-eslint/no-unused-vars': 'error',
24
+ 'array-bracket-spacing': [
25
+ 'error',
26
+ 'always',
27
+ {
28
+ arraysInArrays: false,
29
+ objectsInArrays: false
30
+ }
31
+ ],
32
+ 'brace-style': [ 'error', 'allman' ],
33
+ 'class-methods-use-this': 'off',
34
+ 'comma-dangle': [ 'error', 'never' ],
35
+ 'eol-last': [ 'error', 'never' ],
36
+ 'import/extensions': 'off',
37
+ 'import/named': 'off',
38
+ 'import/no-anonymous-default-export': 'off',
39
+ 'import/no-cycle': 'off',
40
+ 'import/no-extraneous-dependencies': 'off',
41
+ 'import/no-named-as-default': 'off',
42
+ 'import/no-unresolved': 'off',
43
+ 'import/order': [
44
+ 'error',
45
+ {
46
+ alphabetize: {
47
+ caseInsensitive: true,
48
+ order: 'asc'
49
+ },
50
+ groups: [ 'external', 'builtin', 'internal', 'sibling', 'parent', 'index' ],
51
+ 'newlines-between': 'always'
52
+ }
53
+ ],
54
+ indent: [ 'error', 'tab', { SwitchCase: 1 }],
55
+ 'jsx-a11y/control-has-associated-label': 'off',
56
+ 'jsx-quotes': [ 'error', 'prefer-single' ],
57
+ 'linebreak-style': 'off',
58
+ 'max-len': 'off',
59
+ 'no-console': 'off',
60
+ 'no-plusplus': 'off',
61
+ 'no-restricted-exports': 'off',
62
+ 'no-tabs': [ 'error', { allowIndentationTabs: true }],
63
+ 'no-unused-vars': 'off',
64
+ 'object-curly-newline': [ 'error', {
65
+ ExportDeclaration: 'never',
66
+ ImportDeclaration: 'never',
67
+ ObjectExpression: {
68
+ minProperties: 3,
69
+ multiline: true
70
+ },
71
+ ObjectPattern: { multiline: true }
72
+ }],
73
+ 'react-hooks/exhaustive-deps': 'off',
74
+ 'react/button-has-type': 'off',
75
+ 'react/destructuring-assignment': 'off',
76
+ 'react/function-component-definition': 'off',
77
+ 'react/jsx-curly-brace-presence': [
78
+ 'error',
79
+ {
80
+ children: 'never',
81
+ props: 'never'
82
+ }
83
+ ],
84
+ 'react/jsx-filename-extension': 'off',
85
+ 'react/jsx-indent': [ 'error', 'tab' ],
86
+ 'react/jsx-indent-props': [ 2, 'tab' ],
87
+ 'react/jsx-props-no-spreading': 'off',
88
+ 'react/jsx-sort-props': [
89
+ 'error',
90
+ {
91
+ callbacksLast: true,
92
+ ignoreCase: true,
93
+ multiline: 'last',
94
+ noSortAlphabetically: false,
95
+ reservedFirst: false,
96
+ shorthandFirst: false,
97
+ shorthandLast: true
98
+ }
99
+ ],
100
+ 'react/prop-types': 'off',
101
+ 'react/react-in-jsx-scope': 'off',
102
+ 'react/require-default-props': 'off',
103
+ 'require-jsdoc': 'off',
104
+ 'sort-keys-fix/sort-keys-fix': 'error'
105
+ },
106
+ settings: {
107
+ 'import/parsers': { '@typescript-eslint/parser': [ '.ts', '.tsx', '.js' ] },
108
+ react: { version: 'detect' }
109
+ }
110
110
  };
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 itcode.dev
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2022 itcode.dev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,73 +1,73 @@
1
- # @mint-ui/map
2
-
3
- - React map library
4
- - Control various map with one interface
5
- - Google, Naver, Kakao map supported now
6
- - Typescript supported
7
- - Canvas marker supported (experimental)
8
-
9
- ## Installation
10
-
11
- ``` bash
12
- yarn add @mint-ui/map
13
-
14
- npm install @mint-ui/map
15
- ```
16
-
17
- ## Examples
18
-
19
- ``` javascript
20
- ...
21
- ...
22
-
23
- import { MapMarkerWrapper, MintMap, Position } from '@mint-ui/map'
24
-
25
- const root = ReactDOM.createRoot(
26
- document.getElementById('root')
27
- )
28
-
29
- function MyMapComponent(){
30
-
31
- return <MintMap
32
- mapType={'google'}
33
- mapKey={'YOUR_GOOGLE_MAP_KEY'}
34
- mapId='YOUR_GOOGLE_MAP_ID' //Use advanced markers in Google maps
35
- base={{center:new Position(-25.344, 131.031), zoomLevel:12}}
36
- >
37
- {/* Your marker */}
38
- <MapMarkerWrapper position={new Position(-25.344, 131.031)}>
39
-
40
- {/* Your marker elements */}
41
- <div style={{width:'10px', height:'10px', background:'red', borderRadius:'10px'}}></div>
42
-
43
- </MapMarkerWrapper>
44
-
45
- {/* Overlay canvas */}
46
- <MapCanvasWrapper>
47
-
48
- {/* Canvas marker */}
49
- <MapCanvasMarkerWrapper position={new Position(-25.344, 131.031)}
50
- renderer={(renderer:MintMapCanvasRenderer, offset:Offset, _payload?:TestPayload)=>{
51
- const {context} = renderer
52
- context.fillStyle = `hsl(${(Math.random() * 360).toFixed(0)} 100% 60%)`
53
- context.fillRect(Math.floor(offset.x), Math.floor(offset.y), 8, 8)
54
- }}
55
- boxWidth={8} boxHeight={8}
56
- payload={testItem}
57
- onClick={(e)=>{
58
- alert('marker 1 clicked!!!'+e.x+','+e.y)
59
- }}
60
- ></MapCanvasMarkerWrapper>
61
-
62
- </MapCanvasWrapper>
63
-
64
- </MintMap>
65
-
66
- }
67
-
68
- root.render((<MyMapComponent/>))
69
-
70
- ```
71
-
72
- ## Document / Reference Site
73
- - To be continue...
1
+ # @mint-ui/map
2
+
3
+ - React map library
4
+ - Control various map with one interface
5
+ - Google, Naver, Kakao map supported now
6
+ - Typescript supported
7
+ - Canvas marker supported (experimental)
8
+
9
+ ## Installation
10
+
11
+ ``` bash
12
+ yarn add @mint-ui/map
13
+
14
+ npm install @mint-ui/map
15
+ ```
16
+
17
+ ## Examples
18
+
19
+ ``` javascript
20
+ ...
21
+ ...
22
+
23
+ import { MapMarkerWrapper, MintMap, Position } from '@mint-ui/map'
24
+
25
+ const root = ReactDOM.createRoot(
26
+ document.getElementById('root')
27
+ )
28
+
29
+ function MyMapComponent(){
30
+
31
+ return <MintMap
32
+ mapType={'google'}
33
+ mapKey={'YOUR_GOOGLE_MAP_KEY'}
34
+ mapId='YOUR_GOOGLE_MAP_ID' //Use advanced markers in Google maps
35
+ base={{center:new Position(-25.344, 131.031), zoomLevel:12}}
36
+ >
37
+ {/* Your marker */}
38
+ <MapMarkerWrapper position={new Position(-25.344, 131.031)}>
39
+
40
+ {/* Your marker elements */}
41
+ <div style={{width:'10px', height:'10px', background:'red', borderRadius:'10px'}}></div>
42
+
43
+ </MapMarkerWrapper>
44
+
45
+ {/* Overlay canvas */}
46
+ <MapCanvasWrapper>
47
+
48
+ {/* Canvas marker */}
49
+ <MapCanvasMarkerWrapper position={new Position(-25.344, 131.031)}
50
+ renderer={(renderer:MintMapCanvasRenderer, offset:Offset, _payload?:TestPayload)=>{
51
+ const {context} = renderer
52
+ context.fillStyle = `hsl(${(Math.random() * 360).toFixed(0)} 100% 60%)`
53
+ context.fillRect(Math.floor(offset.x), Math.floor(offset.y), 8, 8)
54
+ }}
55
+ boxWidth={8} boxHeight={8}
56
+ payload={testItem}
57
+ onClick={(e)=>{
58
+ alert('marker 1 clicked!!!'+e.x+','+e.y)
59
+ }}
60
+ ></MapCanvasMarkerWrapper>
61
+
62
+ </MapCanvasWrapper>
63
+
64
+ </MintMap>
65
+
66
+ }
67
+
68
+ root.render((<MyMapComponent/>))
69
+
70
+ ```
71
+
72
+ ## Document / Reference Site
73
+ - To be continue...
@@ -1,10 +1,10 @@
1
- import { PropsWithChildren } from "react";
2
- import { MintMapProps } from "./types/MintMapProps";
3
- /**
4
- * Mint Map 컴포넌트
5
- *
6
- * @param {MintMapProps} MintMapProps
7
- *
8
- * @returns {JSX.Element} JSX
9
- */
10
- export declare function MintMap({ mapLoadingComponent, dissolveEffectWhenLoaded, mapType, children, base, ...props }: PropsWithChildren<MintMapProps>): JSX.Element;
1
+ import { PropsWithChildren } from "react";
2
+ import { MintMapProps } from "./types/MintMapProps";
3
+ /**
4
+ * Mint Map 컴포넌트
5
+ *
6
+ * @param {MintMapProps} MintMapProps
7
+ *
8
+ * @returns {JSX.Element} JSX
9
+ */
10
+ export declare function MintMap({ mapLoadingComponent, dissolveEffectWhenLoaded, mapType, children, base, ...props }: PropsWithChildren<MintMapProps>): JSX.Element;
@@ -23,32 +23,41 @@ var DEFAULT_CENTER = {
23
23
  lat: 37.5036845,
24
24
  lng: 127.0448698
25
25
  };
26
- /**
27
- * Mint Map 컴포넌트
28
- *
29
- * @param {MintMapProps} MintMapProps
30
- *
31
- * @returns {JSX.Element} JSX
26
+ var DEFAULT_ZOOM_LEVEL = 12;
27
+ var DEFAULT_MAP_BASE_CONFIG = {
28
+ center: DEFAULT_CENTER,
29
+ zoomLevel: DEFAULT_ZOOM_LEVEL
30
+ };
31
+
32
+ function makeBaseProps(base) {
33
+ !base.center && (base.center = DEFAULT_CENTER);
34
+ !base.zoomLevel && (base.zoomLevel = DEFAULT_ZOOM_LEVEL);
35
+ return base;
36
+ }
37
+ /**
38
+ * Mint Map 컴포넌트
39
+ *
40
+ * @param {MintMapProps} MintMapProps
41
+ *
42
+ * @returns {JSX.Element} JSX
32
43
  */
33
44
 
45
+
34
46
  function MintMap(_a) {
35
47
  var mapLoadingComponent = _a.mapLoadingComponent,
36
48
  _b = _a.dissolveEffectWhenLoaded,
37
49
  dissolveEffectWhenLoaded = _b === void 0 ? true : _b,
38
50
  mapType = _a.mapType,
39
51
  children = _a.children,
40
- _c = _a.base,
41
- base = _c === void 0 ? {
42
- center: DEFAULT_CENTER,
43
- zoomLevel: 12
44
- } : _c,
52
+ base = _a.base,
45
53
  props = tslib.__rest(_a, ["mapLoadingComponent", "dissolveEffectWhenLoaded", "mapType", "children", "base"]);
46
54
 
55
+ var mapBaseConfig = base ? makeBaseProps(base) : DEFAULT_MAP_BASE_CONFIG;
47
56
  var loadingRef = React.useRef(null);
48
57
 
49
- var _d = React.useState(),
50
- controller = _d[0],
51
- setController = _d[1];
58
+ var _c = React.useState(),
59
+ controller = _c[0],
60
+ setController = _c[1];
52
61
 
53
62
  var loading = React.useMemo(function () {
54
63
  return mapLoadingComponent ? mapLoadingComponent() : React__default["default"].createElement(React__default["default"].Fragment, null);
@@ -65,15 +74,15 @@ function MintMap(_a) {
65
74
  var newController_1 = mapType === 'naver' ? new NaverMintMapController.NaverMintMapController(tslib.__assign(tslib.__assign({
66
75
  mapType: mapType
67
76
  }, props), {
68
- base: base
77
+ base: mapBaseConfig
69
78
  })) : mapType === 'google' ? new GoogleMintMapController.GoogleMintMapController(tslib.__assign(tslib.__assign({
70
79
  mapType: mapType
71
80
  }, props), {
72
- base: base
81
+ base: mapBaseConfig
73
82
  })) : mapType === 'kakao' ? new KakaoMintMapController.KakaoMintMapController(tslib.__assign(tslib.__assign({
74
83
  mapType: mapType
75
84
  }, props), {
76
- base: base
85
+ base: mapBaseConfig
77
86
  })) : null;
78
87
  newController_1 && (prevController.current = newController_1);
79
88
 
@@ -109,7 +118,7 @@ function MintMap(_a) {
109
118
  }), React__default["default"].createElement(MintMapCore.MintMapCore, tslib.__assign({
110
119
  mapType: mapType
111
120
  }, props, {
112
- base: base
121
+ base: mapBaseConfig
113
122
  }), children)) : React__default["default"].createElement(React__default["default"].Fragment, null, dissolveEffectWhenLoaded && React__default["default"].createElement("div", {
114
123
  ref: function (refs) {
115
124
  loadingRef.current = refs;
@@ -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
+ }
@@ -1,69 +1,69 @@
1
- import { MapType, MapVendorType } from '../types/CommonTypes';
2
- import { Drawable, Marker, MarkerOptions, Polygon, PolygonOptions, Polyline, PolylineOptions } from '../types/MapDrawables';
3
- import { EventCallback, EventParamType, MapEvent, MapEventName, MapUIEvent } from '../types/MapEventTypes';
4
- import { Bounds, Offset, Position } from '../types/MapTypes';
5
- import { MintMapProps } from '../types/MintMapProps';
6
- import { Property } from "csstype";
7
- export declare abstract class MintMapController {
8
- abstract type: MapType;
9
- abstract map: MapVendorType | null;
10
- abstract scriptUrl: string;
11
- abstract scriptModules: string[];
12
- abstract initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
13
- abstract destroyMap(): void;
14
- abstract loadMapApi(): Promise<boolean>;
15
- abstract getCurrBounds(): Bounds;
16
- abstract panningTo(targetCenter: Position): void;
17
- abstract getZoomLevel(): number;
18
- abstract setZoomLevel(zoom: number): void;
19
- abstract getCenter(): Position;
20
- abstract setCenter(position: Position): void;
21
- abstract setMapCursor(cursor: Property.Cursor): void;
22
- abstract createMarker(marker: Marker): void;
23
- abstract updateMarker(marker: Marker, options: MarkerOptions): void;
24
- abstract clearDrawable(drawable: Drawable): boolean;
25
- abstract markerToTheTop(marker: Marker): void;
26
- abstract isMapDragged(): boolean;
27
- abstract setMapDragged(value: boolean): void;
28
- abstract setMarkerZIndex(marker: Marker, zIndex: number): void;
29
- abstract createPolyline(polyline: Polyline): void;
30
- abstract updatePolyline(polyline: Polyline, options: PolylineOptions): void;
31
- abstract createPolygon(polygon: Polygon): void;
32
- abstract updatePolygon(polygon: Polygon, options: PolygonOptions): void;
33
- protected abstract mapEvent: MapEvent;
34
- protected abstract mapUIEvent: MapUIEvent;
35
- abstract addEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
36
- abstract removeEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
37
- abstract removeAllEventListener(eventName?: MapEventName): void;
38
- mapProps: MintMapProps;
39
- mapApiLoaded: boolean;
40
- mapInitialized: boolean;
41
- mapDivElement: HTMLDivElement;
42
- constructor(props: MintMapProps);
43
- getMap(): MapVendorType | null;
44
- getMapType(): MapType;
45
- positionToOffset(position: Position): Offset;
46
- offsetToPosition(offset: Offset): Position;
47
- loadScript(url: string, id: string, checkLoaded: () => boolean): Promise<boolean>;
48
- getRandomFunctionName(prefix: string): string;
49
- /**
50
- * URL 빌더 메서드
51
- *
52
- * @param {string} baseUrl: 기본 URL
53
- * @param {{ [ key: string ]: string | string[] }} param: 파라미터 JSON
54
- * @returns {string} URL
55
- */
56
- buildUrl(baseUrl: string, param: {
57
- [key: string]: string | string[] | boolean;
58
- }): string;
59
- private processedTime;
60
- /**
61
- * 쓰로틀링 처리
62
- * @returns
63
- */
64
- checkBoundsChangeThrottleTime(): boolean;
65
- getBaseToMapZoom(zoomBase: number): number;
66
- getMapToBaseZoom(mapZoom: number): number;
67
- focusPositionsToFitViewport(positions: Position[]): void;
68
- printStatus(): void;
69
- }
1
+ import { MapType, MapVendorType } from '../types/CommonTypes';
2
+ import { Drawable, Marker, MarkerOptions, Polygon, PolygonOptions, Polyline, PolylineOptions } from '../types/MapDrawables';
3
+ import { EventCallback, EventParamType, MapEvent, MapEventName, MapUIEvent } from '../types/MapEventTypes';
4
+ import { Bounds, Offset, Position } from '../types/MapTypes';
5
+ import { MintMapProps } from '../types/MintMapProps';
6
+ import { Property } from "csstype";
7
+ export declare abstract class MintMapController {
8
+ abstract type: MapType;
9
+ abstract map: MapVendorType | null;
10
+ abstract scriptUrl: string;
11
+ abstract scriptModules: string[];
12
+ abstract initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
13
+ abstract destroyMap(): void;
14
+ abstract loadMapApi(): Promise<boolean>;
15
+ abstract getCurrBounds(): Bounds;
16
+ abstract panningTo(targetCenter: Position): void;
17
+ abstract getZoomLevel(): number;
18
+ abstract setZoomLevel(zoom: number): void;
19
+ abstract getCenter(): Position;
20
+ abstract setCenter(position: Position): void;
21
+ abstract setMapCursor(cursor: Property.Cursor): void;
22
+ abstract createMarker(marker: Marker): void;
23
+ abstract updateMarker(marker: Marker, options: MarkerOptions): void;
24
+ abstract clearDrawable(drawable: Drawable): boolean;
25
+ abstract markerToTheTop(marker: Marker): void;
26
+ abstract isMapDragged(): boolean;
27
+ abstract setMapDragged(value: boolean): void;
28
+ abstract setMarkerZIndex(marker: Marker, zIndex: number): void;
29
+ abstract createPolyline(polyline: Polyline): void;
30
+ abstract updatePolyline(polyline: Polyline, options: PolylineOptions): void;
31
+ abstract createPolygon(polygon: Polygon): void;
32
+ abstract updatePolygon(polygon: Polygon, options: PolygonOptions): void;
33
+ protected abstract mapEvent: MapEvent;
34
+ protected abstract mapUIEvent: MapUIEvent;
35
+ abstract addEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
36
+ abstract removeEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
37
+ abstract removeAllEventListener(eventName?: MapEventName): void;
38
+ mapProps: MintMapProps;
39
+ mapApiLoaded: boolean;
40
+ mapInitialized: boolean;
41
+ mapDivElement: HTMLDivElement;
42
+ constructor(props: MintMapProps);
43
+ getMap(): MapVendorType | null;
44
+ getMapType(): MapType;
45
+ positionToOffset(position: Position): Offset;
46
+ offsetToPosition(offset: Offset): Position;
47
+ loadScript(url: string, id: string, checkLoaded: () => boolean): Promise<boolean>;
48
+ getRandomFunctionName(prefix: string): string;
49
+ /**
50
+ * URL 빌더 메서드
51
+ *
52
+ * @param {string} baseUrl: 기본 URL
53
+ * @param {{ [ key: string ]: string | string[] }} param: 파라미터 JSON
54
+ * @returns {string} URL
55
+ */
56
+ buildUrl(baseUrl: string, param: {
57
+ [key: string]: string | string[] | boolean;
58
+ }): string;
59
+ private processedTime;
60
+ /**
61
+ * 쓰로틀링 처리
62
+ * @returns
63
+ */
64
+ checkBoundsChangeThrottleTime(): boolean;
65
+ getBaseToMapZoom(zoomBase: number): number;
66
+ getMapToBaseZoom(mapZoom: number): number;
67
+ focusPositionsToFitViewport(positions: Position[]): void;
68
+ printStatus(): void;
69
+ }