https://github.com/openlayers/openlayers/issues/9900
import Map from 'ol/Map';
import View from 'ol/View';
import TileLayer from 'ol/layer/Tile';
import XYZ from 'ol/source/XYZ';
new Map({
target: 'map',
layers: [
new TileLayer({
source: new XYZ({
url: 'http://mt{0-3}.google.com/vt/lyrs=r&hl=en&x={x}&y={y}&z={z}'
})
})
],
view: new View({
center: [0, 0],
zoom: 2
})
});
layers: [
new TileLayer({
source: new XYZ({
url: "http://mt{0-3}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}"
})
}),
new VectorLayer({
source: this.vectorSource
})
]
});
this.map.setLayerGroup(layer);
}
- 路线图
- 地形
- 路线图已更改
- 仅卫星
- 仅地形
- 杂种
网友评论