如何在 Bing Maps v8 中指定图块图层的 zIndex 以覆盖城镇名称?
How to specify the zIndex of tile layers in Bing Maps v8 in order to overwrite town names?
以下代码复制自Bing Maps V8 interactive SDK。仅添加 zIndex
:
var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
credentials: 'Your Bing Maps Key',
center: new Microsoft.Maps.Location(40.750220, -99.476964),
zoom: 4
});
// weather radar tiles from Iowa Environmental Mesonet of Iowa State University
var weatherTileSource = new Microsoft.Maps.TileSource({
uriConstructor: 'http://mesonet.agron.iastate.edu/cache/tile.py/1.0.0/nexrad-n0q-900913/{zoom}/{x}/{y}.png'
});
var weatherTileLayer = new Microsoft.Maps.TileLayer({
mercator: weatherTileSource,
zIndex: 10001
});
map.layers.insert(weatherTileLayer);
是否可以调整 zIndex
使天气图块图层位于显示城镇和州名称的图层之上?
默认情况下,Bing 地图使用矢量标签呈现在除图钉之外的所有内容之上。您可以通过在加载时添加以下地图选项来禁用此功能并在基础地图图块(图块层下方)中呈现标签:liteMode: true
您可以在此处找到有关矢量标签的更多信息:https://msdn.microsoft.com/en-us/library/mt750538.aspx
以下代码复制自Bing Maps V8 interactive SDK。仅添加 zIndex
:
var map = new Microsoft.Maps.Map(document.getElementById('myMap'), {
credentials: 'Your Bing Maps Key',
center: new Microsoft.Maps.Location(40.750220, -99.476964),
zoom: 4
});
// weather radar tiles from Iowa Environmental Mesonet of Iowa State University
var weatherTileSource = new Microsoft.Maps.TileSource({
uriConstructor: 'http://mesonet.agron.iastate.edu/cache/tile.py/1.0.0/nexrad-n0q-900913/{zoom}/{x}/{y}.png'
});
var weatherTileLayer = new Microsoft.Maps.TileLayer({
mercator: weatherTileSource,
zIndex: 10001
});
map.layers.insert(weatherTileLayer);
是否可以调整 zIndex
使天气图块图层位于显示城镇和州名称的图层之上?
默认情况下,Bing 地图使用矢量标签呈现在除图钉之外的所有内容之上。您可以通过在加载时添加以下地图选项来禁用此功能并在基础地图图块(图块层下方)中呈现标签:liteMode: true
您可以在此处找到有关矢量标签的更多信息:https://msdn.microsoft.com/en-us/library/mt750538.aspx