【mars3d】LayerType 的arcgis_feature类型的图层配置聚合属性,达到聚合效果

相关api文档:

Global - V3.7.23 - Mars3D API文档

Global - V3.7.23 - Mars3D API文档

ArcGisWfsLayer - V3.7.23 - Mars3D API文档

实现代码:

复制代码
export function onMounted(mapInstance) {
  map = mapInstance // 记录首次创建的map

  // 添加参考三维模型
  const tiles3dLayer = new mars3d.layer.TilesetLayer({
    name: "合肥国家大学科技园",
    url: "//data.mars3d.cn/3dtiles/qx-hfdxy/tileset.json",
    position: { alt: 80 },
    maximumScreenSpaceError: 1
  })
  map.addLayer(tiles3dLayer)

  const graphicLayer = new mars3d.layer.ArcGisWfsLayer({
    name: "兴趣点",
    url: "//server.mars3d.cn/arcgis/rest/services/mars/hefei/MapServer/1",
    where: " NAME like '%大学%' ",
    minimumLevel: 15,
    symbol: {
      type: "billboardP",
      styleOptions: {
        image: "img/marker/mark-blue.png",
        verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
        label: {
          text: "{NAME}",
          font_size: 15,
          color: "#ffffff",
          outline: true,
          outlineColor: "#000000",
          pixelOffsetY: -30
        }
      }
    },
      clustering: {
      enabled: true,
      pixelRange: 20,
    },
    popup: "名称:{NAME}<br />地址:{address}",
    show: true
  })
  graphicLayer.on(mars3d.EventType.addGraphic, function (event) {
    updateAutoSurfaceHeight(event.graphic)
  })

  map.on(mars3d.EventType.load, function (event) {
    map.addLayer(graphicLayer)
  })
}
相关推荐
来自星星的坤4 小时前
Vue 3中如何封装API请求:提升开发效率的最佳实践
前端·javascript·vue.js
vvilkim6 小时前
全面解析React内存泄漏:原因、解决方案与最佳实践
前端·javascript·react.js
vvilkim6 小时前
React批处理(Batching)更新机制深度解析
前端·javascript·react.js
Bayi·6 小时前
前端面试场景题
开发语言·前端·javascript
程序猿熊跃晖6 小时前
Vue中如何优雅地处理 `<el-dialog>` 的关闭事件
前端·javascript·vue.js
进取星辰6 小时前
12、高阶组件:魔法增幅器——React 19 HOC模式
前端·javascript·react.js
拉不动的猪7 小时前
前端低代码开发
前端·javascript·面试
程序员张37 小时前
Vue3集成sass
前端·css·sass
夜跑者7 小时前
axios 在请求拦截器中设置Content-Type无效问题
前端
知识分享小能手7 小时前
JavaScript学习教程,从入门到精通,Ajax与Node.js Web服务器开发全面指南(24)
开发语言·前端·javascript·学习·ajax·node.js·html5