带对话框的自定义标记

Muh*_*min 5 mapbox-gl mapbox-gl-js

在此处输入图片说明在此处输入图片说明

我如何实现如上所示的对话框。到目前为止,这是我现在可以做的

map.addLayer({
    "id": "markers",
    "type": "symbol",
    "source": "markers",
    "interactive": true,
    "layout": {
        "text-field": "{price2}",
        "text-font": ["Open Sans Semibold", "Arial Unicode MS Bold"],
        "text-offset": [0, 0.6],
        "text-anchor": "top",
        "text-size": 12,
        "text-letter-spacing": 0.05,
        "icon-image": "marker-15"
    },
    "paint": {
        "text-color": "#fff",
        "text-halo-width": 2,
        "text-halo-color": "rgb(11, 148, 68)"
    }
});
Run Code Online (Sandbox Code Playgroud)

我必须使用工作室才能产生这种效果吗?

Rap*_*ier 1

我认为做到这一点的唯一方法是将标记与自定义 HTML Element一起使用。但您将无法使用来源。