(1)添加额外样式的时候:
PluginParameter {
name: "mapboxgl.mapping.additional_style_urls"
value: "mapbox://styles/mapbox/dark-v9,mapbox://styles/mapbox/satellite-v9"
}
不能分开写,第二个会覆盖第一个样式,如下是错误的:
PluginParameter {
name: "mapboxgl.mapping.additional_style_urls"
value: "mapbox://styles/mapbox/dark-v9"
}
PluginParameter {
name: "mapboxgl.mapping.additional_style_urls"
value: "mapbox://styles/mapbox/satellite-v9"
}
如何设置map的样式呢:
mainMap.activeMapType = mainMap.supportedMapTypes[index]
其中:
如下是qt加载的mapbogl自带的:index从0开始:
qml: mainmap style description is Streets
qml: mainmap style description is Basic
qml: mainmap style description is Bright
qml: mainmap style description is Outdoors
qml: mainmap style description is Satellite
qml: mainmap style description is Satellite Streets
qml: mainmap style description is Light
qml: mainmap style description is Dark, name is: mapbox://styles/mapbox/dark-v9
qml: mainmap style description is Navigation Preview Day
qml: mainmap style description is Navigation Preview Night
qml: mainmap style description is Navigation Guidance Day
qml: mainmap style description is Navigation Guidance Night
加上两个类型后:
qml: mainmap style description is User provided style
qml: mainmap style description is User provided style
qml: mainmap style description is Streets
qml: mainmap style description is Basic
qml: mainmap style description is Bright
qml: mainmap style description is Outdoors
qml: mainmap style description is Satellite
qml: mainmap style description is Satellite Streets
qml: mainmap style description is Light
qml: mainmap style description is Dark
qml: mainmap style description is Navigation Preview Day
qml: mainmap style description is Navigation Preview Night
qml: mainmap style description is Navigation Guidance Day
qml: mainmap style description is Navigation Guidance Night
(2)修改MapPolyline的颜色lineColor:如果想要使用透明度,可使用:ARGB
ARGB 依次代表透明度(alpha)、红色(red)、绿色(green)、蓝色(blue)。