new ol.supermap.MapboxStyles(options)
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
初始化参数。
|
Example
var mbStyle = new ol.supermap.MapboxStyles({
url: url,
source: 'California',
resolutions: [78271.51696402048,39135.75848201024, 19567.87924100512,9783.93962050256,4891.96981025128,2445.98490512564]
})
mbStyle.on('styleLoaded', function () {
var vectorLayer = new ol.layer.VectorTile({
//设置避让参数
declutter: true,
source: new ol.source.VectorTileSuperMapRest({
url: url,
format: new ol.format.MVT({
featureClass: ol.Feature
}),
tileType: 'ScaleXY'
}),
style: mbStyle.featureStyleFuntion
});
map.addLayer(vectorLayer);
})
Events
-
styleloaded
openlayers/overlay/vectortile/MapboxStyles.js, line 190 -
样式加载成功后触发。
Methods
-
getStyleFunction(){ol.FeatureStyleFunction}
openlayers/overlay/vectortile/MapboxStyles.js, line 104 -
获取 ol.FeatureStyleFunction。
Returns:
Type Description ol.FeatureStyleFunction 返回 ol.FeatureStyleFunction。 -
getStylesBySourceLayer(sourceLayer)
openlayers/overlay/vectortile/MapboxStyles.js, line 112 -
Name Type Description sourceLayer
string 数据图层名称。