map-ol-utils 0.1.16 → 0.1.18
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/dist/index.cjs +29 -21
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +36 -22
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -419,7 +419,7 @@ var buildMassMarksStyles = (getImgUrlFn) => {
|
|
|
419
419
|
});
|
|
420
420
|
const activeImage = getMarkerUrl(`${markerIcon}-${i}-active`, ".webp");
|
|
421
421
|
massMarksStyles[i + statusNum] = new import_style.Style({
|
|
422
|
-
zIndex:
|
|
422
|
+
zIndex: 120,
|
|
423
423
|
image: new import_style.Icon({
|
|
424
424
|
width: x * activeScale,
|
|
425
425
|
height: y * activeScale,
|
|
@@ -552,11 +552,12 @@ var addMassMarksLayer = (getImgUrlFn) => {
|
|
|
552
552
|
isAutoFit,
|
|
553
553
|
statusNum,
|
|
554
554
|
markerIcon,
|
|
555
|
+
marksStyles,
|
|
555
556
|
markerSize,
|
|
556
557
|
activeScale,
|
|
557
558
|
vectorConfig
|
|
558
559
|
} = iconConfig;
|
|
559
|
-
const massMarksStyles = buildMassMarksStyles(getImgUrlFn)({
|
|
560
|
+
const massMarksStyles = marksStyles ? marksStyles : buildMassMarksStyles(getImgUrlFn)({
|
|
560
561
|
baseUrl,
|
|
561
562
|
markerIcon,
|
|
562
563
|
markerSize,
|
|
@@ -650,7 +651,14 @@ var createOverlay = (config = { id: "popup-container", positioning: "top-center"
|
|
|
650
651
|
var createClusterLayer = (dataList, config) => {
|
|
651
652
|
const count = dataList.length;
|
|
652
653
|
const styleCache = {};
|
|
653
|
-
const {
|
|
654
|
+
const {
|
|
655
|
+
distance,
|
|
656
|
+
minDistance,
|
|
657
|
+
openClick,
|
|
658
|
+
buildStyle,
|
|
659
|
+
singleStyles,
|
|
660
|
+
computedRadius
|
|
661
|
+
} = config;
|
|
654
662
|
const innerComputedRadius = (size) => Math.pow(size / count, 1 / 18);
|
|
655
663
|
styleCache[1] = singleStyles;
|
|
656
664
|
const innerBuildStyle = (feature) => {
|
|
@@ -734,26 +742,26 @@ var createBaseLayer = (isDark = true) => {
|
|
|
734
742
|
tileGrid: new import_tilegrid.TileGrid({
|
|
735
743
|
tileSize: 256,
|
|
736
744
|
resolutions: [
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
0.
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
745
|
+
0.00549933137253187,
|
|
746
|
+
0.00274966568626595,
|
|
747
|
+
0.00137483284313297,
|
|
748
|
+
687416421566485e-18,
|
|
749
|
+
343708210783242e-18,
|
|
750
|
+
171854105391621e-18,
|
|
751
|
+
859270526958104e-19,
|
|
752
|
+
429635263479052e-19,
|
|
753
|
+
214817631739526e-19,
|
|
754
|
+
107408815869763e-19,
|
|
755
|
+
537044079348816e-20,
|
|
756
|
+
268522039674407e-20,
|
|
757
|
+
134261019837204e-20
|
|
750
758
|
],
|
|
751
|
-
origin: [118.
|
|
759
|
+
origin: [118.122911693886, 31.2869311022836],
|
|
752
760
|
extent: [
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
761
|
+
116.43263049006,
|
|
762
|
+
28.6201742126026,
|
|
763
|
+
123.705594256347,
|
|
764
|
+
31.9765041681924
|
|
757
765
|
]
|
|
758
766
|
}),
|
|
759
767
|
projection: "EPSG:4326",
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -70,7 +70,13 @@ import VectorSource from "ol/source/Vector";
|
|
|
70
70
|
import { Point } from "ol/geom";
|
|
71
71
|
import { singleClick } from "ol/events/condition";
|
|
72
72
|
import { boundingExtent, getCenter } from "ol/extent";
|
|
73
|
-
import {
|
|
73
|
+
import {
|
|
74
|
+
Icon,
|
|
75
|
+
Text,
|
|
76
|
+
Fill,
|
|
77
|
+
Style,
|
|
78
|
+
Stroke
|
|
79
|
+
} from "ol/style";
|
|
74
80
|
var removeOverlays = (key = "") => {
|
|
75
81
|
if (instance) {
|
|
76
82
|
const overlays = instance.getOverlays().getArray().filter((overlay) => overlay.get(key || "position"));
|
|
@@ -352,7 +358,7 @@ var buildMassMarksStyles = (getImgUrlFn) => {
|
|
|
352
358
|
});
|
|
353
359
|
const activeImage = getMarkerUrl(`${markerIcon}-${i}-active`, ".webp");
|
|
354
360
|
massMarksStyles[i + statusNum] = new Style({
|
|
355
|
-
zIndex:
|
|
361
|
+
zIndex: 120,
|
|
356
362
|
image: new Icon({
|
|
357
363
|
width: x * activeScale,
|
|
358
364
|
height: y * activeScale,
|
|
@@ -485,11 +491,12 @@ var addMassMarksLayer = (getImgUrlFn) => {
|
|
|
485
491
|
isAutoFit,
|
|
486
492
|
statusNum,
|
|
487
493
|
markerIcon,
|
|
494
|
+
marksStyles,
|
|
488
495
|
markerSize,
|
|
489
496
|
activeScale,
|
|
490
497
|
vectorConfig
|
|
491
498
|
} = iconConfig;
|
|
492
|
-
const massMarksStyles = buildMassMarksStyles(getImgUrlFn)({
|
|
499
|
+
const massMarksStyles = marksStyles ? marksStyles : buildMassMarksStyles(getImgUrlFn)({
|
|
493
500
|
baseUrl,
|
|
494
501
|
markerIcon,
|
|
495
502
|
markerSize,
|
|
@@ -583,7 +590,14 @@ var createOverlay = (config = { id: "popup-container", positioning: "top-center"
|
|
|
583
590
|
var createClusterLayer = (dataList, config) => {
|
|
584
591
|
const count = dataList.length;
|
|
585
592
|
const styleCache = {};
|
|
586
|
-
const {
|
|
593
|
+
const {
|
|
594
|
+
distance,
|
|
595
|
+
minDistance,
|
|
596
|
+
openClick,
|
|
597
|
+
buildStyle,
|
|
598
|
+
singleStyles,
|
|
599
|
+
computedRadius
|
|
600
|
+
} = config;
|
|
587
601
|
const innerComputedRadius = (size) => Math.pow(size / count, 1 / 18);
|
|
588
602
|
styleCache[1] = singleStyles;
|
|
589
603
|
const innerBuildStyle = (feature) => {
|
|
@@ -667,26 +681,26 @@ var createBaseLayer = (isDark = true) => {
|
|
|
667
681
|
tileGrid: new TileGrid({
|
|
668
682
|
tileSize: 256,
|
|
669
683
|
resolutions: [
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
0.
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
684
|
+
0.00549933137253187,
|
|
685
|
+
0.00274966568626595,
|
|
686
|
+
0.00137483284313297,
|
|
687
|
+
687416421566485e-18,
|
|
688
|
+
343708210783242e-18,
|
|
689
|
+
171854105391621e-18,
|
|
690
|
+
859270526958104e-19,
|
|
691
|
+
429635263479052e-19,
|
|
692
|
+
214817631739526e-19,
|
|
693
|
+
107408815869763e-19,
|
|
694
|
+
537044079348816e-20,
|
|
695
|
+
268522039674407e-20,
|
|
696
|
+
134261019837204e-20
|
|
683
697
|
],
|
|
684
|
-
origin: [118.
|
|
698
|
+
origin: [118.122911693886, 31.2869311022836],
|
|
685
699
|
extent: [
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
700
|
+
116.43263049006,
|
|
701
|
+
28.6201742126026,
|
|
702
|
+
123.705594256347,
|
|
703
|
+
31.9765041681924
|
|
690
704
|
]
|
|
691
705
|
}),
|
|
692
706
|
projection: "EPSG:4326",
|