xy-map 1.1.43 → 1.1.44

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,10 +1,10 @@
1
1
  {
2
2
  "name": "xy-map",
3
- "version": "1.1.43",
3
+ "version": "1.1.44",
4
4
  "description": "雄越地图",
5
5
  "main": "xy-map.umd.min.js",
6
6
  "scripts": {
7
- "pub": "npm publish"
7
+ "pub": "npm publish --registry=https://registry.npmjs.org/"
8
8
  },
9
9
  "keywords": [],
10
10
  "author": "hanjing",
package/xy-map.common.js CHANGED
@@ -44432,16 +44432,20 @@ class mapSdk {
44432
44432
  * 行政区域边界
44433
44433
  * @param {*} geoJson
44434
44434
  * @param {*} config
44435
+ * @param {*} options 自定义配置
44435
44436
  */
44436
- drawCityBorder(geoJson, config = {}) {
44437
+ drawCityBorder(geoJson, config = {}, options = {}) {
44437
44438
  const style = Object.assign({
44438
44439
  lineWidth: 4,
44439
44440
  lineColor: 'rgb(100,149,237)',
44440
44441
  lineOpacity: 1,
44441
44442
  fillColor: 'rgb(2,26,79)',
44442
- fillOpacity: 0.2
44443
+ fillOpacity: 0.2,
44444
+ lineType: 'solid'
44443
44445
  }, config);
44444
44446
  let mbData = geoJson.features[0].geometry.coordinates[0].flat(1);
44447
+ let paint = options.paint || {};
44448
+ let layout = options.layout || {};
44445
44449
  this.map.addLayer({
44446
44450
  //蒙版边界
44447
44451
  id: 'bj-line',
@@ -44451,14 +44455,15 @@ class mapSdk {
44451
44455
  data: geoJson //区划的面数据
44452
44456
  },
44453
44457
 
44454
- paint: {
44458
+ paint: Object.assign({
44455
44459
  'line-color': style.lineColor || 'rgb(100,149,237)',
44456
44460
  'line-width': style.lineWidth || 3,
44457
- 'line-opacity': style.lineOpacity || 1
44458
- },
44459
- layout: {
44461
+ 'line-opacity': style.lineOpacity || 1,
44462
+ 'line-dasharray': style.lineType == 'dashed' ? [2, 2] : []
44463
+ }, paint),
44464
+ layout: Object.assign({
44460
44465
  visibility: 'visible'
44461
- }
44466
+ }, layout)
44462
44467
  });
44463
44468
  this.map.addLayer({
44464
44469
  //蒙版图层 //通过边界数据反选 达到挖洞效果
@@ -71506,7 +71511,7 @@ const addLayerPolygon = (option, layerId) => {
71506
71511
  layout: layoutOpt,
71507
71512
  paint: paintOpt,
71508
71513
  ...opt.other
71509
- });
71514
+ }, layerId);
71510
71515
 
71511
71516
  // 面描边
71512
71517
  map.addLayer({
@@ -71547,7 +71552,7 @@ const addLayerPolygon = (option, layerId) => {
71547
71552
 
71548
71553
  // 添加文本图层
71549
71554
  if (opt.text && opt.text.show) {
71550
- addLayerText('point', opt);
71555
+ addLayerText('point', opt, layerId);
71551
71556
  }
71552
71557
  };
71553
71558
  ;// CONCATENATED MODULE: ./src/package/layers/circle.js
package/xy-map.umd.js CHANGED
@@ -44450,16 +44450,20 @@ class mapSdk {
44450
44450
  * 行政区域边界
44451
44451
  * @param {*} geoJson
44452
44452
  * @param {*} config
44453
+ * @param {*} options 自定义配置
44453
44454
  */
44454
- drawCityBorder(geoJson, config = {}) {
44455
+ drawCityBorder(geoJson, config = {}, options = {}) {
44455
44456
  const style = Object.assign({
44456
44457
  lineWidth: 4,
44457
44458
  lineColor: 'rgb(100,149,237)',
44458
44459
  lineOpacity: 1,
44459
44460
  fillColor: 'rgb(2,26,79)',
44460
- fillOpacity: 0.2
44461
+ fillOpacity: 0.2,
44462
+ lineType: 'solid'
44461
44463
  }, config);
44462
44464
  let mbData = geoJson.features[0].geometry.coordinates[0].flat(1);
44465
+ let paint = options.paint || {};
44466
+ let layout = options.layout || {};
44463
44467
  this.map.addLayer({
44464
44468
  //蒙版边界
44465
44469
  id: 'bj-line',
@@ -44469,14 +44473,15 @@ class mapSdk {
44469
44473
  data: geoJson //区划的面数据
44470
44474
  },
44471
44475
 
44472
- paint: {
44476
+ paint: Object.assign({
44473
44477
  'line-color': style.lineColor || 'rgb(100,149,237)',
44474
44478
  'line-width': style.lineWidth || 3,
44475
- 'line-opacity': style.lineOpacity || 1
44476
- },
44477
- layout: {
44479
+ 'line-opacity': style.lineOpacity || 1,
44480
+ 'line-dasharray': style.lineType == 'dashed' ? [2, 2] : []
44481
+ }, paint),
44482
+ layout: Object.assign({
44478
44483
  visibility: 'visible'
44479
- }
44484
+ }, layout)
44480
44485
  });
44481
44486
  this.map.addLayer({
44482
44487
  //蒙版图层 //通过边界数据反选 达到挖洞效果
@@ -71524,7 +71529,7 @@ const addLayerPolygon = (option, layerId) => {
71524
71529
  layout: layoutOpt,
71525
71530
  paint: paintOpt,
71526
71531
  ...opt.other
71527
- });
71532
+ }, layerId);
71528
71533
 
71529
71534
  // 面描边
71530
71535
  map.addLayer({
@@ -71565,7 +71570,7 @@ const addLayerPolygon = (option, layerId) => {
71565
71570
 
71566
71571
  // 添加文本图层
71567
71572
  if (opt.text && opt.text.show) {
71568
- addLayerText('point', opt);
71573
+ addLayerText('point', opt, layerId);
71569
71574
  }
71570
71575
  };
71571
71576
  ;// CONCATENATED MODULE: ./src/package/layers/circle.js