Leaflet 调用腾讯瓦片地图服务demo

 

<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css"
integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
crossorigin="" />
<script src="https://unpkg.com/leaflet@1.7.1/dist/leaflet.js"
integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
crossorigin=""></script>


<div id="map-container" style="width: 600px; height: 400px;"></div>

<script>
var m = L.map(‘map-container‘).setView([36.52, 120.31], 7);
L.tileLayer(‘http://rt0.map.gtimg.com/realtimerender?z={z}&x={x}&y={-y}&type=vector&style=0‘, { //腾讯地图瓦片服务
maxZoom: 18,
attribution: ‘右下角文字‘,
id: ‘mapbox.streets‘
}).addTo(m);
</script>

 

附其他瓦片地图URL:https://zhuanlan.zhihu.com/p/138591824

Leaflet 调用腾讯瓦片地图服务demo

上一篇:测试理论学习二


下一篇:C# 6.0 新功能Top 10