@mint-ui/map 0.10.0-beta-test2 → 1.0.1

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 CHANGED
@@ -1,110 +0,0 @@
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
- };
@@ -0,0 +1,94 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <code_scheme name="Project" version="173">
3
+ <JSCodeStyleSettings version="0">
4
+ <option name="FORCE_SEMICOLON_STYLE" value="true" />
5
+ <option name="SPACE_WITHIN_ARRAY_INITIALIZER_BRACKETS" value="true" />
6
+ <option name="USE_DOUBLE_QUOTES" value="false" />
7
+ <option name="FORCE_QUOTE_STYlE" value="true" />
8
+ <option name="ENFORCE_TRAILING_COMMA" value="Remove" />
9
+ <option name="VAR_DECLARATION_WRAP" value="2" />
10
+ <option name="OBJECT_LITERAL_WRAP" value="2" />
11
+ <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
12
+ <option name="SPACES_WITHIN_IMPORTS" value="true" />
13
+ <option name="FUNCTION_EXPRESSION_BRACE_STYLE" value="2" />
14
+ </JSCodeStyleSettings>
15
+ <TypeScriptCodeStyleSettings version="0">
16
+ <option name="FORCE_SEMICOLON_STYLE" value="true" />
17
+ <option name="SPACE_WITHIN_ARRAY_INITIALIZER_BRACKETS" value="true" />
18
+ <option name="USE_DOUBLE_QUOTES" value="false" />
19
+ <option name="FORCE_QUOTE_STYlE" value="true" />
20
+ <option name="ENFORCE_TRAILING_COMMA" value="Remove" />
21
+ <option name="VAR_DECLARATION_WRAP" value="2" />
22
+ <option name="OBJECT_LITERAL_WRAP" value="2" />
23
+ <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
24
+ <option name="SPACES_WITHIN_IMPORTS" value="true" />
25
+ </TypeScriptCodeStyleSettings>
26
+ <codeStyleSettings language="CSS">
27
+ <indentOptions>
28
+ <option name="USE_TAB_CHARACTER" value="true" />
29
+ <option name="SMART_TABS" value="true" />
30
+ <option name="KEEP_INDENTS_ON_EMPTY_LINES" value="true" />
31
+ </indentOptions>
32
+ </codeStyleSettings>
33
+ <codeStyleSettings language="HTML">
34
+ <indentOptions>
35
+ <option name="USE_TAB_CHARACTER" value="true" />
36
+ <option name="SMART_TABS" value="true" />
37
+ <option name="KEEP_INDENTS_ON_EMPTY_LINES" value="true" />
38
+ </indentOptions>
39
+ </codeStyleSettings>
40
+ <codeStyleSettings language="JSON">
41
+ <indentOptions>
42
+ <option name="USE_TAB_CHARACTER" value="true" />
43
+ <option name="KEEP_INDENTS_ON_EMPTY_LINES" value="true" />
44
+ </indentOptions>
45
+ </codeStyleSettings>
46
+ <codeStyleSettings language="JavaScript">
47
+ <option name="BLOCK_COMMENT_ADD_SPACE" value="true" />
48
+ <option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
49
+ <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
50
+ <option name="BRACE_STYLE" value="2" />
51
+ <option name="CLASS_BRACE_STYLE" value="2" />
52
+ <option name="METHOD_BRACE_STYLE" value="2" />
53
+ <option name="ELSE_ON_NEW_LINE" value="true" />
54
+ <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
55
+ <option name="ALIGN_MULTILINE_FOR" value="false" />
56
+ <option name="METHOD_CALL_CHAIN_WRAP" value="2" />
57
+ <option name="IF_BRACE_FORCE" value="1" />
58
+ <option name="DOWHILE_BRACE_FORCE" value="1" />
59
+ <option name="WHILE_BRACE_FORCE" value="1" />
60
+ <option name="FOR_BRACE_FORCE" value="1" />
61
+ <indentOptions>
62
+ <option name="SMART_TABS" value="true" />
63
+ <option name="KEEP_INDENTS_ON_EMPTY_LINES" value="true" />
64
+ </indentOptions>
65
+ </codeStyleSettings>
66
+ <codeStyleSettings language="TypeScript">
67
+ <option name="BLOCK_COMMENT_ADD_SPACE" value="true" />
68
+ <option name="KEEP_FIRST_COLUMN_COMMENT" value="false" />
69
+ <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
70
+ <option name="ELSE_ON_NEW_LINE" value="true" />
71
+ <option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
72
+ <option name="ALIGN_MULTILINE_FOR" value="false" />
73
+ <option name="METHOD_CALL_CHAIN_WRAP" value="2" />
74
+ <option name="IF_BRACE_FORCE" value="1" />
75
+ <option name="DOWHILE_BRACE_FORCE" value="1" />
76
+ <option name="WHILE_BRACE_FORCE" value="1" />
77
+ <option name="FOR_BRACE_FORCE" value="1" />
78
+ <indentOptions>
79
+ <option name="INDENT_SIZE" value="2" />
80
+ <option name="CONTINUATION_INDENT_SIZE" value="2" />
81
+ <option name="TAB_SIZE" value="2" />
82
+ <option name="SMART_TABS" value="true" />
83
+ <option name="KEEP_INDENTS_ON_EMPTY_LINES" value="true" />
84
+ </indentOptions>
85
+ </codeStyleSettings>
86
+ <codeStyleSettings language="XML">
87
+ <indentOptions>
88
+ <option name="USE_TAB_CHARACTER" value="true" />
89
+ <option name="SMART_TABS" value="true" />
90
+ <option name="KEEP_INDENTS_ON_EMPTY_LINES" value="true" />
91
+ </indentOptions>
92
+ </codeStyleSettings>
93
+ </code_scheme>
94
+ </component>
@@ -0,0 +1,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
+ </state>
5
+ </component>
@@ -0,0 +1,15 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="GitToolBoxProjectSettings">
4
+ <option name="commitMessageIssueKeyValidationOverride">
5
+ <BoolValueOverride>
6
+ <option name="enabled" value="true" />
7
+ </BoolValueOverride>
8
+ </option>
9
+ <option name="commitMessageValidationEnabledOverride">
10
+ <BoolValueOverride>
11
+ <option name="enabled" value="true" />
12
+ </BoolValueOverride>
13
+ </option>
14
+ </component>
15
+ </project>
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
+ </profile>
6
+ </component>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
  - Control various map with one interface
5
5
  - Google, Naver, Kakao map supported now
6
6
  - Typescript supported
7
- - Canvas marker supported (experimental)
7
+ - Canvas marker supported
8
8
 
9
9
  ## Installation
10
10
 
@@ -42,25 +42,32 @@ function MyMapComponent(){
42
42
 
43
43
  </MapMarkerWrapper>
44
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)
45
+ {/* Canvas marker */}
46
+ <CanvasMarker
47
+
48
+ /* Canvas renderer */
49
+ renderer={({ context, offset, payload }) => {
50
+ context.beginPath();
51
+
52
+ // rect
53
+ context.rect(offset[0].x, offset[0].y, 20, 20);
54
+ context.fillStyle = 'orange';
55
+ context.fill();
56
+
57
+ // rect outline
58
+ context.strokeStyle = 'red';
59
+ context.strokeRect(offset[0].x, offset[0].y, 20, 20);
60
+
61
+ // font
62
+ context.fillStyle = 'white';
63
+ context.font = '10px caption';
64
+ context.fillText(String(payload?.no), offset[0].x + 2, offset[0].y + 14);
65
+ context.closePath();
59
66
  }}
60
- ></MapCanvasMarkerWrapper>
67
+ zIndex={2}
68
+ data={markers}
69
+ />
61
70
 
62
- </MapCanvasWrapper>
63
-
64
71
  </MintMap>
65
72
 
66
73
  }
