我似乎无法使用带有 ngx-leaflet 角度插件的谷歌地图样式向导生成的样式。例如,我使用谷歌地图样式向导来减少地图上显示的标签数量。
想问在代码中的何处应用由样式向导创建的给定 json 对象。
我有以下html:
<div leaflet
[leafletOptions]="options"
[leafletLayers]="layers"
[leafletLayersControl]="layersControl"
[leafletFitBounds]="fitBounds"
(leafletMapReady)="onMapReady($event)">
</div>
这个生成的样式:
style = [
{
"featureType": "poi",
"elementType": "labels.text",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "poi.business",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "road",
"elementType": "labels.icon",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "transit",
"stylers": [
{
"visibility": "off"
}
]
}
];
无法在文档中找到它并尝试了多种方式。有没有办法做到这一点?