<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="../lib/include-openlayers-local.js"></script>
</head>
<body>
<div id="map_container">
</div>
<script>
const key = '8a5c2b00e94b49659861e064c37f778d'
/* 天地图矢量图层 */
const TianDiMap_vec = new ol.layer.Tile({
title:"天地图矢量图层",
source:new ol.source.XYZ({
url:'http://t0.tianditu.com/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=' +
key,
wrapX:false
})
})
/* 天地图注记图层 */
const TianDiMap_cva = new ol.layer.Tile({
title:"天地图矢量注记图层",
source:new ol.source.XYZ({
url:'http://t0.tianditu.com/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=' +
key,
wrapX:false
})
})
/* 天地图影像图层 */
const TianDiMap_img = new ol.layer.Tile({
title:"天地图影像图层",
source:new ol.source.XYZ({
url:'http://t0.tianditu.com/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=' +
key,
wrapX:false
})
})
/* 天地图影像注记图层 */
const TianDiMap_cia = new ol.layer.Tile({
title:"天地图影像图层",
source:new ol.source.XYZ({
url:'http://t0.tianditu.com/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=' +
key,
wrapX:false
})
})
const map = new ol.Map({
target:'map_container',
layers:[TianDiMap_vec,TianDiMap_cva,TianDiMap_img,TianDiMap_cia],
view:new ol.View({
projection:'EPSG:4326',
center:[0,0],
zoom:1
})
})
</script>
</body>
</html>