有没有办法在地图上拉伸mapbox Point的高度?

时间:2017-07-07 18:27:51

标签: mapbox

有没有办法在地图上拉伸mapbox Point的高度? 有以下例子:

 map.addSource("markers", {
        "type": "geojson",
        "data": {
            "type": "FeatureCollection",
            "features": [{
                "type": "Feature",
                "geometry": {
                    "type": "Point",
                    "coordinates": [14.422063225409431,50.08273361716846]
                },
                "properties": {
                    "height": 12,
                    "base_height": 10,
                    "title": "Mapbox DC",
                    "marker-symbol": "spaceti-maintenance"
                }
            }, {
                "type": "Feature",
                "geometry": {
                    "type": "Point",
                    "coordinates": [14.421896271941648,50.08259946060207]
                },
                "properties": {
                    "height": 12,
                    "base_height": 10,
                    "title": "Mapbox SF",
                    "marker-symbol": "spaceti-maintenance"
                }
            }]
        }
    });


map.addLayer({
    "id": "markers",
    "source": "markers",
    //"type": "symbol",
    "type":"fill-extrusion",
    // "layout": {
    //    "icon-image": "{marker-symbol}",
    //    "text-field": "{title}",
    //    "text-font": ["Open Sans Semibold", "Arial Unicode MS Bold"],
    //    "text-offset": [0, 0.6],
    //    "text-anchor": "top"
    // },
    "paint": {
        // See the Mapbox Style Spec for details on property functions
        // https://www.mapbox.com/mapbox-gl-style-spec/#types-function
        "fill-extrusion-color": "#424242",
        "fill-extrusion-height": {
            // Get fill-extrusion-height from the source "height" property.
            "property": "height",
            "type": "identity"
        },
        "fill-extrusion-base": {
            // Get fill-extrusion-base from the source "base_height" property.
            "property": "base_height",
            "type": "identity"
        },
        // Make extrusions slightly opaque for see through indoor walls.
        "fill-extrusion-opacity": 0.90
      }
});

我是否能够使用图层的布局和绘制属性,假设我想要自定义图标+拉伸高度的标记?我正在建造多层室内导航,这就是原因。

0 个答案:

没有答案