@mint-ui/map 0.1.7-beta → 0.1.9-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 (36) hide show
  1. package/.eslintrc.js +109 -109
  2. package/LICENSE +21 -21
  3. package/README.md +53 -53
  4. package/dist/components/mint-map/MintMap.d.ts +92 -88
  5. package/dist/components/mint-map/MintMap.js +42 -11
  6. package/dist/components/mint-map/core/MintMapController.d.ts +33 -32
  7. package/dist/components/mint-map/core/MintMapCore.d.ts +3 -3
  8. package/dist/components/mint-map/core/MintMapCore.js +10 -0
  9. package/dist/components/mint-map/core/advanced/MapBuildingProjection.d.ts +15 -15
  10. package/dist/components/mint-map/core/advanced/index.d.ts +1 -1
  11. package/dist/components/mint-map/core/hooks/MarkerMovingHook.d.ts +6 -6
  12. package/dist/components/mint-map/core/hooks/index.d.ts +1 -1
  13. package/dist/components/mint-map/core/index.d.ts +7 -7
  14. package/dist/components/mint-map/core/provider/MintMapProvider.d.ts +8 -8
  15. package/dist/components/mint-map/core/provider/index.d.ts +1 -1
  16. package/dist/components/mint-map/core/util/animation.d.ts +16 -16
  17. package/dist/components/mint-map/core/util/calculate.d.ts +34 -29
  18. package/dist/components/mint-map/core/util/calculate.js +68 -8
  19. package/dist/components/mint-map/core/util/index.d.ts +3 -3
  20. package/dist/components/mint-map/core/util/waiting.d.ts +1 -1
  21. package/dist/components/mint-map/core/wrapper/MapControlWrapper.d.ts +11 -11
  22. package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.d.ts +23 -23
  23. package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.js +2 -4
  24. package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.d.ts +5 -5
  25. package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.d.ts +5 -5
  26. package/dist/components/mint-map/core/wrapper/index.d.ts +4 -4
  27. package/dist/components/mint-map/google/GoogleMintMapController.d.ts +35 -34
  28. package/dist/components/mint-map/google/GoogleMintMapController.js +19 -8
  29. package/dist/components/mint-map/index.d.ts +4 -4
  30. package/dist/components/mint-map/naver/NaverMintMapController.d.ts +38 -36
  31. package/dist/components/mint-map/naver/NaverMintMapController.js +45 -11
  32. package/dist/index.d.ts +1 -1
  33. package/dist/index.es.js +186 -42
  34. package/dist/index.umd.js +186 -42
  35. package/package.json +76 -76
  36. package/test.ts +6 -6
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,53 +1,53 @@
1
- # @mint-ui/map
2
-
3
- - React map library
4
- - Control various map with one interface
5
- - Google, Naver map supported now
6
- - Typescript supported
7
-
8
- ## Installation
9
-
10
- ``` bash
11
- yarn add @mint-ui/map
12
-
13
- npm install @mint-ui/map
14
- ```
15
-
16
- ## Examples
17
-
18
- ``` javascript
19
- ...
20
- ...
21
-
22
- import { MapMarkerWrapper, MintMap, Position } from '@mint-ui/map'
23
-
24
- const root = ReactDOM.createRoot(
25
- document.getElementById('root')
26
- )
27
-
28
- function MyMapComponent(){
29
-
30
- return <MintMap
31
- mapType={'google'}
32
- mapKey={'YOUR_GOOGLE_MAP_KEY'}
33
- mapId='YOUR_GOOGLE_MAP_ID' //Use advanced markers in Google maps
34
- base={{center:new Position(-25.344, 131.031), zoomLevel:12}}
35
- >
36
- {/* Your marker */}
37
- <MapMarkerWrapper position={new Position(-25.344, 131.031)}>
38
-
39
- {/* Your marker elements */}
40
- <div style={{width:'10px', height:'10px', background:'red', borderRadius:'10px'}}></div>
41
-
42
- </MapMarkerWrapper>
43
-
44
- </MintMap>
45
-
46
- }
47
-
48
- root.render((<MyMapComponent/>))
49
-
50
- ```
51
-
52
- ## Document / Reference Site
53
- - To be continue...
1
+ # @mint-ui/map
2
+
3
+ - React map library
4
+ - Control various map with one interface
5
+ - Google, Naver map supported now
6
+ - Typescript supported
7
+
8
+ ## Installation
9
+
10
+ ``` bash
11
+ yarn add @mint-ui/map
12
+
13
+ npm install @mint-ui/map
14
+ ```
15
+
16
+ ## Examples
17
+
18
+ ``` javascript
19
+ ...
20
+ ...
21
+
22
+ import { MapMarkerWrapper, MintMap, Position } from '@mint-ui/map'
23
+
24
+ const root = ReactDOM.createRoot(
25
+ document.getElementById('root')
26
+ )
27
+
28
+ function MyMapComponent(){
29
+
30
+ return <MintMap
31
+ mapType={'google'}
32
+ mapKey={'YOUR_GOOGLE_MAP_KEY'}
33
+ mapId='YOUR_GOOGLE_MAP_ID' //Use advanced markers in Google maps
34
+ base={{center:new Position(-25.344, 131.031), zoomLevel:12}}
35
+ >
36
+ {/* Your marker */}
37
+ <MapMarkerWrapper position={new Position(-25.344, 131.031)}>
38
+
39
+ {/* Your marker elements */}
40
+ <div style={{width:'10px', height:'10px', background:'red', borderRadius:'10px'}}></div>
41
+
42
+ </MapMarkerWrapper>
43
+
44
+ </MintMap>
45
+
46
+ }
47
+
48
+ root.render((<MyMapComponent/>))
49
+
50
+ ```
51
+
52
+ ## Document / Reference Site
53
+ - To be continue...
@@ -1,88 +1,92 @@
1
- /// <reference types="navermaps" />
2
- /// <reference types="google.maps" />
3
- import { PropsWithChildren } from "react";
4
- import { MintMapController } from "./core/MintMapController";
5
- export declare type MapType = 'naver' | 'google';
6
- export declare type MapVendorType = naver.maps.Map | google.maps.Map;
7
- export interface MintMapProps extends MintMapEvents {
8
- mapType: MapType | null;
9
- mapKey: string;
10
- mapId?: string;
11
- base?: BaseProps;
12
- visible?: boolean;
13
- markerCache?: boolean;
14
- }
15
- export interface MintMapEvents {
16
- onBoundsChanged?: (bounds: Bounds) => void;
17
- onZoomChanged?: (level: number) => void;
18
- onLoad?: (map: MapVendorType, controller: MintMapController) => void;
19
- onClick?: (positon: Position) => void;
20
- }
21
- export declare class Position {
22
- lat: number;
23
- lng: number;
24
- offset?: Offset;
25
- constructor(lat: number, lng: number);
26
- }
27
- export declare class Bounds {
28
- nw: Position;
29
- se: Position;
30
- ne: Position;
31
- sw: Position;
32
- constructor(nw?: Position, se?: Position, ne?: Position, sw?: Position);
33
- static fromNWSE(nw: Position, se: Position): Bounds;
34
- static fromNESW(ne: Position, sw: Position): Bounds;
35
- private covertNWSEtoNESW;
36
- private covertNESWtoNWSE;
37
- getCenter(): Position;
38
- includes(positions: Position[]): boolean;
39
- includesOnlyOnePoint(positions: Position[]): boolean;
40
- intersects(positions: Position[]): boolean;
41
- }
42
- export declare class Offset {
43
- x: number;
44
- y: number;
45
- constructor(x: number, y: number);
46
- }
47
- export interface BaseProps {
48
- center?: Position;
49
- zoomLevel?: number;
50
- }
51
- export interface DrawableOptions {
52
- position: Position | Position[] | [number, number][];
53
- visible?: boolean;
54
- event?: Map<keyof DocumentEventMap, (e: Event) => boolean | void>;
55
- }
56
- export declare abstract class Drawable {
57
- native?: any;
58
- abstract options: DrawableOptions;
59
- }
60
- export interface MarkerOptions extends DrawableOptions {
61
- anchor?: Offset;
62
- }
63
- export declare class Marker extends Drawable {
64
- options: MarkerOptions;
65
- element?: string | HTMLElement;
66
- constructor(options: MarkerOptions);
67
- }
68
- export interface PolylineOptions extends DrawableOptions {
69
- lineColor?: string;
70
- lineSize?: number;
71
- lineOpacity?: number;
72
- editable?: boolean;
73
- }
74
- export declare class Polyline extends Drawable {
75
- options: PolylineOptions;
76
- constructor(options: PolylineOptions);
77
- }
78
- export interface PolygonOptions extends PolylineOptions {
79
- innerPositions?: Position[][];
80
- fillColor?: string;
81
- fillOpacity?: number;
82
- }
83
- export declare class Polygon extends Drawable {
84
- options: PolygonOptions;
85
- constructor(options: PolygonOptions);
86
- getCenter(): Position;
87
- }
88
- export declare function MintMap({ mapType, children, ...props }: PropsWithChildren<MintMapProps>): JSX.Element;
1
+ /// <reference types="navermaps" />
2
+ /// <reference types="google.maps" />
3
+ import { PropsWithChildren } from "react";
4
+ import { MintMapController } from "./core/MintMapController";
5
+ export declare type MapType = 'naver' | 'google';
6
+ export declare type MapVendorType = naver.maps.Map | google.maps.Map;
7
+ export interface MintMapProps extends MintMapEvents {
8
+ mapType: MapType | null;
9
+ mapKey: string;
10
+ mapId?: string;
11
+ base?: BaseProps;
12
+ visible?: boolean;
13
+ markerCache?: boolean;
14
+ markerCachePoolSize?: number;
15
+ }
16
+ export interface MintMapEvents {
17
+ onBoundsChanged?: (bounds: Bounds) => void;
18
+ onZoomChanged?: (level: number) => void;
19
+ onLoad?: (map: MapVendorType, controller: MintMapController) => void;
20
+ onClick?: (positon: Position) => void;
21
+ }
22
+ export declare class Position {
23
+ lat: number;
24
+ lng: number;
25
+ offset?: Offset;
26
+ constructor(lat: number, lng: number);
27
+ }
28
+ export declare class Bounds {
29
+ nw: Position;
30
+ se: Position;
31
+ ne: Position;
32
+ sw: Position;
33
+ constructor(nw?: Position, se?: Position, ne?: Position, sw?: Position);
34
+ static fromNWSE(nw: Position, se: Position): Bounds;
35
+ static fromNESW(ne: Position, sw: Position): Bounds;
36
+ private covertNWSEtoNESW;
37
+ private covertNESWtoNWSE;
38
+ getCenter(): Position;
39
+ getIncludedPositions(positions: Position[]): Position[];
40
+ includes(positions: Position | Position[]): boolean;
41
+ includesOnlyOnePoint(positions: Position[]): boolean;
42
+ intersects(positions: Position[]): boolean;
43
+ }
44
+ export declare class Offset {
45
+ x: number;
46
+ y: number;
47
+ constructor(x: number, y: number);
48
+ }
49
+ export interface BaseProps {
50
+ center?: Position;
51
+ zoomLevel?: number;
52
+ maxZoomLevel?: number;
53
+ minZoomLevel?: number;
54
+ }
55
+ export interface DrawableOptions {
56
+ position: Position | Position[] | [number, number][];
57
+ visible?: boolean;
58
+ event?: Map<keyof DocumentEventMap, (e: Event) => boolean | void>;
59
+ }
60
+ export declare abstract class Drawable {
61
+ native?: any;
62
+ abstract options: DrawableOptions;
63
+ }
64
+ export interface MarkerOptions extends DrawableOptions {
65
+ anchor?: Offset;
66
+ }
67
+ export declare class Marker extends Drawable {
68
+ options: MarkerOptions;
69
+ element?: string | HTMLElement;
70
+ constructor(options: MarkerOptions);
71
+ }
72
+ export interface PolylineOptions extends DrawableOptions {
73
+ lineColor?: string;
74
+ lineSize?: number;
75
+ lineOpacity?: number;
76
+ editable?: boolean;
77
+ }
78
+ export declare class Polyline extends Drawable {
79
+ options: PolylineOptions;
80
+ constructor(options: PolylineOptions);
81
+ }
82
+ export interface PolygonOptions extends PolylineOptions {
83
+ innerPositions?: Position[][];
84
+ fillColor?: string;
85
+ fillOpacity?: number;
86
+ }
87
+ export declare class Polygon extends Drawable {
88
+ options: PolygonOptions;
89
+ constructor(options: PolygonOptions);
90
+ getCenter(): Position;
91
+ }
92
+ export declare function MintMap({ mapType, children, base, ...props }: PropsWithChildren<MintMapProps>): JSX.Element;
@@ -68,10 +68,26 @@ var Bounds = function () {
68
68
  return new Position(this.nw.lat + (this.se.lat - this.nw.lat) / 2, this.nw.lng + (this.se.lng - this.nw.lng) / 2);
69
69
  };
