@mint-ui/map 0.10.0-beta-test2 → 1.0.0
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 +81 -73
- package/dist/components/mint-map/MintMap.d.ts +10 -10
- package/dist/components/mint-map/MintMap.js +6 -6
- package/dist/components/mint-map/core/MintMapCanvasRenderer.d.ts +4 -4
- package/dist/components/mint-map/core/MintMapController.d.ts +70 -70
- package/dist/components/mint-map/core/MintMapController.js +9 -9
- 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/MapLoadingComponents.d.ts +17 -17
- package/dist/components/mint-map/core/advanced/canvas/CanvasMarker.d.ts +18 -18
- package/dist/components/mint-map/core/advanced/canvas/CanvasMarker.js +0 -1
- package/dist/components/mint-map/core/advanced/canvas/draw/canvas-util.d.ts +5 -5
- package/dist/components/mint-map/core/advanced/canvas/index.d.ts +1 -1
- package/dist/components/mint-map/core/advanced/index.d.ts +4 -4
- package/dist/components/mint-map/core/advanced/shapes/CircleMarker.d.ts +22 -22
- package/dist/components/mint-map/core/advanced/shapes/CircleMarker.js +6 -6
- package/dist/components/mint-map/core/advanced/shapes/PolygonMarker.d.ts +28 -28
- package/dist/components/mint-map/core/advanced/shapes/PolygonMarker.js +6 -6
- package/dist/components/mint-map/core/advanced/shapes/base/SVGCircle.d.ts +8 -8
- package/dist/components/mint-map/core/advanced/shapes/base/SVGPolygon.d.ts +12 -12
- package/dist/components/mint-map/core/advanced/shapes/base/SVGRect.d.ts +10 -10
- package/dist/components/mint-map/core/advanced/shapes/base/index.d.ts +3 -3
- package/dist/components/mint-map/core/advanced/shapes/index.d.ts +3 -3
- 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 +8 -8
- package/dist/components/mint-map/core/provider/MintMapProvider.d.ts +8 -8
- package/dist/components/mint-map/core/provider/index.d.ts +1 -2
- package/dist/components/mint-map/core/util/animation.d.ts +16 -16
- package/dist/components/mint-map/core/util/cluster.d.ts +18 -18
- package/dist/components/mint-map/core/util/geo.d.ts +38 -38
- package/dist/components/mint-map/core/util/index.d.ts +8 -8
- package/dist/components/mint-map/core/util/log.d.ts +1 -1
- package/dist/components/mint-map/core/util/map.d.ts +2 -2
- package/dist/components/mint-map/core/util/polygon.d.ts +42 -42
- package/dist/components/mint-map/core/util/status.d.ts +9 -9
- package/dist/components/mint-map/core/util/waiting.d.ts +1 -1
- package/dist/components/mint-map/core/wrapper/MapCanvasMarkerWrapper.d.ts +27 -27
- package/dist/components/mint-map/core/wrapper/MapCanvasMarkerWrapper.js +6 -6
- package/dist/components/mint-map/core/wrapper/MapCanvasWrapper.d.ts +11 -11
- package/dist/components/mint-map/core/wrapper/MapCanvasWrapper.js +6 -6
- package/dist/components/mint-map/core/wrapper/MapControlWrapper.d.ts +20 -20
- package/dist/components/mint-map/core/wrapper/MapControlWrapper.js +6 -6
- package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.d.ts +51 -51
- package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.js +6 -20
- package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.d.ts +12 -12
- package/dist/components/mint-map/core/wrapper/MapPolygonWrapper.js +6 -6
- package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.d.ts +12 -12
- package/dist/components/mint-map/core/wrapper/MapPolylineWrapper.js +6 -6
- package/dist/components/mint-map/core/wrapper/index.d.ts +6 -6
- package/dist/components/mint-map/google/GoogleMintMapController.d.ts +53 -53
- package/dist/components/mint-map/index.d.ts +5 -5
- package/dist/components/mint-map/kakao/KakaoMintMapController.d.ts +57 -57
- package/dist/components/mint-map/kakao/KakaoMintMapController.js +7 -7
- package/dist/components/mint-map/naver/NaverMintMapController.d.ts +55 -55
- package/dist/components/mint-map/naver/NaverMintMapController.js +5 -5
- package/dist/components/mint-map/types/CommonTypes.d.ts +11 -11
- package/dist/components/mint-map/types/MapDrawables.d.ts +118 -118
- package/dist/components/mint-map/types/MapDrawables.js +8 -8
- package/dist/components/mint-map/types/MapEventTypes.d.ts +44 -44
- package/dist/components/mint-map/types/MapTypes.d.ts +60 -60
- package/dist/components/mint-map/types/MapTypes.js +13 -13
- package/dist/components/mint-map/types/MintMapEvents.d.ts +25 -25
- package/dist/components/mint-map/types/MintMapProps.d.ts +111 -111
- package/dist/components/mint-map/types/index.d.ts +6 -6
- package/dist/index.d.ts +7 -7
- package/dist/index.es.js +97 -193
- package/dist/index.js +0 -4
- package/dist/index.umd.js +96 -195
- package/package.json +77 -77
- package/dist/components/mint-map/core/provider/MarkerAutoTransitionProvider.d.ts +0 -20
- package/dist/components/mint-map/core/provider/MarkerAutoTransitionProvider.js +0 -105
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var React = require('react');
|
|
6
|
-
require('../../types/MapDrawables.js');
|
|
7
|
-
var MapTypes = require('../../types/MapTypes.js');
|
|
8
|
-
require('../../types/MapEventTypes.js');
|
|
9
|
-
require('../util/animation.js');
|
|
10
|
-
var geo = require('../util/geo.js');
|
|
11
|
-
require('tslib');
|
|
12
|
-
require('../util/polygon.js');
|
|
13
|
-
require('../util/status.js');
|
|
14
|
-
var MintMapProvider = require('./MintMapProvider.js');
|
|
15
|
-
|
|
16
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
|
-
|
|
18
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
|
-
|
|
20
|
-
var MarkerAutoTransitionContext = React.createContext({
|
|
21
|
-
option: {
|
|
22
|
-
sizeInMeter: 2,
|
|
23
|
-
type: 'diagonal'
|
|
24
|
-
},
|
|
25
|
-
transition: function (pos) {
|
|
26
|
-
return {
|
|
27
|
-
pos: pos,
|
|
28
|
-
no: undefined
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
}); // provider
|
|
32
|
-
|
|
33
|
-
var baseCenter = new MapTypes.Position(37.504497373023206, 127.04896282498558);
|
|
34
|
-
function MarkerAutoTransitionProvider(_a) {
|
|
35
|
-
var children = _a.children,
|
|
36
|
-
_b = _a.sizeInMeter,
|
|
37
|
-
sizeInMeter = _b === void 0 ? 2 : _b,
|
|
38
|
-
_c = _a.type,
|
|
39
|
-
type = _c === void 0 ? 'diagonal' : _c;
|
|
40
|
-
var controller = MintMapProvider.useMintMapController();
|
|
41
|
-
|
|
42
|
-
var _d = React.useState(controller.getZoomLevel()),
|
|
43
|
-
zoom = _d[0],
|
|
44
|
-
setZoom = _d[1];
|
|
45
|
-
|
|
46
|
-
React.useEffect(function () {
|
|
47
|
-
var onZoomChanged = function () {
|
|
48
|
-
setZoom(controller.getZoomLevel());
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
controller.addEventListener('ZOOM_CHANGED', onZoomChanged);
|
|
52
|
-
return function () {
|
|
53
|
-
controller.removeEventListener('ZOOM_CHANGED', onZoomChanged);
|
|
54
|
-
};
|
|
55
|
-
}, []);
|
|
56
|
-
var calcSize = typeof sizeInMeter === 'number' ? sizeInMeter : sizeInMeter(controller.getZoomLevel());
|
|
57
|
-
var deltaLat = geo.GeoCalulator.convertMeterToLatitudeValue(calcSize);
|
|
58
|
-
var offset1 = controller.positionToOffset(baseCenter);
|
|
59
|
-
var offset2 = controller.positionToOffset(new MapTypes.Position(baseCenter.lat + deltaLat, baseCenter.lng));
|
|
60
|
-
var deltaOffsetY = offset2.y - offset1.y;
|
|
61
|
-
var offset3 = new MapTypes.Offset(offset1.x + deltaOffsetY, offset2.y);
|
|
62
|
-
var deltaLng = baseCenter.lng - controller.offsetToPosition(offset3).lng;
|
|
63
|
-
var posMap = new Map();
|
|
64
|
-
|
|
65
|
-
var transition = function (pos) {
|
|
66
|
-
var key = positionToMapKey(pos);
|
|
67
|
-
var count = posMap.get(key);
|
|
68
|
-
|
|
69
|
-
if (count === undefined) {
|
|
70
|
-
count = 1;
|
|
71
|
-
posMap.set(key, count);
|
|
72
|
-
return {
|
|
73
|
-
no: count,
|
|
74
|
-
pos: pos
|
|
75
|
-
};
|
|
76
|
-
} //type : diagonal
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var newPos = new MapTypes.Position(pos.lat + count * deltaLat, pos.lng + count * deltaLng);
|
|
80
|
-
count += 1;
|
|
81
|
-
posMap.set(key, count);
|
|
82
|
-
return {
|
|
83
|
-
no: count,
|
|
84
|
-
pos: newPos
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
return React__default["default"].createElement(MarkerAutoTransitionContext.Provider, {
|
|
89
|
-
value: {
|
|
90
|
-
option: {
|
|
91
|
-
sizeInMeter: sizeInMeter,
|
|
92
|
-
type: type
|
|
93
|
-
},
|
|
94
|
-
transition: transition
|
|
95
|
-
}
|
|
96
|
-
}, zoom && children);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function positionToMapKey(pos) {
|
|
100
|
-
return "".concat(pos.lat, "-").concat(pos.lng);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
exports.MarkerAutoTransitionContext = MarkerAutoTransitionContext;
|
|
104
|
-
exports.MarkerAutoTransitionProvider = MarkerAutoTransitionProvider;
|
|
105
|
-
exports.baseCenter = baseCenter;
|