hn-map 1.1.3 → 1.1.4

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.js CHANGED
@@ -850,7 +850,11 @@
850
850
  switch (eventType) {
851
851
  case "click":
852
852
  this.event[eventType] = function (event) {
853
- callback(event);
853
+ callback({
854
+ lng: event.lngLat.lng,
855
+ lat: event.lngLat.lat,
856
+ alt: event.lngLat.alt || 0
857
+ });
854
858
  };
855
859
  break;
856
860
  case "dblclick":
@@ -1396,6 +1400,14 @@
1396
1400
  entity.show = false;
1397
1401
  }
1398
1402
  }
1403
+ // 控制图层层高
1404
+ }, {
1405
+ key: "moveEntity",
1406
+ value: function moveEntity(layerIds) {
1407
+ // 数组转字符串
1408
+ var s = layerIds.join(",");
1409
+ hnMap.map.map.moveLayer(s);
1410
+ }
1399
1411
  }, {
1400
1412
  key: "clearEntity",
1401
1413
  value: function clearEntity() {
@@ -1688,8 +1700,8 @@
1688
1700
  var handleClick = function handleClick(e) {
1689
1701
  var data = _this2.option.data;
1690
1702
  // const data = e.features[0].properties;
1691
- var dom = getCustomDom(data);
1692
- _this2.infoWindow.setHTML(dom);
1703
+ getCustomDom(data);
1704
+ _this2.infoWindow.setHTML("<image-preview>");
1693
1705
  _this2.infoWindow.setLngLat(e.lngLat).addTo(_this2.hnMap.map.map);
1694
1706
  };
1695
1707
  this.hnMap.map.map.on("click", this.config.id, handleClick);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hn-map",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "hn-map集成mars3d、高德、思极",
5
5
  "main": "dist/index.js",
6
6
  "author": "庞大仙",
@@ -53,7 +53,7 @@ export default class siji_entity {
53
53
  const data = this.option.data;
54
54
  // const data = e.features[0].properties;
55
55
  const dom = getCustomDom(data);
56
- this.infoWindow.setHTML(dom);
56
+ this.infoWindow.setHTML("<image-preview>");
57
57
  this.infoWindow.setLngLat(e.lngLat).addTo(this.hnMap.map.map);
58
58
  };
59
59
 
@@ -1,4 +1,4 @@
1
- import {deepMerge, getLevelMiddleHeight, wgs84ToGcj02Format} from "../util";
1
+ import { deepMerge, getLevelMiddleHeight, wgs84ToGcj02Format } from "../util";
2
2
  import mars3d_entity from "../base/mars3d_entity";
3
3
  import gaode_entity from "../base/gaode_entity";
4
4
  import siji_entity from "../base/siji_entity";
@@ -42,8 +42,12 @@ export default (hnMap: any) => {
42
42
  }
43
43
 
44
44
  formatConfig(option: any) {
45
- const distanceDisplayCondition_far = getLevelMiddleHeight(option.distanceDisplayCondition_far)
46
- const distanceDisplayCondition_near = getLevelMiddleHeight(option.distanceDisplayCondition_near)
45
+ const distanceDisplayCondition_far = getLevelMiddleHeight(
46
+ option.distanceDisplayCondition_far
47
+ );
48
+ const distanceDisplayCondition_near = getLevelMiddleHeight(
49
+ option.distanceDisplayCondition_near
50
+ );
47
51
  let config: any = {
48
52
  id: option.id,
49
53
  position: new mars3d.LngLatPoint(
@@ -401,7 +401,12 @@ export default (hnMap: any) => {
401
401
  entity.show = false;
402
402
  }
403
403
  }
404
-
404
+ // 控制图层层高
405
+ moveEntity(layerIds: Array<string>) {
406
+ // 数组转字符串
407
+ let s = layerIds.join(",");
408
+ hnMap.map.map.moveLayer(s);
409
+ }
405
410
  clearEntity() {
406
411
  this.children.forEach((v: any) => {
407
412
  this.removeEntity(v.id);
package/src/map.ts CHANGED
@@ -359,7 +359,11 @@ export default (hnMap: any) => {
359
359
  switch (eventType) {
360
360
  case "click":
361
361
  this.event[eventType] = (event: any) => {
362
- callback(event);
362
+ callback({
363
+ lng: event.lngLat.lng,
364
+ lat: event.lngLat.lat,
365
+ alt: event.lngLat.alt||0,
366
+ });
363
367
  };
364
368
  break;
365
369
  case "dblclick":