【问题标题】:How to add a custom marker to 3D building map in mapbox?如何在 mapbox 中向 3D 建筑地图添加自定义标记?
【发布时间】:2019-09-26 13:41:26
【问题描述】:

我正在尝试将 Mapbox 地图添加到我的烧瓶应用程序中。我有 python 经验,但我是 JS 和 HTML 的新手。我正在尝试添加一个 3D 构建应用程序来可视化结果,并且我已经从 Mapbox 文档页面获得了 3D 地图的布局。但是,我想使用纬度和经度在特定位置添加一个标记,但我无法这样做。请告诉我如何向 Mapbox 3D 地图添加位置标记。

3d地图的代码是:https://docs.mapbox.com/mapbox-gl-js/example/3d-buildings/

【问题讨论】:

    标签: mapbox mapbox-gl-js mapbox-gl mapbox-marker


    【解决方案1】:

    此示例显示如何将标记添加到地图 https://docs.mapbox.com/mapbox-gl-js/example/set-popup/,但它将位于地平面上,而不是在 3D 中的任何给定高度。

    // create the marker
    new mapboxgl.Marker()
       .setLngLat([lng, lat])
       .addTo(map);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-01-02
      • 2019-12-02
      • 2020-09-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多