| | |
| | | * @param {*} layerName 图层名称 |
| | | * @param {*} type 图层类型 |
| | | */ |
| | | mapAddLayer (layerName, type) { |
| | | mapAddLayer (layerName, type, ClusterLayerType) { |
| | | if (type == 'VectorLayer') { |
| | | if (!layersObjcect[layerName]) layersObjcect[layerName] = null |
| | | |
| | |
| | | layersObjcect[layerName].addTo(global.viewer) |
| | | } else if (type == 'ClusterLayer') { |
| | | if (!layersObjcect[layerName]) layersObjcect[layerName] = null |
| | | |
| | | layersObjcect[layerName] = new global.DC.ClusterLayer(layerName, { |
| | | pixelRange: 40 |
| | | pixelRange: 40, style: ClusterLayerType |
| | | }) |
| | | |
| | | layersObjcect[layerName].addTo(global.viewer) |
| | |
| | | far: Number.MAX_VALUE //最远距离 |
| | | }, incident = (e) => { }, mouseOverIncident = (e) => { }, mouseOutIncident = (e) => { }, pointMouseMove = (e) => { }) { |
| | | if (!layersObjcect[layerName] || layersObjcect[layerName] == null) { |
| | | this.mapAddLayer(layerName, layerType) |
| | | this.mapAddLayer(layerName, layerType, params.ClusterLayerType) |
| | | } |
| | | |
| | | let pointElement |
| | |
| | | pointElement = new global.DC.Billboard(new global.DC.Position(Number(params.lng), Number(params.lat), 4), params.url) |
| | | pointElement.setStyle(params.setStyle) |
| | | pointElement.size = [32, 32] |
| | | pointElement.style = "clustering" |
| | | pointElement.attrParams = params |
| | | layersObjcect[layerName].addOverlay(pointElement) |
| | | pointElement.on(global.DC.MouseEventType.CLICK, incident) |