@@ -70,4 +77,5 @@ root.render((<MyMapComponent/>))
70
77
  ```
71
78
 
72
79
  ## Document / Reference Site
73
- - To be continue...
80
+
81
+ [https://dev-rsquare.github.io/mint-ui-map-guide](https://dev-rsquare.github.io/mint-ui-map-guide)
@@ -19,6 +19,7 @@ export declare abstract class MintMapController {
19
19
  abstract getCenter(): Position;
20
20
  abstract setCenter(position: Position): void;
21
21
  abstract setMapCursor(cursor: Property.Cursor): void;
22
+ abstract focusPositionsToFitViewport(positions: Position[]): void;
22
23
  abstract createMarker(marker: Marker): void;
23
24
  abstract updateMarker(marker: Marker, options: MarkerOptions): void;
24
25
  abstract clearDrawable(drawable: Drawable): boolean;
@@ -64,7 +65,6 @@ export declare abstract class MintMapController {
64
65
  checkBoundsChangeThrottleTime(): boolean;
65
66
  getBaseToMapZoom(zoomBase: number): number;
66
67
  getMapToBaseZoom(mapZoom: number): number;
67
- focusPositionsToFitViewport(positions: Position[]): void;
68
68
  morph(position: Position, zoom: number, option?: Record<string, unknown>): void;
69
69
  printStatus(): void;
70
70
  }
@@ -7,7 +7,7 @@ var uuid = require('uuid');
7
7
  var MapTypes = require('../types/MapTypes.js');
8
8
  require('./util/animation.js');
9
9
  require('./util/geo.js');
10
- var polygon = require('./util/polygon.js');
10
+ require('./util/polygon.js');
11
11
  var status = require('./util/status.js');
12
12
  var map = require('./util/map.js');
13
13
 
@@ -173,58 +173,6 @@ function () {
173
173
  throw new Error("[getMapToBaseZoom][".concat(mapZoom, "] is not valid zoom level"));
174
174
  };
175
175
 
176
- MintMapController.prototype.focusPositionsToFitViewport = function (positions) {
177
- var map = this; // positions 바운더리 구하기
178
-
179
- var markerBounds = polygon.PolygonCalculator.getRegionInfo(positions);
180
-
181
- if (!markerBounds.centerLat || !markerBounds.centerLng || !markerBounds.minLat || !markerBounds.maxLat || !markerBounds.minLng || !markerBounds.maxLng) {
182
- return;
183
- } // 이동해야할 센터 좌표
184
-
185
-
186
- var toCenter = new MapTypes.Position(markerBounds.centerLat, markerBounds.centerLng); // 센터로 이동
187
-
188
- map.setCenter(toCenter); // positions 바운더리의 폴리곤 값
189
-
190
- var markerBoundsToPolygon = [new MapTypes.Position(markerBounds.minLat, markerBounds.minLng), new MapTypes.Position(markerBounds.minLat, markerBounds.maxLng), new MapTypes.Position(markerBounds.maxLat, markerBounds.maxLng), new MapTypes.Position(markerBounds.maxLat, markerBounds.minLng)]; // 적정 줌레벨 구하기
191
-
192
- var zoomLevelResult = map.getZoomLevel();
193
- var currZoomLevel = zoomLevelResult;
194
- var iterCnt = 0;
195
- var direction = undefined;
196
-
197
- while (iterCnt < 23) {
198
- //최대 줌레벨 갯수 만큼만 반복...
199
- iterCnt += 1; // 줌 레벨 변경
200
-
201
- map.setZoomLevel(currZoomLevel); // 현재 바운더리 구하기
202
-
203
- var mapBounds = map.getCurrBounds(); // 현재 맵에 바운더리 포함된다면 줌레벨 더해서 반복 체크
204
-
205
- if (mapBounds.includes(markerBoundsToPolygon)) {
206
- if (direction === '-') {
207
- // 직전에 이미 빼고있는 상태였다면 여기서 종료
208
- break;
209
- }
210
-
211
- direction = '+';
212
- currZoomLevel += 1;
213
- } else {
214
- // 포함되지 않으면
215
- if (direction === '+') {
216
- // 직전에 이미 더한 상태였다면 직전 줌레벨로 종료
217
- currZoomLevel -= 1;
218
- map.setZoomLevel(currZoomLevel);
219
- break;
220
- } else {
221
- direction = '-';
222
- currZoomLevel -= 1;
223
- }
224
- }
225
- }
226
- };
227
-
228
176
  MintMapController.prototype.morph = function (position, zoom, option) {
229
177
  var naverMap = map.getMapOfType('naver', this.map);
230
178
 
@@ -5,7 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var tslib = require('tslib');
6
6
  var React = require('react');
7
7
  var MintMapProvider = require('../../provider/MintMapProvider.js');
8
- require('../../provider/MarkerAutoTransitionProvider.js');
9
8
  var MapDrawables = require('../../../types/MapDrawables.js');
10
9
  require('../../../types/MapTypes.js');
11
10
  require('../../../types/MapEventTypes.js');
@@ -1,2 +1 @@
1
1
  export * from "./MintMapProvider";
2
- export * from "./MarkerAutoTransitionProvider";
@@ -8,7 +8,6 @@ var reactDom = require('react-dom');
8
8
  var MintMapProvider = require('../provider/MintMapProvider.js');
9
9
  var MarkerMovingHook = require('../hooks/MarkerMovingHook.js');
10
10
  var MapDrawables = require('../../types/MapDrawables.js');
11
- var MarkerAutoTransitionProvider = require('../provider/MarkerAutoTransitionProvider.js');
12
11
 
13
12
  var offsetCalibration = function (mapType, divElement, options, autoFitToViewport, autoAdjustAnchor, autoAdjustAnchorConfig, mapDivElement) {
14
13
  //google 맵의 anchor 보정 (네이버와 같이 왼쪽/위 기준으로 처리)
@@ -215,21 +214,8 @@ function MapMarkerWrapper(_a) {
215
214
  };
216
215
  }, []); //create / update object
217
216
 
218
- var transition = React.useContext(MarkerAutoTransitionProvider.MarkerAutoTransitionContext).transition;
219
- var positionNo = React.useRef();
220
217
  React.useEffect(function () {
221
218
  if (options) {
222
- if (!Array.isArray(options.position)) {
223
- var _a = transition(options.position),
224
- no = _a.no,
225
- pos = _a.pos;
226
-
227
- if (positionNo.current !== no) {
228
- options.position = pos;
229
- positionNo.current = no;
230
- }
231
- }
232
-
233
219
  if (markerRef.current) {
234
220
  //console.log('update Marker')
235
221
  controller.updateMarker(markerRef.current, options); //disablePointerEvent 처리
@@ -45,6 +45,7 @@ export declare class GoogleMintMapController extends MintMapController {
45
45
  getCenter(): Position;
46
46
  setCenter(position: Position): void;
47
47
  setMapCursor(cursor: Property.Cursor): void;
48
+ focusPositionsToFitViewport(posiitons: Position[]): void;
48
49
  private eventMap;
49
50
  addEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
50
51
  removeEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
@@ -9,6 +9,17 @@ var MintMapController = require('../core/MintMapController.js');
9
9
  var waiting = require('../core/util/waiting.js');
10
10
  var MapEventTypes = require('../types/MapEventTypes.js');
11
11
  var MapTypes = require('../types/MapTypes.js');
12
+ require('../core/MintMapCore.js');
13
+ require('react');
14
+ require('../types/MapDrawables.js');
15
+ require('../core/provider/MintMapProvider.js');
16
+ require('react-dom');
17
+ require('../core/util/animation.js');
18
+ require('../core/util/geo.js');
19
+ var polygon = require('../core/util/polygon.js');
20
+ require('../naver/NaverMintMapController.js');
21
+ require('../core/advanced/MapLoadingComponents.js');
22
+ require('../core/wrapper/MapControlWrapper.js');
12
23
 
13
24
  var GoogleMintMapController =
14
25
  /** @class */
@@ -445,7 +456,7 @@ function (_super) {
445
456
  return tslib.__generator(this, function (_g) {
446
457
  switch (_g.label) {
447
458
  case 0:
448
- //이미 생성했으면
459
+ //이미 생성했으면
449
460
  //1. divElement 가 그대로인 경우 기존 map 객체 리턴
450
461
  //2. divElement 가 바뀐경우 기존 map 객체 destroy 하고 새로 생성
451
462
  if (this.mapInitialized && this.map) {
@@ -601,6 +612,19 @@ function (_super) {
601
612
  });
602
613
  };
603
614
 
615
+ GoogleMintMapController.prototype.focusPositionsToFitViewport = function (posiitons) {
616
+ var _a;
617
+
618
+ var markerBounds = polygon.PolygonCalculator.getRegionInfo(posiitons);
619
+
620
+ if (!markerBounds.maxLat || !markerBounds.minLat || !markerBounds.maxLng || !markerBounds.minLng) {
621
+ throw new Error('markerBounds is invalid! in focusPositionsToFitViewport');
622
+ }
623
+
624
+ var pointBounds = new google.maps.LatLngBounds(new google.maps.LatLng(markerBounds.minLat, markerBounds.minLng), new google.maps.LatLng(markerBounds.maxLat, markerBounds.maxLng));
625
+ (_a = this.map) === null || _a === void 0 ? void 0 : _a.fitBounds(pointBounds);
626
+ };
627
+
604
628
  GoogleMintMapController.prototype.addEventListener = function (eventName, callback) {
605
629
  var _this = this;
606
630
 
@@ -49,6 +49,7 @@ export declare class KakaoMintMapController extends MintMapController {
49
49
  setMapCursor(cursor: Property.Cursor): void;
50
50
  private positionToLatLng;
51
51
  private latLngToPosition;
52
+ focusPositionsToFitViewport(positions: Position[]): void;
52
53
  private eventMap;
53
54
  addEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
54
55
  removeEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
@@ -10,6 +10,17 @@ var MapTypes = require('../types/MapTypes.js');
10
10
  var MapEventTypes = require('../types/MapEventTypes.js');
11
11
  var log = require('../core/util/log.js');
12
12
  var status = require('../core/util/status.js');
13
+ require('../core/MintMapCore.js');
14
+ require('react');
15
+ require('../types/MapDrawables.js');
16
+ require('../core/provider/MintMapProvider.js');
17
+ require('react-dom');
18
+ require('../core/util/animation.js');
19
+ require('../core/util/geo.js');
20
+ var polygon = require('../core/util/polygon.js');
21
+ require('../naver/NaverMintMapController.js');
22
+ require('../core/advanced/MapLoadingComponents.js');
23
+ require('../core/wrapper/MapControlWrapper.js');
13
24
 
14
25
  var KakaoMintMapController =
15
26
  /** @class */
@@ -641,6 +652,19 @@ function (_super) {
641
652
  return latLng ? new MapTypes.Position(latLng.getLat(), latLng.getLng()) : new MapTypes.Position(0, 0);
642
653
  };
643
654
 
655
+ KakaoMintMapController.prototype.focusPositionsToFitViewport = function (positions) {
656
+ var _a;
657
+
658
+ var markerBounds = polygon.PolygonCalculator.getRegionInfo(positions);
659
+
660
+ if (!markerBounds.maxLat || !markerBounds.minLat || !markerBounds.maxLng || !markerBounds.minLng) {
661
+ throw new Error('markerBounds is invalid! in focusPositionsToFitViewport');
662
+ }
663
+
664
+ var pointBounds = new kakao.maps.LatLngBounds(new kakao.maps.LatLng(markerBounds.minLat, markerBounds.minLng), new kakao.maps.LatLng(markerBounds.maxLat, markerBounds.maxLng));
665
+ (_a = this.map) === null || _a === void 0 ? void 0 : _a.setBounds(pointBounds);
666
+ };
667
+
644
668
  KakaoMintMapController.prototype.addEventListener = function (eventName, callback) {
645
669
  var _this = this;
646
670
 
@@ -46,6 +46,7 @@ export declare class NaverMintMapController extends MintMapController {
46
46
  getCenter(): Position;
47
47
  setCenter(position: Position): void;
48
48
  setMapCursor(cursor: Property.Cursor): void;
49
+ focusPositionsToFitViewport(positions: Position[]): void;
49
50
  naverPositionToOffset(position: Position): Offset;
50
51
  private eventMap;
51
52
  addEventListener(eventName: MapEventName, callback: EventCallback<EventParamType>): void;
@@ -10,6 +10,16 @@ var MapTypes = require('../types/MapTypes.js');
10
10
  var MapEventTypes = require('../types/MapEventTypes.js');
11
11
  var log = require('../core/util/log.js');
12
12
  var status = require('../core/util/status.js');
13
+ require('../core/MintMapCore.js');
14
+ require('react');
15
+ require('../types/MapDrawables.js');
16
+ require('../core/provider/MintMapProvider.js');
17
+ require('react-dom');
18
+ require('../core/util/animation.js');
19
+ require('../core/util/geo.js');
20
+ var polygon = require('../core/util/polygon.js');
21
+ require('../core/advanced/MapLoadingComponents.js');
22
+ require('../core/wrapper/MapControlWrapper.js');
13
23
 
14
24
  var NaverMintMapController =
15
25
  /** @class */
@@ -465,7 +475,7 @@ function (_super) {
465
475
  return tslib.__generator(this, function (_g) {
466
476
  switch (_g.label) {
467
477
  case 0:
468
- //이미 생성했으면
478
+ //이미 생성했으면
469
479
  //1. divElement 가 그대로인 경우 기존 map 객체 리턴
470
480
  //2. divElement 가 바뀐경우 기존 map 객체 destroy 하고 새로 생성
471
481
  if (this.mapInitialized && this.map) {
@@ -646,6 +656,21 @@ function (_super) {
646
656
  target && (target.style.cursor = cursor);
647
657
  };
648
658
 
659
+ NaverMintMapController.prototype.focusPositionsToFitViewport = function (positions) {
660
+ var _a;
661
+
662
+ var markerBounds = polygon.PolygonCalculator.getRegionInfo(positions);
663
+
664
+ if (!markerBounds.maxLat || !markerBounds.minLat || !markerBounds.maxLng || !markerBounds.minLng) {
665
+ throw new Error('markerBounds is invalid! in focusPositionsToFitViewport');
666
+ }
667
+
668
+ var pointBounds = naver.maps.PointBounds.bounds(new naver.maps.LatLng(markerBounds.minLat, markerBounds.minLng), new naver.maps.LatLng(markerBounds.maxLat, markerBounds.maxLng));
669
+ (_a = this.map) === null || _a === void 0 ? void 0 : _a.panToBounds(pointBounds, {
670
+ duration: 500
671
+ });
672
+ };
673
+
649
674
  NaverMintMapController.prototype.naverPositionToOffset = function (position) {
650
675
  if (!this.map) {
651
676
  return new MapTypes.Offset(0, 0);