@mint-ui/map 0.1.9-beta → 0.2.1-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +109 -109
- package/LICENSE +21 -21
- package/README.md +53 -53
- package/dist/components/mint-map/MintMap.d.ts +92 -92
- package/dist/components/mint-map/core/MintMapController.d.ts +33 -33
- package/dist/components/mint-map/core/MintMapCore.d.ts +3 -3
- package/dist/components/mint-map/core/advanced/MapBuildingProjection.d.ts +15 -15
- package/dist/components/mint-map/core/advanced/index.d.ts +1 -1
- package/dist/components/mint-map/core/hooks/MarkerMovingHook.d.ts +6 -6
- package/dist/components/mint-map/core/hooks/index.d.ts +1 -1
- package/dist/components/mint-map/core/index.d.ts +7 -7
- package/dist/components/mint-map/core/provider/MintMapProvider.d.ts +8 -8
- package/dist/components/mint-map/core/provider/index.d.ts +1 -1
- package/dist/components/mint-map/core/util/animation.d.ts +16 -16
- package/dist/components/mint-map/core/util/calculate.d.ts +34 -34
- package/dist/components/mint-map/core/util/index.d.ts +3 -3
- package/dist/components/mint-map/core/util/waiting.d.ts +1 -1
- package/dist/components/mint-map/core/wrapper/MapControlWrapper.d.ts +11 -11
- package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.d.ts +23 -23
- package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.d.ts +5 -5
- package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.d.ts +5 -5
- package/dist/components/mint-map/core/wrapper/index.d.ts +4 -4
- package/dist/components/mint-map/google/GoogleMintMapController.d.ts +35 -35
- package/dist/components/mint-map/google/GoogleMintMapController.js +3 -9
- package/dist/components/mint-map/index.d.ts +4 -4
- package/dist/components/mint-map/naver/NaverMintMapController.d.ts +38 -38
- package/dist/components/mint-map/naver/NaverMintMapController.js +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +6 -11
- package/dist/index.umd.js +5 -10
- package/package.json +76 -76
- 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,92 +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
|
-
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;
|
|
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;
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { Bounds, Drawable, MapType, MapVendorType, Marker, MarkerOptions, MintMapProps, Polygon, PolygonOptions, Polyline, PolylineOptions, Position } from "../MintMap";
|
|
2
|
-
export declare abstract class MintMapController {
|
|
3
|
-
abstract type: MapType;
|
|
4
|
-
abstract map: MapVendorType | null;
|
|
5
|
-
abstract scriptUrl: string;
|
|
6
|
-
abstract initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
|
|
7
|
-
abstract destroyMap(): void;
|
|
8
|
-
abstract loadMapApi(): Promise<boolean>;
|
|
9
|
-
abstract getCurrBounds(): Bounds;
|
|
10
|
-
abstract panningTo(targetCenter: Position): void;
|
|
11
|
-
abstract getZoomLevel(): number;
|
|
12
|
-
abstract setZoomLevel(zoom: number): void;
|
|
13
|
-
abstract createMarker(marker: Marker): void;
|
|
14
|
-
abstract updateMarker(marker: Marker, options: MarkerOptions): void;
|
|
15
|
-
abstract clearDrawable(drawable: Drawable): boolean;
|
|
16
|
-
abstract markerToTheTop(marker: Marker): void;
|
|
17
|
-
abstract isMapDragged(): boolean;
|
|
18
|
-
abstract setMapDragged(value: boolean): void;
|
|
19
|
-
abstract createPolyline(polyline: Polyline): void;
|
|
20
|
-
abstract updatePolyline(polyline: Polyline, options: PolylineOptions): void;
|
|
21
|
-
abstract createPolygon(polygon: Polygon): void;
|
|
22
|
-
abstract updatePolygon(polygon: Polygon, options: PolygonOptions): void;
|
|
23
|
-
mapProps: MintMapProps;
|
|
24
|
-
mapApiLoaded: boolean;
|
|
25
|
-
mapInitialized: boolean;
|
|
26
|
-
constructor(props: MintMapProps);
|
|
27
|
-
getMap(): MapVendorType | null;
|
|
28
|
-
getMapType(): MapType;
|
|
29
|
-
loadScript(url: string, id?: string): Promise<void>;
|
|
30
|
-
buildUrl(baseUrl: string, param: {
|
|
31
|
-
[key: string]: string | string[];
|
|
32
|
-
}): string;
|
|
33
|
-
}
|
|
1
|
+
import { Bounds, Drawable, MapType, MapVendorType, Marker, MarkerOptions, MintMapProps, Polygon, PolygonOptions, Polyline, PolylineOptions, Position } from "../MintMap";
|
|
2
|
+
export declare abstract class MintMapController {
|
|
3
|
+
abstract type: MapType;
|
|
4
|
+
abstract map: MapVendorType | null;
|
|
5
|
+
abstract scriptUrl: string;
|
|
6
|
+
abstract initializingMap(divElement: HTMLDivElement): Promise<MapVendorType>;
|
|
7
|
+
abstract destroyMap(): void;
|
|
8
|
+
abstract loadMapApi(): Promise<boolean>;
|
|
9
|
+
abstract getCurrBounds(): Bounds;
|
|
10
|
+
abstract panningTo(targetCenter: Position): void;
|
|
11
|
+
abstract getZoomLevel(): number;
|
|
12
|
+
abstract setZoomLevel(zoom: number): void;
|
|
13
|
+
abstract createMarker(marker: Marker): void;
|
|
14
|
+
abstract updateMarker(marker: Marker, options: MarkerOptions): void;
|
|
15
|
+
abstract clearDrawable(drawable: Drawable): boolean;
|
|
16
|
+
abstract markerToTheTop(marker: Marker): void;
|
|
17
|
+
abstract isMapDragged(): boolean;
|
|
18
|
+
abstract setMapDragged(value: boolean): void;
|
|
19
|
+
abstract createPolyline(polyline: Polyline): void;
|
|
20
|
+
abstract updatePolyline(polyline: Polyline, options: PolylineOptions): void;
|
|
21
|
+
abstract createPolygon(polygon: Polygon): void;
|
|
22
|
+
abstract updatePolygon(polygon: Polygon, options: PolygonOptions): void;
|
|
23
|
+
mapProps: MintMapProps;
|
|
24
|
+
mapApiLoaded: boolean;
|
|
25
|
+
mapInitialized: boolean;
|
|
26
|
+
constructor(props: MintMapProps);
|
|
27
|
+
getMap(): MapVendorType | null;
|
|
28
|
+
getMapType(): MapType;
|
|
29
|
+
loadScript(url: string, id?: string): Promise<void>;
|
|
30
|
+
buildUrl(baseUrl: string, param: {
|
|
31
|
+
[key: string]: string | string[];
|
|
32
|
+
}): string;
|
|
33
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PropsWithChildren } from "react";
|
|
2
|
-
import { MintMapProps } from "../MintMap";
|
|
3
|
-
export declare function MintMapCore({ onLoad, visible, base, children }: PropsWithChildren<MintMapProps>): JSX.Element;
|
|
1
|
+
import { PropsWithChildren } from "react";
|
|
2
|
+
import { MintMapProps } from "../MintMap";
|
|
3
|
+
export declare function MintMapCore({ onLoad, visible, base, children }: PropsWithChildren<MintMapProps>): JSX.Element;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Position } from "../../MintMap";
|
|
3
|
-
interface MapBuildingProjectionProps {
|
|
4
|
-
basePolygonPath: Position[];
|
|
5
|
-
numberOfFloor: number;
|
|
6
|
-
heightOfFloor?: number;
|
|
7
|
-
lineColor?: string;
|
|
8
|
-
lineOpacity?: number;
|
|
9
|
-
fillColor?: string;
|
|
10
|
-
fillOpacity?: number;
|
|
11
|
-
title?: string;
|
|
12
|
-
titleElement?: JSX.Element;
|
|
13
|
-
}
|
|
14
|
-
export declare function MapBuildingProjection(props: MapBuildingProjectionProps): JSX.Element;
|
|
15
|
-
export {};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Position } from "../../MintMap";
|
|
3
|
+
interface MapBuildingProjectionProps {
|
|
4
|
+
basePolygonPath: Position[];
|
|
5
|
+
numberOfFloor: number;
|
|
6
|
+
heightOfFloor?: number;
|
|
7
|
+
lineColor?: string;
|
|
8
|
+
lineOpacity?: number;
|
|
9
|
+
fillColor?: string;
|
|
10
|
+
fillOpacity?: number;
|
|
11
|
+
title?: string;
|
|
12
|
+
titleElement?: JSX.Element;
|
|
13
|
+
}
|
|
14
|
+
export declare function MapBuildingProjection(props: MapBuildingProjectionProps): JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './MapBuildingProjection';
|
|
1
|
+
export * from './MapBuildingProjection';
|