Skip to content
On this page

点位

显示

javascript
(data,comp)=>{
  //tableId 对应自定义POI图标的ID
  const pois=[
    {name:'hello',location:'122.15925492428805,29.97871689152069',tag:'111',tableId:'110'}
  ]
  comp.poiLayerManager.addLayer('pois',pois,{fit:true})
}
(data,comp)=>{
  //tableId 对应自定义POI图标的ID
  const pois=[
    {name:'hello',location:'122.15925492428805,29.97871689152069',tag:'111',tableId:'110'}
  ]
  comp.poiLayerManager.addLayer('pois',pois,{fit:true})
}

定位

javascript
(data,comp)=>{
  const center=[122.15925492428805,29.97871689152069]
  comp.map.easeTo({center,image:'http://xxxx.png'})
}
(data,comp)=>{
  const center=[122.15925492428805,29.97871689152069]
  comp.map.easeTo({center,image:'http://xxxx.png'})
}

移除定位图标

javascript
(data,comp)=>{
  comp.map.removeCenter()
}
(data,comp)=>{
  comp.map.removeCenter()
}

移除所有点位

javascript
(data,comp)=>{
  comp.poiLayerManager.removeAll()
}
(data,comp)=>{
  comp.poiLayerManager.removeAll()
}

条件移除

javascript
(data,comp)=>{
  //点位聚合后无效
  comp.poiLayerManager.removeFn(o=>{
    const properties=o.properties.getValue()
    const {poi}=properties
    return poi.tag=='111'
  })
}
(data,comp)=>{
  //点位聚合后无效
  comp.poiLayerManager.removeFn(o=>{
    const properties=o.properties.getValue()
    const {poi}=properties
    return poi.tag=='111'
  })
}

Demo相关:http://tianque.oicp.net:28182/tq-bigscreen-web/#/build/1496776726768787457

Last updated: