Fork me on GitHub

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

posted @ 2021-08-04 17:15  WantRemake  阅读(704)  评论(0编辑  收藏  举报