@mint-ui/map 0.5.5-beta → 0.5.7-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 +73 -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 +65 -64
- package/dist/components/mint-map/core/MintMapController.js +17 -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/index.d.ts +3 -3
- package/dist/components/mint-map/core/advanced/shapes/CircleMarker.d.ts +20 -20
- package/dist/components/mint-map/core/advanced/shapes/CircleMarker.js +7 -6
- package/dist/components/mint-map/core/advanced/shapes/PolygonMarker.d.ts +26 -23
- package/dist/components/mint-map/core/advanced/shapes/PolygonMarker.js +7 -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 -1
- 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 +7 -5
- package/dist/components/mint-map/core/util/log.d.ts +1 -0
- package/dist/components/mint-map/core/util/log.js +18 -0
- package/dist/components/mint-map/core/util/polygon.d.ts +42 -40
- package/dist/components/mint-map/core/util/polygon.js +37 -8
- package/dist/components/mint-map/core/util/status.d.ts +9 -0
- package/dist/components/mint-map/core/util/status.js +58 -0
- 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 +18 -18
- package/dist/components/mint-map/core/wrapper/MapControlWrapper.js +6 -6
- package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.d.ts +42 -42
- package/dist/components/mint-map/core/wrapper/MapMarkerWrapper.js +6 -6
- 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 +51 -51
- package/dist/components/mint-map/google/GoogleMintMapController.js +8 -0
- package/dist/components/mint-map/index.d.ts +5 -5
- package/dist/components/mint-map/kakao/KakaoMintMapController.d.ts +56 -56
- package/dist/components/mint-map/kakao/KakaoMintMapController.js +14 -7
- package/dist/components/mint-map/naver/NaverMintMapController.d.ts +54 -54
- package/dist/components/mint-map/naver/NaverMintMapController.js +16 -9
- package/dist/components/mint-map/types/CommonTypes.d.ts +11 -11
- package/dist/components/mint-map/types/MapDrawables.d.ts +118 -110
- 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 +96 -92
- package/dist/components/mint-map/types/index.d.ts +6 -6
- package/dist/index.d.ts +7 -7
- package/dist/index.es.js +462 -349
- package/dist/index.js +4 -0
- package/dist/index.umd.js +462 -347
- package/package.json +77 -77
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __awaiter, __generator, __extends, __assign, __rest
|
|
1
|
+
import { __awaiter, __generator, __spreadArray, __extends, __assign, __rest } from 'tslib';
|
|
2
2
|
import React, { createContext, useContext, useRef, useState, useEffect, useMemo, useCallback } from 'react';
|
|
3
3
|
import classNames from 'classnames/bind';
|
|
4
4
|
import styleInject from 'style-inject';
|
|
@@ -361,9 +361,30 @@ function () {
|
|
|
361
361
|
return false;
|
|
362
362
|
};
|
|
363
363
|
|
|
364
|
-
PolygonCalculator.simplifyPoints = function (polygon, tolerance,
|
|
365
|
-
|
|
366
|
-
|
|
364
|
+
PolygonCalculator.simplifyPoints = function (polygon, tolerance, _lastRepeated) {
|
|
365
|
+
return this.simplify(this.pathCleaning(polygon), tolerance !== undefined ? tolerance : this.TOLERANCE_NAVER_STYLE);
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
PolygonCalculator.pathCleaning = function (polygon) {
|
|
369
|
+
if (polygon.length < 3) {
|
|
370
|
+
return polygon;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
var main = polygon[0];
|
|
374
|
+
var delCount = 0;
|
|
375
|
+
|
|
376
|
+
for (var i = polygon.length - 1; i >= 0; i--) {
|
|
377
|
+
if (main.equals(polygon[i])) {
|
|
378
|
+
delCount += 1;
|
|
379
|
+
} else {
|
|
380
|
+
break;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
delCount > 0 && polygon.splice(polygon.length - delCount, delCount);
|
|
385
|
+
var out = [];
|
|
386
|
+
out.push.apply(out, polygon);
|
|
387
|
+
return out;
|
|
367
388
|
};
|
|
368
389
|
|
|
369
390
|
PolygonCalculator.simplify = function (points, tolerance) {
|
|
@@ -374,8 +395,10 @@ function () {
|
|
|
374
395
|
var dMax = 0;
|
|
375
396
|
var index = 0; // Find the point with the maximum distance from the line segment
|
|
376
397
|
|
|
398
|
+
var denominator = this.perpendicularDistanceDenominator(points[0], points[points.length - 1]);
|
|
399
|
+
|
|
377
400
|
for (var i = 1; i < points.length - 1; i++) {
|
|
378
|
-
var d = this.perpendicularDistance(points[i], points[0], points[points.length - 1]);
|
|
401
|
+
var d = this.perpendicularDistance(points[i], points[0], points[points.length - 1], denominator);
|
|
379
402
|
|
|
380
403
|
if (d > dMax) {
|
|
381
404
|
dMax = d;
|
|
@@ -393,19 +416,25 @@ function () {
|
|
|
393
416
|
// If the maximum distance is less than or equal to the tolerance, return the endpoints
|
|
394
417
|
return [points[0], points[points.length - 1]];
|
|
395
418
|
}
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
PolygonCalculator.perpendicularDistanceDenominator = function (lineStart, lineEnd) {
|
|
422
|
+
var x1 = lineStart.x,
|
|
423
|
+
y1 = lineStart.y;
|
|
424
|
+
var x2 = lineEnd.x,
|
|
425
|
+
y2 = lineEnd.y;
|
|
426
|
+
return Math.sqrt(Math.pow(y2 - y1, 2) + Math.pow(x2 - x1, 2));
|
|
396
427
|
}; // Calculate the perpendicular distance from a point to a line segment
|
|
397
428
|
|
|
398
429
|
|
|
399
|
-
PolygonCalculator.perpendicularDistance = function (point, lineStart, lineEnd) {
|
|
430
|
+
PolygonCalculator.perpendicularDistance = function (point, lineStart, lineEnd, denominator) {
|
|
400
431
|
var x = point.x;
|
|
401
432
|
var y = point.y;
|
|
402
433
|
var x1 = lineStart.x;
|
|
403
434
|
var y1 = lineStart.y;
|
|
404
435
|
var x2 = lineEnd.x;
|
|
405
436
|
var y2 = lineEnd.y;
|
|
406
|
-
|
|
407
|
-
var denominator = Math.sqrt(Math.pow(y2 - y1, 2) + Math.pow(x2 - x1, 2));
|
|
408
|
-
return numerator / denominator;
|
|
437
|
+
return Math.abs((y2 - y1) * x - (x2 - x1) * y + x2 * y1 - y2 * x1) / denominator;
|
|
409
438
|
};
|
|
410
439
|
|
|
411
440
|
PolygonCalculator.calculatePolygonSize = function (polygon, innerPolygons) {
|
|
@@ -444,23 +473,23 @@ function () {
|
|
|
444
473
|
return PolygonCalculator;
|
|
445
474
|
}();
|
|
446
475
|
|
|
447
|
-
/**
|
|
448
|
-
* 좌표값
|
|
449
|
-
* @description 위도/경도, DOM 상의 X/Y 좌표
|
|
476
|
+
/**
|
|
477
|
+
* 좌표값
|
|
478
|
+
* @description 위도/경도, DOM 상의 X/Y 좌표
|
|
450
479
|
*/
|
|
451
480
|
|
|
452
481
|
var Position =
|
|
453
482
|
/** @class */
|
|
454
483
|
function () {
|
|
455
484
|
function Position(lat, lng) {
|
|
456
|
-
/**
|
|
457
|
-
* 위도
|
|
458
|
-
* @description 위도(latitude)
|
|
485
|
+
/**
|
|
486
|
+
* 위도
|
|
487
|
+
* @description 위도(latitude)
|
|
459
488
|
*/
|
|
460
489
|
this.lat = 0;
|
|
461
|
-
/**
|
|
462
|
-
* 경도
|
|
463
|
-
* @description 경도(longitude)
|
|
490
|
+
/**
|
|
491
|
+
* 경도
|
|
492
|
+
* @description 경도(longitude)
|
|
464
493
|
*/
|
|
465
494
|
|
|
466
495
|
this.lng = 0;
|
|
@@ -568,15 +597,15 @@ function () {
|
|
|
568
597
|
|
|
569
598
|
return Bounds;
|
|
570
599
|
}();
|
|
571
|
-
/**
|
|
572
|
-
* DOM 상에서의 좌표를 표현 (픽셀을 나타내는 숫자)
|
|
600
|
+
/**
|
|
601
|
+
* DOM 상에서의 좌표를 표현 (픽셀을 나타내는 숫자)
|
|
573
602
|
*/
|
|
574
603
|
|
|
575
604
|
var Offset =
|
|
576
605
|
/** @class */
|
|
577
606
|
function () {
|
|
578
|
-
/**
|
|
579
|
-
* DOM 상에서의 좌표를 표현 (픽셀을 나타내는 숫자)
|
|
607
|
+
/**
|
|
608
|
+
* DOM 상에서의 좌표를 표현 (픽셀을 나타내는 숫자)
|
|
580
609
|
*/
|
|
581
610
|
function Offset(x, y) {
|
|
582
611
|
this.x = x;
|
|
@@ -703,6 +732,309 @@ function MintMapCore(_a) {
|
|
|
703
732
|
}));
|
|
704
733
|
}
|
|
705
734
|
|
|
735
|
+
var AnimationPlayer =
|
|
736
|
+
/** @class */
|
|
737
|
+
function () {
|
|
738
|
+
function AnimationPlayer(drawFunction, fps) {
|
|
739
|
+
this.prevtime = 0;
|
|
740
|
+
this.elapsedTime = 0;
|
|
741
|
+
this.fps = null;
|
|
742
|
+
this.baseDrawGapTime = null;
|
|
743
|
+
this.deltaTime = 0;
|
|
744
|
+
this.playing = false;
|
|
745
|
+
this.draw = drawFunction;
|
|
746
|
+
this.fps = fps || null;
|
|
747
|
+
|
|
748
|
+
if (fps !== undefined) {
|
|
749
|
+
this.baseDrawGapTime = 1000 / fps;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
this.init();
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
AnimationPlayer.prototype.init = function () {
|
|
756
|
+
this.deltaTime = 0;
|
|
757
|
+
this.prevtime = 0;
|
|
758
|
+
this.elapsedTime = 0;
|
|
759
|
+
this.playing = false;
|
|
760
|
+
};
|
|
761
|
+
|
|
762
|
+
AnimationPlayer.prototype.start = function () {
|
|
763
|
+
this.init();
|
|
764
|
+
this.resume();
|
|
765
|
+
};
|
|
766
|
+
|
|
767
|
+
AnimationPlayer.prototype.stop = function () {
|
|
768
|
+
this.playing = false;
|
|
769
|
+
};
|
|
770
|
+
|
|
771
|
+
AnimationPlayer.prototype.resume = function () {
|
|
772
|
+
this.playing = true; //@ts-ignore
|
|
773
|
+
|
|
774
|
+
window.requestAnimationFrame(this.makeFrame.bind(this));
|
|
775
|
+
};
|
|
776
|
+
|
|
777
|
+
AnimationPlayer.prototype.makeFrame = function (timestamp) {
|
|
778
|
+
//frame 간 시간 변화
|
|
779
|
+
if (this.prevtime === 0) {
|
|
780
|
+
this.prevtime = timestamp;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
this.deltaTime += timestamp - this.prevtime; //정해진 시간이 없거나, 정해진 시간이 지났으면 draw 호출
|
|
784
|
+
|
|
785
|
+
this.prevtime = timestamp;
|
|
786
|
+
|
|
787
|
+
if (!this.baseDrawGapTime || this.baseDrawGapTime <= this.deltaTime) {
|
|
788
|
+
//다음 루프 준비
|
|
789
|
+
this.elapsedTime += this.deltaTime; //draw 콜백에서 stop 신호오면 멈춤
|
|
790
|
+
|
|
791
|
+
var stopFlag = this.draw(this.deltaTime, this.elapsedTime); //delta 초기화
|
|
792
|
+
|
|
793
|
+
this.deltaTime = 0;
|
|
794
|
+
|
|
795
|
+
if (stopFlag) {
|
|
796
|
+
this.stop();
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
if (this.playing) {
|
|
801
|
+
//@ts-ignore
|
|
802
|
+
window.requestAnimationFrame(this.makeFrame.bind(this));
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
|
|
806
|
+
return AnimationPlayer;
|
|
807
|
+
}();
|
|
808
|
+
|
|
809
|
+
function waiting(evaluation, timeoutSeconds) {
|
|
810
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
811
|
+
var max;
|
|
812
|
+
return __generator(this, function (_a) {
|
|
813
|
+
max = (timeoutSeconds || 5) * 1000;
|
|
814
|
+
return [2
|
|
815
|
+
/*return*/
|
|
816
|
+
, new Promise(function (resolve) {
|
|
817
|
+
var start = new Date().getTime();
|
|
818
|
+
var inter = setInterval(function () {
|
|
819
|
+
//타임아웃 체크
|
|
820
|
+
var time = new Date().getTime();
|
|
821
|
+
|
|
822
|
+
if (time - start > max) {
|
|
823
|
+
clearInterval(inter);
|
|
824
|
+
resolve(false);
|
|
825
|
+
return;
|
|
826
|
+
} //평가식 체크
|
|
827
|
+
|
|
828
|
+
|
|
829
|
+
if (evaluation()) {
|
|
830
|
+
clearInterval(inter);
|
|
831
|
+
resolve(true);
|
|
832
|
+
}
|
|
833
|
+
}, 100);
|
|
834
|
+
})];
|
|
835
|
+
});
|
|
836
|
+
});
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
var getClusterInfo = function (basePixelSize, mapBounds, mapWidth, mapHeight, itemList, sizeFunction) {
|
|
840
|
+
var _a; //1. basePixelSize 기준으로 현재 지도 크기를 베이스로 영역 갯수 정하기
|
|
841
|
+
|
|
842
|
+
|
|
843
|
+
var rowCount = Number((mapWidth / basePixelSize).toFixed(0)) || 1;
|
|
844
|
+
var colCount = Number((mapHeight / basePixelSize).toFixed(0)) || 1; //console.log('rowCount', rowCount, 'colCount', colCount)
|
|
845
|
+
|
|
846
|
+
var boundsLineSizeX = Number(((mapBounds.ne.lng - mapBounds.nw.lng) / rowCount).toFixed(7));
|
|
847
|
+
var boundsLineSizeY = Number(((mapBounds.nw.lat - mapBounds.se.lat) / colCount).toFixed(7)); //console.log('boundsLineSize', boundsLineSizeX, boundsLineSizeY)
|
|
848
|
+
var boundsPos = [];
|
|
849
|
+
var tempX1, tempY1, tempX2, tempY2;
|
|
850
|
+
|
|
851
|
+
for (var i = 0; i < rowCount; i++) {
|
|
852
|
+
tempX1 = mapBounds.nw.lng + boundsLineSizeX * i;
|
|
853
|
+
tempX2 = mapBounds.nw.lng + boundsLineSizeX * (i + 1);
|
|
854
|
+
var rows = [];
|
|
855
|
+
boundsPos.push(rows);
|
|
856
|
+
|
|
857
|
+
for (var k = 0; k < colCount; k++) {
|
|
858
|
+
tempY2 = mapBounds.se.lat + boundsLineSizeY * k;
|
|
859
|
+
tempY1 = mapBounds.se.lat + boundsLineSizeY * (k + 1);
|
|
860
|
+
var thisBounds = Bounds.fromNWSE(new Position(tempY1, tempX1), new Position(tempY2, tempX2));
|
|
861
|
+
var includedList = thisBounds.getIncludedPositions(itemList);
|
|
862
|
+
rows.push({
|
|
863
|
+
bounds: thisBounds,
|
|
864
|
+
checked: false,
|
|
865
|
+
center: false,
|
|
866
|
+
centerPosition: thisBounds.getCenter(),
|
|
867
|
+
incList: [],
|
|
868
|
+
itemList: includedList,
|
|
869
|
+
size: basePixelSize
|
|
870
|
+
});
|
|
871
|
+
}
|
|
872
|
+
} //좌표마다 검사해서 인접셀 병합 처리
|
|
873
|
+
|
|
874
|
+
|
|
875
|
+
var centerList = [];
|
|
876
|
+
var totalItemCount = 0;
|
|
877
|
+
var min;
|
|
878
|
+
var max;
|
|
879
|
+
|
|
880
|
+
for (var i = 0; i < boundsPos.length; i++) {
|
|
881
|
+
for (var k = 0; k < boundsPos[i].length; k++) {
|
|
882
|
+
var curr = boundsPos[i][k];
|
|
883
|
+
if (curr.checked) continue;
|
|
884
|
+
curr.checked = true; //현재기준 8방향 객체 모으기
|
|
885
|
+
|
|
886
|
+
var incList = [];
|
|
887
|
+
|
|
888
|
+
if (boundsPos[i]) {
|
|
889
|
+
boundsPos[i][k - 1] && incList.push(boundsPos[i][k - 1]);
|
|
890
|
+
boundsPos[i][k + 1] && incList.push(boundsPos[i][k + 1]);
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
if (boundsPos[i - 1]) {
|
|
894
|
+
boundsPos[i - 1][k - 1] && incList.push(boundsPos[i - 1][k - 1]);
|
|
895
|
+
boundsPos[i - 1][k] && incList.push(boundsPos[i - 1][k]);
|
|
896
|
+
boundsPos[i - 1][k + 1] && incList.push(boundsPos[i - 1][k + 1]);
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
if (boundsPos[i + 1]) {
|
|
900
|
+
boundsPos[i + 1][k + 1] && incList.push(boundsPos[i + 1][k + 1]);
|
|
901
|
+
boundsPos[i + 1][k] && incList.push(boundsPos[i + 1][k]);
|
|
902
|
+
boundsPos[i + 1][k - 1] && incList.push(boundsPos[i + 1][k - 1]);
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
for (var _i = 0, incList_1 = incList; _i < incList_1.length; _i++) {
|
|
906
|
+
var inc = incList_1[_i];
|
|
907
|
+
if (inc.checked) continue;
|
|
908
|
+
inc.checked = true;
|
|
909
|
+
|
|
910
|
+
if (inc.itemList && inc.itemList.length > 0) {
|
|
911
|
+
curr.incList.push(inc);
|
|
912
|
+
|
|
913
|
+
(_a = curr.itemList).push.apply(_a, inc.itemList);
|
|
914
|
+
|
|
915
|
+
curr.center = true;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
if (curr.center) {
|
|
920
|
+
centerList.push(curr);
|
|
921
|
+
var avrLat = calculateAverage(curr.itemList.map(function (item) {
|
|
922
|
+
return item.lat;
|
|
923
|
+
}));
|
|
924
|
+
var avrLng = calculateAverage(curr.itemList.map(function (item) {
|
|
925
|
+
return item.lng;
|
|
926
|
+
}));
|
|
927
|
+
curr.centerPosition = new Position(avrLat, avrLng);
|
|
928
|
+
totalItemCount += curr.itemList.length;
|
|
929
|
+
|
|
930
|
+
if (!min || curr.itemList.length < min) {
|
|
931
|
+
min = curr.itemList.length;
|
|
932
|
+
}
|
|
933
|
+
|
|
934
|
+
if (!max || curr.itemList.length > max) {
|
|
935
|
+
max = curr.itemList.length;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
var status = {
|
|
942
|
+
total: totalItemCount,
|
|
943
|
+
average: totalItemCount / centerList.length,
|
|
944
|
+
min: min,
|
|
945
|
+
max: max
|
|
946
|
+
};
|
|
947
|
+
|
|
948
|
+
sizeFunction = sizeFunction || function (info, status) {
|
|
949
|
+
var minSize = basePixelSize / 4;
|
|
950
|
+
var maxSize = basePixelSize;
|
|
951
|
+
return Math.min(Math.max(basePixelSize * info.itemList.length / status.average, minSize), maxSize);
|
|
952
|
+
};
|
|
953
|
+
|
|
954
|
+
for (var _b = 0, centerList_1 = centerList; _b < centerList_1.length; _b++) {
|
|
955
|
+
var center = centerList_1[_b];
|
|
956
|
+
center.size = sizeFunction(center, status);
|
|
957
|
+
} // console.log('centerList', centerList, status);
|
|
958
|
+
|
|
959
|
+
|
|
960
|
+
return centerList;
|
|
961
|
+
};
|
|
962
|
+
|
|
963
|
+
var calculateAverage = function (nums) {
|
|
964
|
+
var sum = 0;
|
|
965
|
+
|
|
966
|
+
for (var _i = 0, nums_1 = nums; _i < nums_1.length; _i++) {
|
|
967
|
+
var num = nums_1[_i];
|
|
968
|
+
sum += num;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
return Number((sum / nums.length).toFixed(7));
|
|
972
|
+
};
|
|
973
|
+
|
|
974
|
+
function log(debug, label) {
|
|
975
|
+
var args = [];
|
|
976
|
+
|
|
977
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
|
978
|
+
args[_i - 2] = arguments[_i];
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
if (!debug) return;
|
|
982
|
+
args && console.log.apply(console, __spreadArray(['[mint-map debug]', label || ''], args, false));
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
var MintMapStatus =
|
|
986
|
+
/** @class */
|
|
987
|
+
function () {
|
|
988
|
+
function MintMapStatus() {
|
|
989
|
+
this.marker = 0;
|
|
990
|
+
this.byLabel = new Map();
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
MintMapStatus.prototype.init = function () {
|
|
994
|
+
this.marker = 0;
|
|
995
|
+
this.byLabel.clear();
|
|
996
|
+
};
|
|
997
|
+
|
|
998
|
+
MintMapStatus.prototype.print = function () {
|
|
999
|
+
var str = "[mint-map status]\n\nmarker : ".concat(this.marker, "\n ");
|
|
1000
|
+
|
|
1001
|
+
if (this.byLabel.size > 0) {
|
|
1002
|
+
str += '\n-------- status detail (by label) ----------';
|
|
1003
|
+
this.byLabel.forEach(function (val, key) {
|
|
1004
|
+
str += "\n(".concat(key, ") : ").concat(val);
|
|
1005
|
+
});
|
|
1006
|
+
str += '\n\n';
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
console.log(str);
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
MintMapStatus.prototype.setMarker = function (inc, label) {
|
|
1013
|
+
this.marker += inc;
|
|
1014
|
+
|
|
1015
|
+
if (label) {
|
|
1016
|
+
var curr = this.byLabel.get(label);
|
|
1017
|
+
var calc = 0;
|
|
1018
|
+
|
|
1019
|
+
if (curr === undefined) {
|
|
1020
|
+
calc = inc;
|
|
1021
|
+
} else {
|
|
1022
|
+
calc = curr + inc;
|
|
1023
|
+
}
|
|
1024
|
+
|
|
1025
|
+
if (calc === 0) {
|
|
1026
|
+
this.byLabel.delete(label);
|
|
1027
|
+
} else {
|
|
1028
|
+
this.byLabel.set(label, calc);
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
};
|
|
1032
|
+
|
|
1033
|
+
return MintMapStatus;
|
|
1034
|
+
}();
|
|
1035
|
+
|
|
1036
|
+
var Status = new MintMapStatus();
|
|
1037
|
+
|
|
706
1038
|
var MintMapController =
|
|
707
1039
|
/** @class */
|
|
708
1040
|
function () {
|
|
@@ -804,12 +1136,12 @@ function () {
|
|
|
804
1136
|
MintMapController.prototype.getRandomFunctionName = function (prefix) {
|
|
805
1137
|
return "".concat(prefix, "_").concat(v4().replace(/-/g, '_'));
|
|
806
1138
|
};
|
|
807
|
-
/**
|
|
808
|
-
* URL 빌더 메서드
|
|
809
|
-
*
|
|
810
|
-
* @param {string} baseUrl: 기본 URL
|
|
811
|
-
* @param {{ [ key: string ]: string | string[] }} param: 파라미터 JSON
|
|
812
|
-
* @returns {string} URL
|
|
1139
|
+
/**
|
|
1140
|
+
* URL 빌더 메서드
|
|
1141
|
+
*
|
|
1142
|
+
* @param {string} baseUrl: 기본 URL
|
|
1143
|
+
* @param {{ [ key: string ]: string | string[] }} param: 파라미터 JSON
|
|
1144
|
+
* @returns {string} URL
|
|
813
1145
|
*/
|
|
814
1146
|
|
|
815
1147
|
|
|
@@ -822,9 +1154,9 @@ function () {
|
|
|
822
1154
|
}).join('&');
|
|
823
1155
|
return "".concat(baseUrl, "?").concat(params);
|
|
824
1156
|
};
|
|
825
|
-
/**
|
|
826
|
-
* 쓰로틀링 처리
|
|
827
|
-
* @returns
|
|
1157
|
+
/**
|
|
1158
|
+
* 쓰로틀링 처리
|
|
1159
|
+
* @returns
|
|
828
1160
|
*/
|
|
829
1161
|
|
|
830
1162
|
|
|
@@ -865,6 +1197,10 @@ function () {
|
|
|
865
1197
|
throw new Error("[getMapToBaseZoom][".concat(mapZoom, "] is not valid zoom level"));
|
|
866
1198
|
};
|
|
867
1199
|
|
|
1200
|
+
MintMapController.prototype.printStatus = function () {
|
|
1201
|
+
Status.print();
|
|
1202
|
+
};
|
|
1203
|
+
|
|
868
1204
|
return MintMapController;
|
|
869
1205
|
}();
|
|
870
1206
|
|
|
@@ -1062,36 +1398,6 @@ function () {
|
|
|
1062
1398
|
return MapZoomInfo;
|
|
1063
1399
|
}();
|
|
1064
1400
|
|
|
1065
|
-
function waiting(evaluation, timeoutSeconds) {
|
|
1066
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
1067
|
-
var max;
|
|
1068
|
-
return __generator(this, function (_a) {
|
|
1069
|
-
max = (timeoutSeconds || 5) * 1000;
|
|
1070
|
-
return [2
|
|
1071
|
-
/*return*/
|
|
1072
|
-
, new Promise(function (resolve) {
|
|
1073
|
-
var start = new Date().getTime();
|
|
1074
|
-
var inter = setInterval(function () {
|
|
1075
|
-
//타임아웃 체크
|
|
1076
|
-
var time = new Date().getTime();
|
|
1077
|
-
|
|
1078
|
-
if (time - start > max) {
|
|
1079
|
-
clearInterval(inter);
|
|
1080
|
-
resolve(false);
|
|
1081
|
-
return;
|
|
1082
|
-
} //평가식 체크
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
if (evaluation()) {
|
|
1086
|
-
clearInterval(inter);
|
|
1087
|
-
resolve(true);
|
|
1088
|
-
}
|
|
1089
|
-
}, 100);
|
|
1090
|
-
})];
|
|
1091
|
-
});
|
|
1092
|
-
});
|
|
1093
|
-
}
|
|
1094
|
-
|
|
1095
1401
|
// export type MapEvent = 'bounds_changed'|'center_changed'|'idle'|'zoom_changed'|'zoomstart'
|
|
1096
1402
|
// export type MapUIEvent = 'click'|'dblclick'|''
|
|
1097
1403
|
var MapEvent =
|
|
@@ -1352,8 +1658,7 @@ function (_super) {
|
|
|
1352
1658
|
map: this.map,
|
|
1353
1659
|
position: marker.options.position,
|
|
1354
1660
|
visible: marker.options.visible === undefined || marker.options.visible
|
|
1355
|
-
};
|
|
1356
|
-
|
|
1661
|
+
};
|
|
1357
1662
|
marker.element && (options.icon = {
|
|
1358
1663
|
content: marker.element,
|
|
1359
1664
|
anchor: marker.options.anchor
|
|
@@ -1371,6 +1676,8 @@ function (_super) {
|
|
|
1371
1676
|
marker.native = naverMarker_1;
|
|
1372
1677
|
}
|
|
1373
1678
|
|
|
1679
|
+
log(this.mapProps.debug || marker.options.debug, marker.options.debugLabel, this.type + ' marker created');
|
|
1680
|
+
Status.setMarker(1, marker.options.debugLabel);
|
|
1374
1681
|
((_a = marker.options) === null || _a === void 0 ? void 0 : _a.event) && marker.options.event.forEach(function (handler, key) {
|
|
1375
1682
|
if (_this.markerEvents.includes(key)) {
|
|
1376
1683
|
naver.maps.Event.addListener(naverMarker_1, key, handler);
|
|
@@ -1385,11 +1692,11 @@ function (_super) {
|
|
|
1385
1692
|
var map = marker.native.getMap();
|
|
1386
1693
|
|
|
1387
1694
|
if (map) {
|
|
1388
|
-
/** 중요!!!!
|
|
1389
|
-
* naver 마커의 setOption(MarkerOptions) 은 내부적으로 setMap 을 무조건 강제 처리한다!!!
|
|
1390
|
-
* setMap 을 처리하면 맵의 이벤트리스너 등등이 모두 초기화 되고 다시 맵을 add 하면서 마커관련된 모든 초기화가 다시 일어난다.
|
|
1391
|
-
* (심지어 map 이 기존과 같은 객체인데도 초기화 처리함)
|
|
1392
|
-
* 그래서 민트맵에서는 update 를 지원하는 항목별로 명시적으로 각각 처리한다.
|
|
1695
|
+
/** 중요!!!!
|
|
1696
|
+
* naver 마커의 setOption(MarkerOptions) 은 내부적으로 setMap 을 무조건 강제 처리한다!!!
|
|
1697
|
+
* setMap 을 처리하면 맵의 이벤트리스너 등등이 모두 초기화 되고 다시 맵을 add 하면서 마커관련된 모든 초기화가 다시 일어난다.
|
|
1698
|
+
* (심지어 map 이 기존과 같은 객체인데도 초기화 처리함)
|
|
1699
|
+
* 그래서 민트맵에서는 update 를 지원하는 항목별로 명시적으로 각각 처리한다.
|
|
1393
1700
|
*/
|
|
1394
1701
|
//Position
|
|
1395
1702
|
if (options.position && options.position instanceof Position) {
|
|
@@ -1404,7 +1711,9 @@ function (_super) {
|
|
|
1404
1711
|
marker.native.setIcon(__assign(__assign({}, marker.native.getIcon()), {
|
|
1405
1712
|
anchor: options.anchor
|
|
1406
1713
|
}));
|
|
1407
|
-
}
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
log(this.mapProps.debug || options.debug, marker.options.debugLabel, this.type + ' marker updated'); // const newOption = {
|
|
1408
1717
|
// map:map,
|
|
1409
1718
|
// position:options.position instanceof Position?options.position:marker.native.getPosition(),
|
|
1410
1719
|
// visible:options.visible === undefined || options.visible,
|
|
@@ -1418,7 +1727,6 @@ function (_super) {
|
|
|
1418
1727
|
// visible:options.visible === undefined || options.visible,
|
|
1419
1728
|
// icon:{...marker.native.getIcon(), anchor:options.anchor}
|
|
1420
1729
|
// })
|
|
1421
|
-
|
|
1422
1730
|
}
|
|
1423
1731
|
}
|
|
1424
1732
|
};
|
|
@@ -1476,6 +1784,9 @@ function (_super) {
|
|
|
1476
1784
|
} else {
|
|
1477
1785
|
drawable.native.setMap(null);
|
|
1478
1786
|
}
|
|
1787
|
+
|
|
1788
|
+
log(this.mapProps.debug || drawable.options.debug, drawable.options.debugLabel, this.type + ' marker cleared');
|
|
1789
|
+
Status.setMarker(-1, drawable.options.debugLabel);
|
|
1479
1790
|
} else {
|
|
1480
1791
|
drawable.native.setMap(null);
|
|
1481
1792
|
}
|
|
@@ -2081,6 +2392,8 @@ function (_super) {
|
|
|
2081
2392
|
googleMarker_1 = new google.maps.Marker(options);
|
|
2082
2393
|
}
|
|
2083
2394
|
|
|
2395
|
+
log(this.mapProps.debug || marker.options.debug, marker.options.debugLabel, this.type + ' marker created');
|
|
2396
|
+
Status.setMarker(1, marker.options.debugLabel);
|
|
2084
2397
|
marker.native = googleMarker_1;
|
|
2085
2398
|
((_a = marker.options) === null || _a === void 0 ? void 0 : _a.event) && marker.options.event.forEach(function (handler, key) {
|
|
2086
2399
|
if (_this.markerEvents.includes(key)) {
|
|
@@ -2119,6 +2432,8 @@ function (_super) {
|
|
|
2119
2432
|
marker.native.position = options.position;
|
|
2120
2433
|
}
|
|
2121
2434
|
}
|
|
2435
|
+
|
|
2436
|
+
log(this.mapProps.debug || options.debug, marker.options.debugLabel, this.type + ' marker updated');
|
|
2122
2437
|
}
|
|
2123
2438
|
};
|
|
2124
2439
|
|
|
@@ -2185,6 +2500,8 @@ function (_super) {
|
|
|
2185
2500
|
} else if (drawable.native instanceof google.maps.marker.AdvancedMarkerView) {
|
|
2186
2501
|
google.maps.event.clearInstanceListeners(drawable.native);
|
|
2187
2502
|
drawable.native.map = null;
|
|
2503
|
+
log(this.mapProps.debug || drawable.options.debug, drawable.options.debugLabel, this.type + ' marker cleared');
|
|
2504
|
+
Status.setMarker(-1, drawable.options.debugLabel);
|
|
2188
2505
|
return true;
|
|
2189
2506
|
}
|
|
2190
2507
|
}
|
|
@@ -2767,6 +3084,8 @@ function (_super) {
|
|
|
2767
3084
|
this.updateMarker(marker, marker.options);
|
|
2768
3085
|
} else {
|
|
2769
3086
|
kakaoMarker_1 = new kakao.maps.CustomOverlay(options);
|
|
3087
|
+
log(this.mapProps.debug || marker.options.debug, marker.options.debugLabel, this.type + ' marker created');
|
|
3088
|
+
Status.setMarker(1, marker.options.debugLabel);
|
|
2770
3089
|
marker.options.visible !== undefined && kakaoMarker_1.setVisible(marker.options.visible);
|
|
2771
3090
|
this.removeParentElementsMargin(marker);
|
|
2772
3091
|
marker.native = kakaoMarker_1;
|
|
@@ -2795,6 +3114,7 @@ function (_super) {
|
|
|
2795
3114
|
marker.native.setVisible(options.visible);
|
|
2796
3115
|
}
|
|
2797
3116
|
|
|
3117
|
+
log(this.mapProps.debug || options.debug, marker.options.debugLabel, this.type + ' marker updated');
|
|
2798
3118
|
this.removeParentElementsMargin(marker);
|
|
2799
3119
|
}
|
|
2800
3120
|
}
|
|
@@ -2867,6 +3187,8 @@ function (_super) {
|
|
|
2867
3187
|
(_a = this.markerPool) === null || _a === void 0 ? void 0 : _a.releasePoolItem(drawable.native);
|
|
2868
3188
|
} else {
|
|
2869
3189
|
drawable.native.setMap(null);
|
|
3190
|
+
log(this.mapProps.debug || drawable.options.debug, drawable.options.debugLabel, this.type + ' marker cleared');
|
|
3191
|
+
Status.setMarker(-1, drawable.options.debugLabel);
|
|
2870
3192
|
}
|
|
2871
3193
|
} else {
|
|
2872
3194
|
drawable.native.setMap(null);
|
|
@@ -3071,13 +3393,13 @@ function (_super) {
|
|
|
3071
3393
|
};
|
|
3072
3394
|
|
|
3073
3395
|
KakaoMintMapController.prototype.getSafeZoomValue = function (value) {
|
|
3074
|
-
/**
|
|
3075
|
-
* 카카오는 구글/네이버와 다르게 줌레벨이 작아질수록 확대된다 (가장 확대된 것이 0)
|
|
3076
|
-
* - 가장 확대된 값 : 1
|
|
3077
|
-
* - 가장 축소된 값 : 14
|
|
3078
|
-
*
|
|
3079
|
-
* 그래서 세계지도가 없는 카카오는 동일한 사정인 네이버와 매핑하기로 한다.
|
|
3080
|
-
* 문제는 둘 간의 줌 레벨별 축척이 일치하지 않는다. 그래서 가장 유사한 레벨 끼리 매핑이 필요하다
|
|
3396
|
+
/**
|
|
3397
|
+
* 카카오는 구글/네이버와 다르게 줌레벨이 작아질수록 확대된다 (가장 확대된 것이 0)
|
|
3398
|
+
* - 가장 확대된 값 : 1
|
|
3399
|
+
* - 가장 축소된 값 : 14
|
|
3400
|
+
*
|
|
3401
|
+
* 그래서 세계지도가 없는 카카오는 동일한 사정인 네이버와 매핑하기로 한다.
|
|
3402
|
+
* 문제는 둘 간의 줌 레벨별 축척이 일치하지 않는다. 그래서 가장 유사한 레벨 끼리 매핑이 필요하다
|
|
3081
3403
|
*/
|
|
3082
3404
|
var mapValue = this.getBaseToMapZoom(value);
|
|
3083
3405
|
|
|
@@ -3262,12 +3584,12 @@ var DEFAULT_CENTER = {
|
|
|
3262
3584
|
lat: 37.5036845,
|
|
3263
3585
|
lng: 127.0448698
|
|
3264
3586
|
};
|
|
3265
|
-
/**
|
|
3266
|
-
* Mint Map 컴포넌트
|
|
3267
|
-
*
|
|
3268
|
-
* @param {MintMapProps} MintMapProps
|
|
3269
|
-
*
|
|
3270
|
-
* @returns {JSX.Element} JSX
|
|
3587
|
+
/**
|
|
3588
|
+
* Mint Map 컴포넌트
|
|
3589
|
+
*
|
|
3590
|
+
* @param {MintMapProps} MintMapProps
|
|
3591
|
+
*
|
|
3592
|
+
* @returns {JSX.Element} JSX
|
|
3271
3593
|
*/
|
|
3272
3594
|
|
|
3273
3595
|
function MintMap(_a) {
|
|
@@ -3604,80 +3926,6 @@ function SVGRect(_a) {
|
|
|
3604
3926
|
}, children));
|
|
3605
3927
|
}
|
|
3606
3928
|
|
|
3607
|
-
var AnimationPlayer =
|
|
3608
|
-
/** @class */
|
|
3609
|
-
function () {
|
|
3610
|
-
function AnimationPlayer(drawFunction, fps) {
|
|
3611
|
-
this.prevtime = 0;
|
|
3612
|
-
this.elapsedTime = 0;
|
|
3613
|
-
this.fps = null;
|
|
3614
|
-
this.baseDrawGapTime = null;
|
|
3615
|
-
this.deltaTime = 0;
|
|
3616
|
-
this.playing = false;
|
|
3617
|
-
this.draw = drawFunction;
|
|
3618
|
-
this.fps = fps || null;
|
|
3619
|
-
|
|
3620
|
-
if (fps !== undefined) {
|
|
3621
|
-
this.baseDrawGapTime = 1000 / fps;
|
|
3622
|
-
}
|
|
3623
|
-
|
|
3624
|
-
this.init();
|
|
3625
|
-
}
|
|
3626
|
-
|
|
3627
|
-
AnimationPlayer.prototype.init = function () {
|
|
3628
|
-
this.deltaTime = 0;
|
|
3629
|
-
this.prevtime = 0;
|
|
3630
|
-
this.elapsedTime = 0;
|
|
3631
|
-
this.playing = false;
|
|
3632
|
-
};
|
|
3633
|
-
|
|
3634
|
-
AnimationPlayer.prototype.start = function () {
|
|
3635
|
-
this.init();
|
|
3636
|
-
this.resume();
|
|
3637
|
-
};
|
|
3638
|
-
|
|
3639
|
-
AnimationPlayer.prototype.stop = function () {
|
|
3640
|
-
this.playing = false;
|
|
3641
|
-
};
|
|
3642
|
-
|
|
3643
|
-
AnimationPlayer.prototype.resume = function () {
|
|
3644
|
-
this.playing = true; //@ts-ignore
|
|
3645
|
-
|
|
3646
|
-
window.requestAnimationFrame(this.makeFrame.bind(this));
|
|
3647
|
-
};
|
|
3648
|
-
|
|
3649
|
-
AnimationPlayer.prototype.makeFrame = function (timestamp) {
|
|
3650
|
-
//frame 간 시간 변화
|
|
3651
|
-
if (this.prevtime === 0) {
|
|
3652
|
-
this.prevtime = timestamp;
|
|
3653
|
-
}
|
|
3654
|
-
|
|
3655
|
-
this.deltaTime += timestamp - this.prevtime; //정해진 시간이 없거나, 정해진 시간이 지났으면 draw 호출
|
|
3656
|
-
|
|
3657
|
-
this.prevtime = timestamp;
|
|
3658
|
-
|
|
3659
|
-
if (!this.baseDrawGapTime || this.baseDrawGapTime <= this.deltaTime) {
|
|
3660
|
-
//다음 루프 준비
|
|
3661
|
-
this.elapsedTime += this.deltaTime; //draw 콜백에서 stop 신호오면 멈춤
|
|
3662
|
-
|
|
3663
|
-
var stopFlag = this.draw(this.deltaTime, this.elapsedTime); //delta 초기화
|
|
3664
|
-
|
|
3665
|
-
this.deltaTime = 0;
|
|
3666
|
-
|
|
3667
|
-
if (stopFlag) {
|
|
3668
|
-
this.stop();
|
|
3669
|
-
}
|
|
3670
|
-
}
|
|
3671
|
-
|
|
3672
|
-
if (this.playing) {
|
|
3673
|
-
//@ts-ignore
|
|
3674
|
-
window.requestAnimationFrame(this.makeFrame.bind(this));
|
|
3675
|
-
}
|
|
3676
|
-
};
|
|
3677
|
-
|
|
3678
|
-
return AnimationPlayer;
|
|
3679
|
-
}();
|
|
3680
|
-
|
|
3681
3929
|
var Drawable =
|
|
3682
3930
|
/** @class */
|
|
3683
3931
|
function () {
|
|
@@ -3690,8 +3938,8 @@ var Marker =
|
|
|
3690
3938
|
/** @class */
|
|
3691
3939
|
function (_super) {
|
|
3692
3940
|
__extends(Marker, _super);
|
|
3693
|
-
/**
|
|
3694
|
-
* 지도에 표시할 마커정보
|
|
3941
|
+
/**
|
|
3942
|
+
* 지도에 표시할 마커정보
|
|
3695
3943
|
*/
|
|
3696
3944
|
|
|
3697
3945
|
|
|
@@ -3709,8 +3957,8 @@ var Polyline =
|
|
|
3709
3957
|
/** @class */
|
|
3710
3958
|
function (_super) {
|
|
3711
3959
|
__extends(Polyline, _super);
|
|
3712
|
-
/**
|
|
3713
|
-
* 지도에 표시할 폴리곤정보
|
|
3960
|
+
/**
|
|
3961
|
+
* 지도에 표시할 폴리곤정보
|
|
3714
3962
|
*/
|
|
3715
3963
|
|
|
3716
3964
|
|
|
@@ -3728,8 +3976,8 @@ var Polygon =
|
|
|
3728
3976
|
/** @class */
|
|
3729
3977
|
function (_super) {
|
|
3730
3978
|
__extends(Polygon, _super);
|
|
3731
|
-
/**
|
|
3732
|
-
* 지도에 표시할 폴리곤정보
|
|
3979
|
+
/**
|
|
3980
|
+
* 지도에 표시할 폴리곤정보
|
|
3733
3981
|
*/
|
|
3734
3982
|
|
|
3735
3983
|
|
|
@@ -3739,8 +3987,8 @@ function (_super) {
|
|
|
3739
3987
|
_this.options = options;
|
|
3740
3988
|
return _this;
|
|
3741
3989
|
}
|
|
3742
|
-
/**
|
|
3743
|
-
* 폴리곤의 중점을 구한다.
|
|
3990
|
+
/**
|
|
3991
|
+
* 폴리곤의 중점을 구한다.
|
|
3744
3992
|
*/
|
|
3745
3993
|
|
|
3746
3994
|
|
|
@@ -3910,12 +4158,12 @@ var offsetCalibration = function (mapType, divElement, options) {
|
|
|
3910
4158
|
divElement.style.transform = "translate(-".concat(options.anchor ? options.anchor.x : '0', "px, -").concat(options.anchor ? options.anchor.y : '0', "px)");
|
|
3911
4159
|
}
|
|
3912
4160
|
};
|
|
3913
|
-
/**
|
|
3914
|
-
* Mint Map 컴포넌트
|
|
3915
|
-
*
|
|
3916
|
-
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
3917
|
-
*
|
|
3918
|
-
* @returns {JSX.Element} JSX
|
|
4161
|
+
/**
|
|
4162
|
+
* Mint Map 컴포넌트
|
|
4163
|
+
*
|
|
4164
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
4165
|
+
*
|
|
4166
|
+
* @returns {JSX.Element} JSX
|
|
3919
4167
|
*/
|
|
3920
4168
|
|
|
3921
4169
|
|
|
@@ -4068,147 +4316,12 @@ function MapMarkerWrapper(_a) {
|
|
|
4068
4316
|
return createPortal(children, divElement);
|
|
4069
4317
|
}
|
|
4070
4318
|
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
var boundsLineSizeX = Number(((mapBounds.ne.lng - mapBounds.nw.lng) / rowCount).toFixed(7));
|
|
4079
|
-
var boundsLineSizeY = Number(((mapBounds.nw.lat - mapBounds.se.lat) / colCount).toFixed(7)); //console.log('boundsLineSize', boundsLineSizeX, boundsLineSizeY)
|
|
4080
|
-
var boundsPos = [];
|
|
4081
|
-
var tempX1, tempY1, tempX2, tempY2;
|
|
4082
|
-
|
|
4083
|
-
for (var i = 0; i < rowCount; i++) {
|
|
4084
|
-
tempX1 = mapBounds.nw.lng + boundsLineSizeX * i;
|
|
4085
|
-
tempX2 = mapBounds.nw.lng + boundsLineSizeX * (i + 1);
|
|
4086
|
-
var rows = [];
|
|
4087
|
-
boundsPos.push(rows);
|
|
4088
|
-
|
|
4089
|
-
for (var k = 0; k < colCount; k++) {
|
|
4090
|
-
tempY2 = mapBounds.se.lat + boundsLineSizeY * k;
|
|
4091
|
-
tempY1 = mapBounds.se.lat + boundsLineSizeY * (k + 1);
|
|
4092
|
-
var thisBounds = Bounds.fromNWSE(new Position(tempY1, tempX1), new Position(tempY2, tempX2));
|
|
4093
|
-
var includedList = thisBounds.getIncludedPositions(itemList);
|
|
4094
|
-
rows.push({
|
|
4095
|
-
bounds: thisBounds,
|
|
4096
|
-
checked: false,
|
|
4097
|
-
center: false,
|
|
4098
|
-
centerPosition: thisBounds.getCenter(),
|
|
4099
|
-
incList: [],
|
|
4100
|
-
itemList: includedList,
|
|
4101
|
-
size: basePixelSize
|
|
4102
|
-
});
|
|
4103
|
-
}
|
|
4104
|
-
} //좌표마다 검사해서 인접셀 병합 처리
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
var centerList = [];
|
|
4108
|
-
var totalItemCount = 0;
|
|
4109
|
-
var min;
|
|
4110
|
-
var max;
|
|
4111
|
-
|
|
4112
|
-
for (var i = 0; i < boundsPos.length; i++) {
|
|
4113
|
-
for (var k = 0; k < boundsPos[i].length; k++) {
|
|
4114
|
-
var curr = boundsPos[i][k];
|
|
4115
|
-
if (curr.checked) continue;
|
|
4116
|
-
curr.checked = true; //현재기준 8방향 객체 모으기
|
|
4117
|
-
|
|
4118
|
-
var incList = [];
|
|
4119
|
-
|
|
4120
|
-
if (boundsPos[i]) {
|
|
4121
|
-
boundsPos[i][k - 1] && incList.push(boundsPos[i][k - 1]);
|
|
4122
|
-
boundsPos[i][k + 1] && incList.push(boundsPos[i][k + 1]);
|
|
4123
|
-
}
|
|
4124
|
-
|
|
4125
|
-
if (boundsPos[i - 1]) {
|
|
4126
|
-
boundsPos[i - 1][k - 1] && incList.push(boundsPos[i - 1][k - 1]);
|
|
4127
|
-
boundsPos[i - 1][k] && incList.push(boundsPos[i - 1][k]);
|
|
4128
|
-
boundsPos[i - 1][k + 1] && incList.push(boundsPos[i - 1][k + 1]);
|
|
4129
|
-
}
|
|
4130
|
-
|
|
4131
|
-
if (boundsPos[i + 1]) {
|
|
4132
|
-
boundsPos[i + 1][k + 1] && incList.push(boundsPos[i + 1][k + 1]);
|
|
4133
|
-
boundsPos[i + 1][k] && incList.push(boundsPos[i + 1][k]);
|
|
4134
|
-
boundsPos[i + 1][k - 1] && incList.push(boundsPos[i + 1][k - 1]);
|
|
4135
|
-
}
|
|
4136
|
-
|
|
4137
|
-
for (var _i = 0, incList_1 = incList; _i < incList_1.length; _i++) {
|
|
4138
|
-
var inc = incList_1[_i];
|
|
4139
|
-
if (inc.checked) continue;
|
|
4140
|
-
inc.checked = true;
|
|
4141
|
-
|
|
4142
|
-
if (inc.itemList && inc.itemList.length > 0) {
|
|
4143
|
-
curr.incList.push(inc);
|
|
4144
|
-
|
|
4145
|
-
(_a = curr.itemList).push.apply(_a, inc.itemList);
|
|
4146
|
-
|
|
4147
|
-
curr.center = true;
|
|
4148
|
-
}
|
|
4149
|
-
}
|
|
4150
|
-
|
|
4151
|
-
if (curr.center) {
|
|
4152
|
-
centerList.push(curr);
|
|
4153
|
-
var avrLat = calculateAverage(curr.itemList.map(function (item) {
|
|
4154
|
-
return item.lat;
|
|
4155
|
-
}));
|
|
4156
|
-
var avrLng = calculateAverage(curr.itemList.map(function (item) {
|
|
4157
|
-
return item.lng;
|
|
4158
|
-
}));
|
|
4159
|
-
curr.centerPosition = new Position(avrLat, avrLng);
|
|
4160
|
-
totalItemCount += curr.itemList.length;
|
|
4161
|
-
|
|
4162
|
-
if (!min || curr.itemList.length < min) {
|
|
4163
|
-
min = curr.itemList.length;
|
|
4164
|
-
}
|
|
4165
|
-
|
|
4166
|
-
if (!max || curr.itemList.length > max) {
|
|
4167
|
-
max = curr.itemList.length;
|
|
4168
|
-
}
|
|
4169
|
-
}
|
|
4170
|
-
}
|
|
4171
|
-
}
|
|
4172
|
-
|
|
4173
|
-
var status = {
|
|
4174
|
-
total: totalItemCount,
|
|
4175
|
-
average: totalItemCount / centerList.length,
|
|
4176
|
-
min: min,
|
|
4177
|
-
max: max
|
|
4178
|
-
};
|
|
4179
|
-
|
|
4180
|
-
sizeFunction = sizeFunction || function (info, status) {
|
|
4181
|
-
var minSize = basePixelSize / 4;
|
|
4182
|
-
var maxSize = basePixelSize;
|
|
4183
|
-
return Math.min(Math.max(basePixelSize * info.itemList.length / status.average, minSize), maxSize);
|
|
4184
|
-
};
|
|
4185
|
-
|
|
4186
|
-
for (var _b = 0, centerList_1 = centerList; _b < centerList_1.length; _b++) {
|
|
4187
|
-
var center = centerList_1[_b];
|
|
4188
|
-
center.size = sizeFunction(center, status);
|
|
4189
|
-
} // console.log('centerList', centerList, status);
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
return centerList;
|
|
4193
|
-
};
|
|
4194
|
-
|
|
4195
|
-
var calculateAverage = function (nums) {
|
|
4196
|
-
var sum = 0;
|
|
4197
|
-
|
|
4198
|
-
for (var _i = 0, nums_1 = nums; _i < nums_1.length; _i++) {
|
|
4199
|
-
var num = nums_1[_i];
|
|
4200
|
-
sum += num;
|
|
4201
|
-
}
|
|
4202
|
-
|
|
4203
|
-
return Number((sum / nums.length).toFixed(7));
|
|
4204
|
-
};
|
|
4205
|
-
|
|
4206
|
-
/**
|
|
4207
|
-
* CircleMarker
|
|
4208
|
-
*
|
|
4209
|
-
* @param {CircleMarkerProps} CircleMarkerProps
|
|
4210
|
-
*
|
|
4211
|
-
* @returns {JSX.Element} JSX
|
|
4319
|
+
/**
|
|
4320
|
+
* CircleMarker
|
|
4321
|
+
*
|
|
4322
|
+
* @param {CircleMarkerProps} CircleMarkerProps
|
|
4323
|
+
*
|
|
4324
|
+
* @returns {JSX.Element} JSX
|
|
4212
4325
|
*/
|
|
4213
4326
|
|
|
4214
4327
|
function CircleMarker(_a) {
|
|
@@ -4320,12 +4433,12 @@ function CircleMarker(_a) {
|
|
|
4320
4433
|
}, children)));
|
|
4321
4434
|
}
|
|
4322
4435
|
|
|
4323
|
-
/**
|
|
4324
|
-
*PolygonMarker
|
|
4325
|
-
*
|
|
4326
|
-
* @param {PolygonMarkerProps} PolygonMarkerProps
|
|
4327
|
-
*
|
|
4328
|
-
* @returns {JSX.Element} JSX
|
|
4436
|
+
/**
|
|
4437
|
+
*PolygonMarker
|
|
4438
|
+
*
|
|
4439
|
+
* @param {PolygonMarkerProps} PolygonMarkerProps
|
|
4440
|
+
*
|
|
4441
|
+
* @returns {JSX.Element} JSX
|
|
4329
4442
|
*/
|
|
4330
4443
|
|
|
4331
4444
|
function PolygonMarker(_a) {
|
|
@@ -4476,12 +4589,12 @@ function PolygonMarker(_a) {
|
|
|
4476
4589
|
}, children)));
|
|
4477
4590
|
}
|
|
4478
4591
|
|
|
4479
|
-
/**
|
|
4480
|
-
* Mint Map 컴포넌트
|
|
4481
|
-
*
|
|
4482
|
-
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
4483
|
-
*
|
|
4484
|
-
* @returns {JSX.Element} JSX
|
|
4592
|
+
/**
|
|
4593
|
+
* Mint Map 컴포넌트
|
|
4594
|
+
*
|
|
4595
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
4596
|
+
*
|
|
4597
|
+
* @returns {JSX.Element} JSX
|
|
4485
4598
|
*/
|
|
4486
4599
|
|
|
4487
4600
|
function MapPolygonWrapper(_a) {
|
|
@@ -4969,12 +5082,12 @@ var getAlignPosition = function (value, align) {
|
|
|
4969
5082
|
|
|
4970
5083
|
throw new Error("Size [".concat(value, "] is not valid. (Should be % or pixel number)"));
|
|
4971
5084
|
};
|
|
4972
|
-
/**
|
|
4973
|
-
* Mint Map 컴포넌트
|
|
4974
|
-
*
|
|
4975
|
-
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
4976
|
-
*
|
|
4977
|
-
* @returns {JSX.Element} JSX
|
|
5085
|
+
/**
|
|
5086
|
+
* Mint Map 컴포넌트
|
|
5087
|
+
*
|
|
5088
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
5089
|
+
*
|
|
5090
|
+
* @returns {JSX.Element} JSX
|
|
4978
5091
|
*/
|
|
4979
5092
|
|
|
4980
5093
|
|
|
@@ -4999,12 +5112,12 @@ function MapControlWrapper(_a) {
|
|
|
4999
5112
|
}, children);
|
|
5000
5113
|
}
|
|
5001
5114
|
|
|
5002
|
-
/**
|
|
5003
|
-
* Mint Map 컴포넌트
|
|
5004
|
-
*
|
|
5005
|
-
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
5006
|
-
*
|
|
5007
|
-
* @returns {JSX.Element} JSX
|
|
5115
|
+
/**
|
|
5116
|
+
* Mint Map 컴포넌트
|
|
5117
|
+
*
|
|
5118
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
5119
|
+
*
|
|
5120
|
+
* @returns {JSX.Element} JSX
|
|
5008
5121
|
*/
|
|
5009
5122
|
|
|
5010
5123
|
function MapPolylineWrapper(_a) {
|
|
@@ -5045,12 +5158,12 @@ var console$1 = {
|
|
|
5045
5158
|
log: function () {
|
|
5046
5159
|
}
|
|
5047
5160
|
};
|
|
5048
|
-
/**
|
|
5049
|
-
* Mint Map 컴포넌트
|
|
5050
|
-
*
|
|
5051
|
-
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
5052
|
-
*
|
|
5053
|
-
* @returns {JSX.Element} JSX
|
|
5161
|
+
/**
|
|
5162
|
+
* Mint Map 컴포넌트
|
|
5163
|
+
*
|
|
5164
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
5165
|
+
*
|
|
5166
|
+
* @returns {JSX.Element} JSX
|
|
5054
5167
|
*/
|
|
5055
5168
|
|
|
5056
5169
|
function MapCanvasWrapper(_a) {
|
|
@@ -5369,12 +5482,12 @@ function MapCanvasWrapper(_a) {
|
|
|
5369
5482
|
}), renderFlag && React.createElement(React.Fragment, null));
|
|
5370
5483
|
}
|
|
5371
5484
|
|
|
5372
|
-
/**
|
|
5373
|
-
* Mint Map 컴포넌트
|
|
5374
|
-
*
|
|
5375
|
-
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
5376
|
-
*
|
|
5377
|
-
* @returns {JSX.Element} JSX
|
|
5485
|
+
/**
|
|
5486
|
+
* Mint Map 컴포넌트
|
|
5487
|
+
*
|
|
5488
|
+
* @param {MapControlWrapperProps} MapControlWrapperProps
|
|
5489
|
+
*
|
|
5490
|
+
* @returns {JSX.Element} JSX
|
|
5378
5491
|
*/
|
|
5379
5492
|
|
|
5380
5493
|
function MapCanvasMarkerWrapper(_props) {
|
|
@@ -5382,4 +5495,4 @@ function MapCanvasMarkerWrapper(_props) {
|
|
|
5382
5495
|
return React.createElement(React.Fragment, null);
|
|
5383
5496
|
}
|
|
5384
5497
|
|
|
5385
|
-
export { AnimationPlayer, Bounds, CircleMarker, Drawable, GeoCalulator, GoogleMintMapController, MapBuildingProjection, MapCanvasMarkerWrapper, MapCanvasWrapper, MapControlWrapper, MapEvent, MapLoadingWithImage, MapMarkerWrapper, MapPolygonWrapper, MapPolylineWrapper, MapUIEvent, Marker, MintMap, MintMapCanvasRenderer, MintMapController, MintMapCore, MintMapProvider, NaverMintMapController, Offset, PointLoading, Polygon, PolygonCalculator, PolygonMarker, Polyline, Position, SVGCircle, SVGPolygon, SVGRect, getClusterInfo, useMarkerMoving, useMintMapController, waiting };
|
|
5498
|
+
export { AnimationPlayer, Bounds, CircleMarker, Drawable, GeoCalulator, GoogleMintMapController, MapBuildingProjection, MapCanvasMarkerWrapper, MapCanvasWrapper, MapControlWrapper, MapEvent, MapLoadingWithImage, MapMarkerWrapper, MapPolygonWrapper, MapPolylineWrapper, MapUIEvent, Marker, MintMap, MintMapCanvasRenderer, MintMapController, MintMapCore, MintMapProvider, NaverMintMapController, Offset, PointLoading, Polygon, PolygonCalculator, PolygonMarker, Polyline, Position, SVGCircle, SVGPolygon, SVGRect, Status, getClusterInfo, log, useMarkerMoving, useMintMapController, waiting };
|