下载离线地图多种方式(osm,MapTileDownloader )

目录

效果图:

一 下载离线地图的二种方式

1.osm 的方式下载瓦片

2、下载MapTileDownloader 

二 代码(推荐使用osm方式)


效果图:

一 下载离线地图的二种方式

1.osm 的方式下载瓦片

2、下载MapTileDownloader 

 文件格式选为瓦片

二 代码(推荐使用osm方式)

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>offline-leaflet-map-ID15</title>
<link rel="stylesheet" href="./leaflet/leaflet.css"/>
<script src="./leaflet/leaflet.js"></script>
<style>
html,body{margin:0;padding:0;width:100%;height:100%;overflow:hidden;}
#my-offline-leaflet-map{width:100%;height:100%;}</style>
</style>
</head><body>
<div id="my-offline-leaflet-map"></div>
<script>


var mymap=L.map('my-offline-leaflet-map',

{minZoom:9,maxZoom:10})

.setView([29.55402225, 106.54383115], 9);
L.TileLayer.Custom = L.TileLayer.extend({getTileUrl : function(coords){
url='./newtask/'+coords.z+'/'+coords.x+'/'+coords.y+'.png';
return url;}

});
L.tileLayer.Custom = function(){return new L.TileLayer.Custom();}
L.tileLayer.Custom().addTo(mymap);


</script>
</body>

</html>

三 osm和MapTileDownloader 下载方式

 osm百度网盘分享链接:https://pan.baidu.com/s/1Lv5JhLQSxdfRQjkMw1UsOA 

 官方tool下载地址:http://www.allmapsoft.com/

MapTileDownloader 百度网盘下载地址:https://pan.baidu.com/s/1BTbGTGhcgjyIvMNaVLLJNw 
两个分享地址的提取码:cook

评论 16
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值