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 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: 102,
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 { distance, minDistance, openClick, buildStyle, singleStyles, computedRadius } = config;
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
- 5492298e-9,
738
- 2746149e-9,
739
- 0.0013730745,
740
- 68653725e-11,
741
- 343268625e-12,
742
- 1716343125e-13,
743
- 8581715625e-14,
744
- 42908578125e-15,
745
- 214542890625e-16,
746
- 1072714453125e-17,
747
- 5363572265625e-18,
748
- 26817861328125e-19,
749
- 134089306640625e-20
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.125614083886, 31.2855711022836],
759
+ origin: [118.122911693886, 31.2869311022836],
752
760
  extent: [
753
- 118.340502132662,
754
- 29.2073269598186,
755
- 120.724787992425,
756
- 30.5617943760008
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
@@ -77,6 +77,7 @@ type IconConfig = {
77
77
  markerIcon: string;
78
78
  activeScale?: number;
79
79
  isAutoFit?: boolean;
80
+ marksStyles?: Style[];
80
81
  vectorConfig?: VectorConfig;
81
82
  markerSize: [number, number];
82
83
  };
package/dist/index.d.ts CHANGED
@@ -77,6 +77,7 @@ type IconConfig = {
77
77
  markerIcon: string;
78
78
  activeScale?: number;
79
79
  isAutoFit?: boolean;
80
+ marksStyles?: Style[];
80
81
  vectorConfig?: VectorConfig;
81
82
  markerSize: [number, number];
82
83
  };
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 { Icon, Text, Fill, Style, Stroke } from "ol/style";
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: 102,
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 { distance, minDistance, openClick, buildStyle, singleStyles, computedRadius } = config;
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
- 5492298e-9,
671
- 2746149e-9,
672
- 0.0013730745,
673
- 68653725e-11,
674
- 343268625e-12,
675
- 1716343125e-13,
676
- 8581715625e-14,
677
- 42908578125e-15,
678
- 214542890625e-16,
679
- 1072714453125e-17,
680
- 5363572265625e-18,
681
- 26817861328125e-19,
682
- 134089306640625e-20
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.125614083886, 31.2855711022836],
698
+ origin: [118.122911693886, 31.2869311022836],
685
699
  extent: [
686
- 118.340502132662,
687
- 29.2073269598186,
688
- 120.724787992425,
689
- 30.5617943760008
700
+ 116.43263049006,
701
+ 28.6201742126026,
702
+ 123.705594256347,
703
+ 31.9765041681924
690
704
  ]
691
705
  }),
692
706
  projection: "EPSG:4326",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "map-ol-utils",
3
- "version": "0.1.16",
3
+ "version": "0.1.18",
4
4
  "type": "module",
5
5
  "description": "Openlayers utils library",
6
6
  "files": [