xy-map 1.1.13 → 1.1.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xy-map",
3
- "version": "1.1.13",
3
+ "version": "1.1.14",
4
4
  "description": "雄越地图",
5
5
  "main": "xy-map.umd.min.js",
6
6
  "scripts": {
package/xy-map.common.js CHANGED
@@ -48493,7 +48493,7 @@ const addLayerPoint = (option, layerId) => {
48493
48493
  }, layerId);
48494
48494
  if (opt.cluster.cluster) {
48495
48495
  let style = opt.cluster.style || {};
48496
- clusterLayer(id, style);
48496
+ clusterLayer(opt, style);
48497
48497
  }
48498
48498
  if (opt.click) {
48499
48499
  mapClick(id, opt.click);
@@ -48584,7 +48584,7 @@ const addDiyPoint = (option, layerId) => {
48584
48584
  }, layerId);
48585
48585
  if (opt.cluster.cluster) {
48586
48586
  let style = opt.cluster.style || {};
48587
- clusterLayer(id, style);
48587
+ clusterLayer(opt, style);
48588
48588
  }
48589
48589
  if (opt.click) {
48590
48590
  mapClick(id, opt.click);
@@ -48681,7 +48681,7 @@ const addLayerImagePoint = async (option, layerId) => {
48681
48681
  }
48682
48682
  if (opt.cluster.cluster) {
48683
48683
  let style = opt.cluster.style || {};
48684
- clusterLayer(id, style);
48684
+ clusterLayer(opt, style);
48685
48685
  }
48686
48686
  if (opt.click) {
48687
48687
  mapClick(id, opt.click);
@@ -48726,10 +48726,6 @@ const clusterLayer = (option, style) => {
48726
48726
  map
48727
48727
  } = package_map;
48728
48728
  let id = option.id;
48729
- if (hasLayer(id)) {
48730
- setSource(id, option.data);
48731
- return;
48732
- }
48733
48729
  let layout = style ? style.layout : {};
48734
48730
  let layoutOpt = Object.assign({
48735
48731
  'text-field': '{point_count_abbreviated}',
@@ -48738,8 +48734,10 @@ const clusterLayer = (option, style) => {
48738
48734
  }, layout);
48739
48735
  let paint = style ? style.paint : {};
48740
48736
  let paintOpt = Object.assign({
48741
- 'circle-color': ['step', ['get', 'point_count'], '#51bbd6', 100, '#f1f075', 350, '#f28cb1'],
48742
- 'circle-radius': ['step', ['get', 'point_count'], 20, 100, 30, 750, 40]
48737
+ 'circle-color': ['step', ['get', 'point_count'], 'rgba(110, 204, 57, 0.7)', 20, 'rgba(240, 194, 12, 0.7)', 50, 'rgba(241, 128, 23, 0.7)', 100, 'rgba(241, 23, 23, 0.7)'],
48738
+ 'circle-stroke-color': ['step', ['get', 'point_count'], 'rgba(110, 204, 57, 0.3)', 20, 'rgba(240, 194, 12, 0.3)', 50, 'rgba(241, 128, 23, 0.3)', 100, 'rgba(241, 23, 23, 0.3)'],
48739
+ 'circle-stroke-width': ['step', ['get', 'point_count'], 5, 20, 6, 50, 7, 100, 7],
48740
+ 'circle-radius': ['step', ['get', 'point_count'], 16, 20, 18, 50, 20, 100, 21]
48743
48741
  }, paint);
48744
48742
  map.addLayer({
48745
48743
  id: id + '-clusters',
@@ -48753,9 +48751,12 @@ const clusterLayer = (option, style) => {
48753
48751
  type: 'symbol',
48754
48752
  source: option.id,
48755
48753
  filter: ['has', 'point_count'],
48756
- layout: layoutOpt
48754
+ layout: layoutOpt,
48755
+ paint: {
48756
+ 'text-color': '#ffffff'
48757
+ }
48757
48758
  });
48758
- mapClick(id + 'clusters', e => {
48759
+ mapClick(id + '-clusters', e => {
48759
48760
  package_map.zoom('in', e.position);
48760
48761
  });
48761
48762
  };
package/xy-map.umd.js CHANGED
@@ -48511,7 +48511,7 @@ const addLayerPoint = (option, layerId) => {
48511
48511
  }, layerId);
48512
48512
  if (opt.cluster.cluster) {
48513
48513
  let style = opt.cluster.style || {};
48514
- clusterLayer(id, style);
48514
+ clusterLayer(opt, style);
48515
48515
  }
48516
48516
  if (opt.click) {
48517
48517
  mapClick(id, opt.click);
@@ -48602,7 +48602,7 @@ const addDiyPoint = (option, layerId) => {
48602
48602
  }, layerId);
48603
48603
  if (opt.cluster.cluster) {
48604
48604
  let style = opt.cluster.style || {};
48605
- clusterLayer(id, style);
48605
+ clusterLayer(opt, style);
48606
48606
  }
48607
48607
  if (opt.click) {
48608
48608
  mapClick(id, opt.click);
@@ -48699,7 +48699,7 @@ const addLayerImagePoint = async (option, layerId) => {
48699
48699
  }
48700
48700
  if (opt.cluster.cluster) {
48701
48701
  let style = opt.cluster.style || {};
48702
- clusterLayer(id, style);
48702
+ clusterLayer(opt, style);
48703
48703
  }
48704
48704
  if (opt.click) {
48705
48705
  mapClick(id, opt.click);
@@ -48744,10 +48744,6 @@ const clusterLayer = (option, style) => {
48744
48744
  map
48745
48745
  } = package_map;
48746
48746
  let id = option.id;
48747
- if (hasLayer(id)) {
48748
- setSource(id, option.data);
48749
- return;
48750
- }
48751
48747
  let layout = style ? style.layout : {};
48752
48748
  let layoutOpt = Object.assign({
48753
48749
  'text-field': '{point_count_abbreviated}',
@@ -48756,8 +48752,10 @@ const clusterLayer = (option, style) => {
48756
48752
  }, layout);
48757
48753
  let paint = style ? style.paint : {};
48758
48754
  let paintOpt = Object.assign({
48759
- 'circle-color': ['step', ['get', 'point_count'], '#51bbd6', 100, '#f1f075', 350, '#f28cb1'],
48760
- 'circle-radius': ['step', ['get', 'point_count'], 20, 100, 30, 750, 40]
48755
+ 'circle-color': ['step', ['get', 'point_count'], 'rgba(110, 204, 57, 0.7)', 20, 'rgba(240, 194, 12, 0.7)', 50, 'rgba(241, 128, 23, 0.7)', 100, 'rgba(241, 23, 23, 0.7)'],
48756
+ 'circle-stroke-color': ['step', ['get', 'point_count'], 'rgba(110, 204, 57, 0.3)', 20, 'rgba(240, 194, 12, 0.3)', 50, 'rgba(241, 128, 23, 0.3)', 100, 'rgba(241, 23, 23, 0.3)'],
48757
+ 'circle-stroke-width': ['step', ['get', 'point_count'], 5, 20, 6, 50, 7, 100, 7],
48758
+ 'circle-radius': ['step', ['get', 'point_count'], 16, 20, 18, 50, 20, 100, 21]
48761
48759
  }, paint);
48762
48760
  map.addLayer({
48763
48761
  id: id + '-clusters',
@@ -48771,9 +48769,12 @@ const clusterLayer = (option, style) => {
48771
48769
  type: 'symbol',
48772
48770
  source: option.id,
48773
48771
  filter: ['has', 'point_count'],
48774
- layout: layoutOpt
48772
+ layout: layoutOpt,
48773
+ paint: {
48774
+ 'text-color': '#ffffff'
48775
+ }
48775
48776
  });
48776
- mapClick(id + 'clusters', e => {
48777
+ mapClick(id + '-clusters', e => {
48777
48778
  package_map.zoom('in', e.position);
48778
48779
  });
48779
48780
  };