70
70
 
71
- Bounds.prototype.includes = function (positions) {
71
+ Bounds.prototype.getIncludedPositions = function (positions) {
72
+ var result = [];
73
+
72
74
  for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
73
75
  var pos = positions_1[_i];
74
76
 
77
+ if (!(this.nw.lat > pos.lat || this.se.lat < pos.lat || this.nw.lng > pos.lng || this.se.lng < pos.lng)) {
78
+ result.push(pos);
79
+ }
80
+ }
81
+
82
+ return result;
83
+ };
84
+
85
+ Bounds.prototype.includes = function (positions) {
86
+ positions = Array.isArray(positions) ? positions : [positions];
87
+
88
+ for (var _i = 0, positions_2 = positions; _i < positions_2.length; _i++) {
89
+ var pos = positions_2[_i];
90
+
75
91
  if (this.nw.lat > pos.lat || this.se.lat < pos.lat || this.nw.lng > pos.lng || this.se.lng < pos.lng) {
76
92
  return false;
77
93
  }
@@ -81,8 +97,8 @@ var Bounds = function () {
81
97
  };
82
98
 
83
99
  Bounds.prototype.includesOnlyOnePoint = function (positions) {
84
- for (var _i = 0, positions_2 = positions; _i < positions_2.length; _i++) {
85
- var pos = positions_2[_i];
100
+ for (var _i = 0, positions_3 = positions; _i < positions_3.length; _i++) {
101
+ var pos = positions_3[_i];
86
102
 
87
103
  if (!(this.nw.lat > pos.lat || this.se.lat < pos.lat || this.nw.lng > pos.lng || this.se.lng < pos.lng)) {
88
104
  return true;
@@ -164,23 +180,36 @@ var Polygon = function (_super) {
164
180
  return Polygon;
165
181
  }(Drawable);
166
182
  var cn = classNames__default["default"].bind(MintMap_module);
183
+ var DEFAULT_CENTER = {
184
+ lat: 37.5036845,
185
+ lng: 127.0448698
186
+ };
167
187
  function MintMap(_a) {
168
188
  var mapType = _a.mapType,
169
189
  children = _a.children,
170
- props = tslib.__rest(_a, ["mapType", "children"]);
190
+ _b = _a.base,
191
+ base = _b === void 0 ? {
192
+ center: DEFAULT_CENTER,
193
+ zoomLevel: 12
194
+ } : _b,
195
+ props = tslib.__rest(_a, ["mapType", "children", "base"]);
171
196
 
172
- var _b = React.useState(),
173
- controller = _b[0],
174
- setController = _b[1];
197
+ var _c = React.useState(),
198
+ controller = _c[0],
199
+ setController = _c[1];
175
200
 
176
201
  React.useEffect(function () {
177
202
  if (mapType && mapType.length > 0) {
178
203
  setController(undefined);
179
- var newController_1 = mapType === 'naver' ? new NaverMintMapController.NaverMintMapController(tslib.__assign({
204
+ var newController_1 = mapType === 'naver' ? new NaverMintMapController.NaverMintMapController(tslib.__assign(tslib.__assign({
180
205
  mapType: mapType
181
- }, props)) : mapType === 'google' ? new GoogleMintMapController.GoogleMintMapController(tslib.__assign({
206
+ }, props), {
207
+ base: base
208
+ })) : mapType === 'google' ? new GoogleMintMapController.GoogleMintMapController(tslib.__assign(tslib.__assign({
182
209
  mapType: mapType
183
- }, props)) : null;
210
+ }, props), {
211
+ base: base
212
+ })) : null;
184
213
 
185
214
  if (newController_1) {
186
215
  newController_1.loadMapApi().then(function () {
@@ -197,7 +226,9 @@ function MintMap(_a) {
197
226
  controller: controller
198
227
  }, React__default["default"].createElement(MintMapCore.MintMapCore, tslib.__assign({
199
228
  mapType: mapType
200
- }, props), children)) : React__default["default"].createElement(PointLoading, {
229
+ }, props, {
230
+ base: base
231
+ }), children)) : React__default["default"].createElement(PointLoading, {
201
232
  text: "Loading"
202
233
  }));
203
234
  }