@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.
- package/.eslintrc.js +109 -109
- package/LICENSE +21 -21
- package/README.md +53 -53
- package/dist/components/mint-map/MintMap.d.ts +92 -88
- package/dist/components/mint-map/MintMap.js +42 -11
- package/dist/components/mint-map/core/MintMapController.d.ts +33 -32
- package/dist/components/mint-map/core/MintMapCore.d.ts +3 -3
- package/dist/components/mint-map/core/MintMapCore.js +10 -0
- 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 -29
- package/dist/components/mint-map/core/util/calculate.js +68 -8
- 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/MapMarkerWrapper.js +2 -4
- 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 -34
- package/dist/components/mint-map/google/GoogleMintMapController.js +19 -8
- package/dist/components/mint-map/index.d.ts +4 -4
- package/dist/components/mint-map/naver/NaverMintMapController.d.ts +38 -36
- package/dist/components/mint-map/naver/NaverMintMapController.js +45 -11
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +186 -42
- package/dist/index.umd.js +186 -42
- package/package.json +76 -76
- package/test.ts +6 -6
package/dist/index.umd.js
CHANGED
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
var onLoad = _a.onLoad,
|
|
44
44
|
_b = _a.visible,
|
|
45
45
|
visible = _b === void 0 ? true : _b,
|
|
46
|
+
base = _a.base,
|
|
46
47
|
children = _a.children;
|
|
47
48
|
var controller = useMintMapController();
|
|
48
49
|
var elementRef = React.useRef(null);
|
|
@@ -80,6 +81,15 @@
|
|
|
80
81
|
controller && controller.destroyMap();
|
|
81
82
|
};
|
|
82
83
|
}, [controller, elementRef]);
|
|
84
|
+
React.useEffect(function () {
|
|
85
|
+
if ((base === null || base === void 0 ? void 0 : base.zoomLevel) && controller && mapInitialized) {
|
|
86
|
+
var prevZoomLevel = controller === null || controller === void 0 ? void 0 : controller.getZoomLevel();
|
|
87
|
+
|
|
88
|
+
if (prevZoomLevel !== base.zoomLevel) {
|
|
89
|
+
controller === null || controller === void 0 ? void 0 : controller.setZoomLevel(base.zoomLevel);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}, [base]);
|
|
83
93
|
return React__default["default"].createElement("div", {
|
|
84
94
|
className: cn$2('mint-map-root'),
|
|
85
95
|
style: {
|
|
@@ -153,22 +163,82 @@
|
|
|
153
163
|
return false;
|
|
154
164
|
};
|
|
155
165
|
|
|
166
|
+
PolygonCalculator.getIncludedPositions = function (polygon, position) {
|
|
167
|
+
var targets = Array.isArray(position) ? position : [position];
|
|
168
|
+
var result = [];
|
|
169
|
+
var maxX = Math.max.apply(Math, polygon.map(function (pos) {
|
|
170
|
+
return pos.lng;
|
|
171
|
+
})) + 1;
|
|
172
|
+
var lines = this.convertPolygonToLinePoints(polygon);
|
|
173
|
+
|
|
174
|
+
for (var _i = 0, targets_1 = targets; _i < targets_1.length; _i++) {
|
|
175
|
+
var target = targets_1[_i];
|
|
176
|
+
var tempLine = this.convertPositionToPoints(target, new Position(target.lat, maxX));
|
|
177
|
+
var crossPoints = this.getCrossPointAll(lines, tempLine);
|
|
178
|
+
|
|
179
|
+
if (crossPoints.length > 0 && crossPoints.length % 2 != 0) {
|
|
180
|
+
result.push(target);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return result;
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
PolygonCalculator.convertPolygonToLinePoints = function (polygon) {
|
|
188
|
+
var lines = [];
|
|
189
|
+
|
|
190
|
+
for (var i = 0; i < polygon.length; i++) {
|
|
191
|
+
lines.push(this.convertPositionToPoints(polygon[i], polygon[i + 1 === polygon.length ? 0 : i + 1]));
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return lines;
|
|
195
|
+
};
|
|
196
|
+
|
|
156
197
|
PolygonCalculator.convertPositionToPoints = function (pos1, pos2) {
|
|
157
198
|
return new LinePoints(pos1.lng, pos1.lat, pos2.lng, pos2.lat);
|
|
158
199
|
};
|
|
159
200
|
|
|
160
|
-
PolygonCalculator.
|
|
201
|
+
PolygonCalculator.getCrossPoint = function (sr, tr) {
|
|
202
|
+
var p1 = (sr.x1 - sr.x2) * (tr.y1 - tr.y2) - (sr.y1 - sr.y2) * (tr.x1 - tr.x2);
|
|
203
|
+
|
|
204
|
+
if (p1 != 0) {
|
|
205
|
+
var x = ((sr.x1 * sr.y2 - sr.y1 * sr.x2) * (tr.x1 - tr.x2) - (sr.x1 - sr.x2) * (tr.x1 * tr.y2 - tr.y1 * tr.x2)) / p1;
|
|
206
|
+
var y = ((sr.x1 * sr.y2 - sr.y1 * sr.x2) * (tr.y1 - tr.y2) - (sr.y1 - sr.y2) * (tr.x1 * tr.y2 - tr.y1 * tr.x2)) / p1;
|
|
207
|
+
|
|
208
|
+
if (this.toFixedPosition((x - sr.x1) * (x - sr.x2)) <= 0 && this.toFixedPosition((y - sr.y1) * (y - sr.y2)) <= 0 && this.toFixedPosition((x - tr.x1) * (x - tr.x2)) <= 0 && this.toFixedPosition((y - tr.y1) * (y - tr.y2)) <= 0) {
|
|
209
|
+
return {
|
|
210
|
+
x: x,
|
|
211
|
+
y: y
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
PolygonCalculator.toFixedPosition = function (n) {
|
|
218
|
+
return Number(n.toFixed(15));
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
PolygonCalculator.getCrossPointAll = function (sr, tr) {
|
|
222
|
+
var result = [];
|
|
223
|
+
|
|
161
224
|
for (var _i = 0, sr_1 = sr; _i < sr_1.length; _i++) {
|
|
162
225
|
var tmp = sr_1[_i];
|
|
163
|
-
var
|
|
226
|
+
var p = this.getCrossPoint(tmp, tr);
|
|
164
227
|
|
|
165
|
-
if (
|
|
166
|
-
|
|
167
|
-
|
|
228
|
+
if (p) {
|
|
229
|
+
result.push(p);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
168
232
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
233
|
+
return result;
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
PolygonCalculator.findCrossPoint = function (sr, tr) {
|
|
237
|
+
for (var _i = 0, sr_2 = sr; _i < sr_2.length; _i++) {
|
|
238
|
+
var tmp = sr_2[_i];
|
|
239
|
+
|
|
240
|
+
if (this.getCrossPoint(tmp, tr)) {
|
|
241
|
+
return true;
|
|
172
242
|
}
|
|
173
243
|
}
|
|
174
244
|
|
|
@@ -357,7 +427,7 @@
|
|
|
357
427
|
});
|
|
358
428
|
}).setClear(function (item) {
|
|
359
429
|
item.setMap(null);
|
|
360
|
-
}).createPool(1000).setCheckLiveTimeInterval(1000);
|
|
430
|
+
}).createPool(this.mapProps.markerCachePoolSize && this.mapProps.markerCachePoolSize > 0 ? this.mapProps.markerCachePoolSize : 1000).setCheckLiveTimeInterval(1000);
|
|
361
431
|
};
|
|
362
432
|
|
|
363
433
|
NaverMintMapController.prototype.createPolyline = function (polyline) {
|
|
@@ -670,14 +740,14 @@
|
|
|
670
740
|
return tslib.__generator(this, function (_a) {
|
|
671
741
|
return [2, new Promise(function (resolve) {
|
|
672
742
|
return tslib.__awaiter(_this, void 0, void 0, function () {
|
|
673
|
-
var map;
|
|
743
|
+
var options, maxZoom, minZoom, map;
|
|
674
744
|
|
|
675
745
|
var _this = this;
|
|
676
746
|
|
|
677
|
-
var _a, _b;
|
|
747
|
+
var _a, _b, _c, _d;
|
|
678
748
|
|
|
679
|
-
return tslib.__generator(this, function (
|
|
680
|
-
switch (
|
|
749
|
+
return tslib.__generator(this, function (_e) {
|
|
750
|
+
switch (_e.label) {
|
|
681
751
|
case 0:
|
|
682
752
|
if (this.mapInitialized && this.map) {
|
|
683
753
|
if (this.map.getElement() === divElement) {
|
|
@@ -692,19 +762,37 @@
|
|
|
692
762
|
return [4, this.loadMapApi()];
|
|
693
763
|
|
|
694
764
|
case 1:
|
|
695
|
-
|
|
765
|
+
_e.sent();
|
|
696
766
|
|
|
697
|
-
|
|
767
|
+
_e.label = 2;
|
|
698
768
|
|
|
699
769
|
case 2:
|
|
700
|
-
|
|
770
|
+
options = {
|
|
701
771
|
center: (_a = this.mapProps.base) === null || _a === void 0 ? void 0 : _a.center,
|
|
702
772
|
zoom: (_b = this.mapProps.base) === null || _b === void 0 ? void 0 : _b.zoomLevel,
|
|
703
773
|
logoControl: false,
|
|
704
774
|
mapDataControl: false,
|
|
705
775
|
mapTypeControl: false,
|
|
706
776
|
scaleControl: false
|
|
707
|
-
}
|
|
777
|
+
};
|
|
778
|
+
maxZoom = 21;
|
|
779
|
+
minZoom = 6;
|
|
780
|
+
|
|
781
|
+
if ((_c = this.mapProps.base) === null || _c === void 0 ? void 0 : _c.maxZoomLevel) {
|
|
782
|
+
maxZoom = this.getSafeZoomValue(this.mapProps.base.maxZoomLevel);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
if ((_d = this.mapProps.base) === null || _d === void 0 ? void 0 : _d.minZoomLevel) {
|
|
786
|
+
minZoom = this.getSafeZoomValue(this.mapProps.base.minZoomLevel);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
if (minZoom > maxZoom) {
|
|
790
|
+
minZoom = 6;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
options.minZoom = minZoom;
|
|
794
|
+
options.maxZoom = maxZoom;
|
|
795
|
+
map = new naver.maps.Map(divElement, options);
|
|
708
796
|
map.addListener('dragstart', function (e) {
|
|
709
797
|
_this.dragStartPoint[0] = e.domEvent.clientX;
|
|
710
798
|
_this.dragStartPoint[1] = e.domEvent.clientY;
|
|
@@ -715,12 +803,12 @@
|
|
|
715
803
|
} else {
|
|
716
804
|
_this.dragged = true;
|
|
717
805
|
}
|
|
718
|
-
|
|
806
|
+
});
|
|
807
|
+
map.addListener('idle', function () {
|
|
719
808
|
_this.mapProps.onBoundsChanged && _this.mapProps.onBoundsChanged(_this.getCurrBounds());
|
|
720
809
|
});
|
|
721
810
|
map.addListener('zoom_changed', function () {
|
|
722
811
|
_this.map && _this.mapProps.onZoomChanged && _this.mapProps.onZoomChanged(_this.map.getZoom());
|
|
723
|
-
_this.mapProps.onBoundsChanged && _this.mapProps.onBoundsChanged(_this.getCurrBounds());
|
|
724
812
|
});
|
|
725
813
|
map.addListener('click', function (e) {
|
|
726
814
|
console.log('map click', e);
|
|
@@ -742,6 +830,16 @@
|
|
|
742
830
|
});
|
|
743
831
|
};
|
|
744
832
|
|
|
833
|
+
NaverMintMapController.prototype.getSafeZoomValue = function (value) {
|
|
834
|
+
if (value > 21) {
|
|
835
|
+
return 21;
|
|
836
|
+
} else if (value < 6) {
|
|
837
|
+
return 6;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
return value;
|
|
841
|
+
};
|
|
842
|
+
|
|
745
843
|
NaverMintMapController.prototype.destroyMap = function () {
|
|
746
844
|
var _a;
|
|
747
845
|
|
|
@@ -778,6 +876,12 @@
|
|
|
778
876
|
return ((_a = this.map) === null || _a === void 0 ? void 0 : _a.getZoom()) || 13;
|
|
779
877
|
};
|
|
780
878
|
|
|
879
|
+
NaverMintMapController.prototype.setZoomLevel = function (zoom) {
|
|
880
|
+
var _a;
|
|
881
|
+
|
|
882
|
+
(_a = this.map) === null || _a === void 0 ? void 0 : _a.setZoom(zoom, true);
|
|
883
|
+
};
|
|
884
|
+
|
|
781
885
|
return NaverMintMapController;
|
|
782
886
|
}(MintMapController);
|
|
783
887
|
|
|
@@ -1113,10 +1217,10 @@
|
|
|
1113
1217
|
|
|
1114
1218
|
var _this = this;
|
|
1115
1219
|
|
|
1116
|
-
var _a, _b;
|
|
1220
|
+
var _a, _b, _c, _d;
|
|
1117
1221
|
|
|
1118
|
-
return tslib.__generator(this, function (
|
|
1119
|
-
switch (
|
|
1222
|
+
return tslib.__generator(this, function (_e) {
|
|
1223
|
+
switch (_e.label) {
|
|
1120
1224
|
case 0:
|
|
1121
1225
|
if (this.mapInitialized && this.map) {
|
|
1122
1226
|
if (this.map.getDiv() === divElement) {
|
|
@@ -1129,22 +1233,27 @@
|
|
|
1129
1233
|
return [4, this.loadMapApi()];
|
|
1130
1234
|
|
|
1131
1235
|
case 1:
|
|
1132
|
-
|
|
1236
|
+
_e.sent();
|
|
1133
1237
|
|
|
1134
|
-
|
|
1238
|
+
_e.label = 2;
|
|
1135
1239
|
|
|
1136
1240
|
case 2:
|
|
1137
1241
|
map = new google.maps.Map(divElement, {
|
|
1138
1242
|
mapId: this.mapProps.mapId,
|
|
1139
1243
|
center: (_a = this.mapProps.base) === null || _a === void 0 ? void 0 : _a.center,
|
|
1140
|
-
maxZoom:
|
|
1141
|
-
minZoom:
|
|
1142
|
-
zoom: (
|
|
1244
|
+
maxZoom: (_b = this.mapProps.base) === null || _b === void 0 ? void 0 : _b.maxZoomLevel,
|
|
1245
|
+
minZoom: (_c = this.mapProps.base) === null || _c === void 0 ? void 0 : _c.minZoomLevel,
|
|
1246
|
+
zoom: (_d = this.mapProps.base) === null || _d === void 0 ? void 0 : _d.zoomLevel,
|
|
1247
|
+
disableDefaultUI: true,
|
|
1248
|
+
gestureHandling: 'greedy'
|
|
1143
1249
|
});
|
|
1144
1250
|
map.addListener('dragend', function () {
|
|
1145
1251
|
console.log('map dragend');
|
|
1146
1252
|
_this.mapProps.onBoundsChanged && _this.mapProps.onBoundsChanged(_this.getCurrBounds());
|
|
1147
1253
|
});
|
|
1254
|
+
map.addListener('idle', function () {
|
|
1255
|
+
_this.mapProps.onBoundsChanged && _this.mapProps.onBoundsChanged(_this.getCurrBounds());
|
|
1256
|
+
});
|
|
1148
1257
|
map.addListener('zoom_changed', function () {
|
|
1149
1258
|
console.log('zoom_changed');
|
|
1150
1259
|
_this.map && _this.mapProps.onZoomChanged && _this.mapProps.onZoomChanged(_this.map.getZoom());
|
|
@@ -1199,6 +1308,12 @@
|
|
|
1199
1308
|
return ((_a = this.map) === null || _a === void 0 ? void 0 : _a.getZoom()) || 13;
|
|
1200
1309
|
};
|
|
1201
1310
|
|
|
1311
|
+
GoogleMintMapController.prototype.setZoomLevel = function (zoom) {
|
|
1312
|
+
var _a;
|
|
1313
|
+
|
|
1314
|
+
(_a = this.map) === null || _a === void 0 ? void 0 : _a.setZoom(zoom);
|
|
1315
|
+
};
|
|
1316
|
+
|
|
1202
1317
|
return GoogleMintMapController;
|
|
1203
1318
|
}(MintMapController);
|
|
1204
1319
|
|
|
@@ -1253,10 +1368,26 @@
|
|
|
1253
1368
|
return new Position(this.nw.lat + (this.se.lat - this.nw.lat) / 2, this.nw.lng + (this.se.lng - this.nw.lng) / 2);
|
|
1254
1369
|
};
|
|
1255
1370
|
|
|
1256
|
-
Bounds.prototype.
|
|
1371
|
+
Bounds.prototype.getIncludedPositions = function (positions) {
|
|
1372
|
+
var result = [];
|
|
1373
|
+
|
|
1257
1374
|
for (var _i = 0, positions_1 = positions; _i < positions_1.length; _i++) {
|
|
1258
1375
|
var pos = positions_1[_i];
|
|
1259
1376
|
|
|
1377
|
+
if (!(this.nw.lat > pos.lat || this.se.lat < pos.lat || this.nw.lng > pos.lng || this.se.lng < pos.lng)) {
|
|
1378
|
+
result.push(pos);
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
return result;
|
|
1383
|
+
};
|
|
1384
|
+
|
|
1385
|
+
Bounds.prototype.includes = function (positions) {
|
|
1386
|
+
positions = Array.isArray(positions) ? positions : [positions];
|
|
1387
|
+
|
|
1388
|
+
for (var _i = 0, positions_2 = positions; _i < positions_2.length; _i++) {
|
|
1389
|
+
var pos = positions_2[_i];
|
|
1390
|
+
|
|
1260
1391
|
if (this.nw.lat > pos.lat || this.se.lat < pos.lat || this.nw.lng > pos.lng || this.se.lng < pos.lng) {
|
|
1261
1392
|
return false;
|
|
1262
1393
|
}
|
|
@@ -1266,8 +1397,8 @@
|
|
|
1266
1397
|
};
|
|
1267
1398
|
|
|
1268
1399
|
Bounds.prototype.includesOnlyOnePoint = function (positions) {
|
|
1269
|
-
for (var _i = 0,
|
|
1270
|
-
var pos =
|
|
1400
|
+
for (var _i = 0, positions_3 = positions; _i < positions_3.length; _i++) {
|
|
1401
|
+
var pos = positions_3[_i];
|
|
1271
1402
|
|
|
1272
1403
|
if (!(this.nw.lat > pos.lat || this.se.lat < pos.lat || this.nw.lng > pos.lng || this.se.lng < pos.lng)) {
|
|
1273
1404
|
return true;
|
|
@@ -1349,23 +1480,36 @@
|
|
|
1349
1480
|
return Polygon;
|
|
1350
1481
|
}(Drawable);
|
|
1351
1482
|
var cn$1 = classNames__default["default"].bind(styles$2);
|
|
1483
|
+
var DEFAULT_CENTER = {
|
|
1484
|
+
lat: 37.5036845,
|
|
1485
|
+
lng: 127.0448698
|
|
1486
|
+
};
|
|
1352
1487
|
function MintMap(_a) {
|
|
1353
1488
|
var mapType = _a.mapType,
|
|
1354
1489
|
children = _a.children,
|
|
1355
|
-
|
|
1490
|
+
_b = _a.base,
|
|
1491
|
+
base = _b === void 0 ? {
|
|
1492
|
+
center: DEFAULT_CENTER,
|
|
1493
|
+
zoomLevel: 12
|
|
1494
|
+
} : _b,
|
|
1495
|
+
props = tslib.__rest(_a, ["mapType", "children", "base"]);
|
|
1356
1496
|
|
|
1357
|
-
var
|
|
1358
|
-
controller =
|
|
1359
|
-
setController =
|
|
1497
|
+
var _c = React.useState(),
|
|
1498
|
+
controller = _c[0],
|
|
1499
|
+
setController = _c[1];
|
|
1360
1500
|
|
|
1361
1501
|
React.useEffect(function () {
|
|
1362
1502
|
if (mapType && mapType.length > 0) {
|
|
1363
1503
|
setController(undefined);
|
|
1364
|
-
var newController_1 = mapType === 'naver' ? new NaverMintMapController(tslib.__assign({
|
|
1504
|
+
var newController_1 = mapType === 'naver' ? new NaverMintMapController(tslib.__assign(tslib.__assign({
|
|
1365
1505
|
mapType: mapType
|
|
1366
|
-
}, props)
|
|
1506
|
+
}, props), {
|
|
1507
|
+
base: base
|
|
1508
|
+
})) : mapType === 'google' ? new GoogleMintMapController(tslib.__assign(tslib.__assign({
|
|
1367
1509
|
mapType: mapType
|
|
1368
|
-
}, props)
|
|
1510
|
+
}, props), {
|
|
1511
|
+
base: base
|
|
1512
|
+
})) : null;
|
|
1369
1513
|
|
|
1370
1514
|
if (newController_1) {
|
|
1371
1515
|
newController_1.loadMapApi().then(function () {
|
|
@@ -1382,7 +1526,9 @@
|
|
|
1382
1526
|
controller: controller
|
|
1383
1527
|
}, React__default["default"].createElement(MintMapCore, tslib.__assign({
|
|
1384
1528
|
mapType: mapType
|
|
1385
|
-
}, props
|
|
1529
|
+
}, props, {
|
|
1530
|
+
base: base
|
|
1531
|
+
}), children)) : React__default["default"].createElement(PointLoading, {
|
|
1386
1532
|
text: "Loading"
|
|
1387
1533
|
}));
|
|
1388
1534
|
}
|
|
@@ -1722,7 +1868,7 @@
|
|
|
1722
1868
|
divCloneRef.current && divCloneRef.current.removeEventListener('animationend', aniListener_1);
|
|
1723
1869
|
|
|
1724
1870
|
if (markerRef.current) {
|
|
1725
|
-
|
|
1871
|
+
controller.clearDrawable(markerRef.current);
|
|
1726
1872
|
}
|
|
1727
1873
|
|
|
1728
1874
|
divCloneRef.current = undefined;
|
|
@@ -1735,7 +1881,7 @@
|
|
|
1735
1881
|
divElement.removeEventListener('mouseover', onMouseOverHandler);
|
|
1736
1882
|
|
|
1737
1883
|
if (markerRef.current) {
|
|
1738
|
-
|
|
1884
|
+
controller.clearDrawable(markerRef.current);
|
|
1739
1885
|
}
|
|
1740
1886
|
}
|
|
1741
1887
|
};
|
|
@@ -1743,11 +1889,9 @@
|
|
|
1743
1889
|
React.useEffect(function () {
|
|
1744
1890
|
if (options) {
|
|
1745
1891
|
if (markerRef.current) {
|
|
1746
|
-
console.log('update Marker');
|
|
1747
1892
|
controller.updateMarker(markerRef.current, options);
|
|
1748
1893
|
offsetCalibration(controller.getMapType(), divElement, options);
|
|
1749
1894
|
} else {
|
|
1750
|
-
console.log('create Marker');
|
|
1751
1895
|
markerRef.current = new Marker(options);
|
|
1752
1896
|
markerRef.current.element = divElement;
|
|
1753
1897
|
controller.createMarker(markerRef.current);
|
package/package.json
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@mint-ui/map",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"main": "./dist/index.js",
|
|
5
|
-
"module": "./dist/index.es.js",
|
|
6
|
-
"browser": "./dist/index.umd.js",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"repository": "https://github.com/dev-rsquare/mint-ui-map",
|
|
9
|
-
"author": "RSQUARE",
|
|
10
|
-
"keywords": ["react", "map", "google", "naver", "library", "typescript"],
|
|
11
|
-
"license": "MIT",
|
|
12
|
-
"private": false,
|
|
13
|
-
"devDependencies": {
|
|
14
|
-
"@babel/core": "^7.18.2",
|
|
15
|
-
"@rollup/plugin-babel": "^5.3.1",
|
|
16
|
-
"@rollup/plugin-commonjs": "^22.0.0",
|
|
17
|
-
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
18
|
-
"@rollup/plugin-typescript": "^8.3.2",
|
|
19
|
-
"@storybook/addon-actions": "^6.5.7",
|
|
20
|
-
"@storybook/addon-essentials": "^6.5.7",
|
|
21
|
-
"@storybook/addon-interactions": "^6.5.7",
|
|
22
|
-
"@storybook/addon-links": "^6.5.7",
|
|
23
|
-
"@storybook/builder-webpack5": "^6.5.7",
|
|
24
|
-
"@storybook/manager-webpack5": "^6.5.7",
|
|
25
|
-
"@storybook/preset-scss": "^1.0.3",
|
|
26
|
-
"@storybook/react": "^6.5.7",
|
|
27
|
-
"@storybook/testing-library": "^0.0.11",
|
|
28
|
-
"@types/classnames": "^2.3.1",
|
|
29
|
-
"@types/react": "^18.0.12",
|
|
30
|
-
"@types/react-dom": "^18.0.9",
|
|
31
|
-
"@types/uuid": "^9.0.0",
|
|
32
|
-
"@typescript-eslint/eslint-plugin": "^5.27.0",
|
|
33
|
-
"@typescript-eslint/parser": "^5.27.0",
|
|
34
|
-
"babel-loader": "^8.2.5",
|
|
35
|
-
"babel-plugin-react-icons": "^0.1.1",
|
|
36
|
-
"css-loader": "^6.7.1",
|
|
37
|
-
"eslint": "^8.17.0",
|
|
38
|
-
"eslint-config-airbnb": "^19.0.4",
|
|
39
|
-
"eslint-config-prettier": "^8.5.0",
|
|
40
|
-
"eslint-plugin-import": "^2.26.0",
|
|
41
|
-
"eslint-plugin-jsx-a11y": "^6.5.1",
|
|
42
|
-
"eslint-plugin-prettier": "^4.0.0",
|
|
43
|
-
"eslint-plugin-react": "^7.30.0",
|
|
44
|
-
"eslint-plugin-react-hooks": "^4.5.0",
|
|
45
|
-
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
46
|
-
"eslint-plugin-storybook": "^0.5.12",
|
|
47
|
-
"postcss": "^8.4.14",
|
|
48
|
-
"react": "^18.1.0",
|
|
49
|
-
"react-dom": "^18.1.0",
|
|
50
|
-
"rollup": "^2.75.5",
|
|
51
|
-
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
52
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
53
|
-
"sass": "^1.52.2",
|
|
54
|
-
"sass-loader": "^13.0.0",
|
|
55
|
-
"shx": "^0.3.4",
|
|
56
|
-
"style-loader": "^3.3.1",
|
|
57
|
-
"typescript": "^4.7.3"
|
|
58
|
-
},
|
|
59
|
-
"dependencies": {
|
|
60
|
-
"@types/google.maps": "^3.50.5",
|
|
61
|
-
"@types/navermaps": "^3.6.1",
|
|
62
|
-
"@mint-ui/tools":"1.0.3",
|
|
63
|
-
"axios": "^1.2.0",
|
|
64
|
-
"classnames": "^2.3.1",
|
|
65
|
-
"style-inject": "^0.3.0",
|
|
66
|
-
"uuid": "^9.0.0",
|
|
67
|
-
"xml-js": "^1.6.11"
|
|
68
|
-
},
|
|
69
|
-
"scripts": {
|
|
70
|
-
"storybook": "start-storybook -p 3000",
|
|
71
|
-
"build-storybook": "build-storybook",
|
|
72
|
-
"prebuild": "shx rm -rf ./dist",
|
|
73
|
-
"build": "rollup -c",
|
|
74
|
-
"postbuild": "shx rm -rf ./dist/dist"
|
|
75
|
-
}
|
|
76
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@mint-ui/map",
|
|
3
|
+
"version": "0.1.9-beta",
|
|
4
|
+
"main": "./dist/index.js",
|
|
5
|
+
"module": "./dist/index.es.js",
|
|
6
|
+
"browser": "./dist/index.umd.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"repository": "https://github.com/dev-rsquare/mint-ui-map",
|
|
9
|
+
"author": "RSQUARE",
|
|
10
|
+
"keywords": ["react", "map", "google", "naver", "library", "typescript"],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"private": false,
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@babel/core": "^7.18.2",
|
|
15
|
+
"@rollup/plugin-babel": "^5.3.1",
|
|
16
|
+
"@rollup/plugin-commonjs": "^22.0.0",
|
|
17
|
+
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
18
|
+
"@rollup/plugin-typescript": "^8.3.2",
|
|
19
|
+
"@storybook/addon-actions": "^6.5.7",
|
|
20
|
+
"@storybook/addon-essentials": "^6.5.7",
|
|
21
|
+
"@storybook/addon-interactions": "^6.5.7",
|
|
22
|
+
"@storybook/addon-links": "^6.5.7",
|
|
23
|
+
"@storybook/builder-webpack5": "^6.5.7",
|
|
24
|
+
"@storybook/manager-webpack5": "^6.5.7",
|
|
25
|
+
"@storybook/preset-scss": "^1.0.3",
|
|
26
|
+
"@storybook/react": "^6.5.7",
|
|
27
|
+
"@storybook/testing-library": "^0.0.11",
|
|
28
|
+
"@types/classnames": "^2.3.1",
|
|
29
|
+
"@types/react": "^18.0.12",
|
|
30
|
+
"@types/react-dom": "^18.0.9",
|
|
31
|
+
"@types/uuid": "^9.0.0",
|
|
32
|
+
"@typescript-eslint/eslint-plugin": "^5.27.0",
|
|
33
|
+
"@typescript-eslint/parser": "^5.27.0",
|
|
34
|
+
"babel-loader": "^8.2.5",
|
|
35
|
+
"babel-plugin-react-icons": "^0.1.1",
|
|
36
|
+
"css-loader": "^6.7.1",
|
|
37
|
+
"eslint": "^8.17.0",
|
|
38
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
39
|
+
"eslint-config-prettier": "^8.5.0",
|
|
40
|
+
"eslint-plugin-import": "^2.26.0",
|
|
41
|
+
"eslint-plugin-jsx-a11y": "^6.5.1",
|
|
42
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
43
|
+
"eslint-plugin-react": "^7.30.0",
|
|
44
|
+
"eslint-plugin-react-hooks": "^4.5.0",
|
|
45
|
+
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
46
|
+
"eslint-plugin-storybook": "^0.5.12",
|
|
47
|
+
"postcss": "^8.4.14",
|
|
48
|
+
"react": "^18.1.0",
|
|
49
|
+
"react-dom": "^18.1.0",
|
|
50
|
+
"rollup": "^2.75.5",
|
|
51
|
+
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
52
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
53
|
+
"sass": "^1.52.2",
|
|
54
|
+
"sass-loader": "^13.0.0",
|
|
55
|
+
"shx": "^0.3.4",
|
|
56
|
+
"style-loader": "^3.3.1",
|
|
57
|
+
"typescript": "^4.7.3"
|
|
58
|
+
},
|
|
59
|
+
"dependencies": {
|
|
60
|
+
"@types/google.maps": "^3.50.5",
|
|
61
|
+
"@types/navermaps": "^3.6.1",
|
|
62
|
+
"@mint-ui/tools":"1.0.3",
|
|
63
|
+
"axios": "^1.2.0",
|
|
64
|
+
"classnames": "^2.3.1",
|
|
65
|
+
"style-inject": "^0.3.0",
|
|
66
|
+
"uuid": "^9.0.0",
|
|
67
|
+
"xml-js": "^1.6.11"
|
|
68
|
+
},
|
|
69
|
+
"scripts": {
|
|
70
|
+
"storybook": "start-storybook -p 3000",
|
|
71
|
+
"build-storybook": "build-storybook",
|
|
72
|
+
"prebuild": "shx rm -rf ./dist",
|
|
73
|
+
"build": "rollup -c",
|
|
74
|
+
"postbuild": "shx rm -rf ./dist/dist"
|
|
75
|
+
}
|
|
76
|
+
}
|
package/test.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const aa = [1,2,3]
|
|
2
|
-
|
|
3
|
-
aa.push = new Proxy(aa.push, {
|
|
4
|
-
apply(target, thisArg, argArray) {
|
|
5
|
-
|
|
6
|
-
},
|
|
1
|
+
const aa = [1,2,3]
|
|
2
|
+
|
|
3
|
+
aa.push = new Proxy(aa.push, {
|
|
4
|
+
apply(target, thisArg, argArray) {
|
|
5
|
+
|
|
6
|
+
},
|
|
7
7
|
})
|