Skip to content

AutoNavi map, Baidu map (including Baidu custom map), Tencent map, OpenStreetMap, CartoDb, ArcGIS online map download

License

Notifications You must be signed in to change notification settings

spyderr67/MapDownload

 
 

Repository files navigation

Required Node.JS >= v16.13 Required npm >= v8.1

map-download

基于electron和maptalks实现高德地图、百度地图(包括百度自定义地图)、腾讯地图、OpenStreetMap、CartoDb、ArcGIS在线地图、天地图、MapBox的下载

支持卫星遥感影像和标注合并

支持行政区划瓦片下载,裁切边界

软件下载地址:https://github.com/Hxy1992/MapDownload/releases

image

Build Setup

# 安装依赖(依赖较大,使用国内镜像)
npm install

# 热更新服务
npm run dev / npm run watch

# 构建web
npm run build

# 构建应用
npm run compile

下载瓦片加载方式

Cesium

// 非百度地图
viewer.imageryLayers.addImageryProvider(new Cesium.UrlTemplateImageryProvider({
  url: 'http://localhost:7099/{z}/{x}/{y}.png'
}))
// 百度地图(需自定义BaiduImageryProvider),可参考cesium-helper目录下代码
import BaiduImageryProvider from './cesium-helper/BaiduImageryProvider/BaiduImageryProvider.js'
viewer.imageryLayers.addImageryProvider(new BaiduImageryProvider({
  url: 'http://localhost:7099/{z}/{x}/{y}.png'
}))

openlayers

// 非百度地图
const baseMap = new ol.layer.Tile({
  source: new ol.source.XYZ({
    url: 'http://localhost:7099/{z}/{x}/{y}.png',
    projection: 'EPSG:3857',
  }),
});
const map = new ol.Map({
  layers: [baseMap],
  target: 'map',
  view: new ol.View({
    center: ol.proj.transform([105.08052356963802, 36.04231948670001], 'EPSG:4326', 'EPSG:3857'),
    zoom: 5,
  }),
});

maptalks

// 非百度地图
var map = new maptalks.Map('map', {
  center: [105.08052356963802, 36.04231948670001],
  zoom: 5,
  minZoom:1,
  maxZoom:19,
  baseLayer: new maptalks.TileLayer('base', {
    'urlTemplate' : 'http://localhost:7099/{z}/{x}/{y}.png'
  })
});
//百度地图
var map = new maptalks.Map('map', {
  center: [105.08052356963802, 36.04231948670001],
  zoom: 5,
  minZoom:1,
  maxZoom:19,
  spatialReference:{
    projection : 'baidu',
  },
  baseLayer: new maptalks.TileLayer('base', {
    'urlTemplate' : 'http://localhost:7099/{z}/{x}/{y}.png'
  })
});

TODO

  • 行政区划范围下载和瓦片裁切 - 部分完成
  • 支持切换中英文瓦片
  • 下载瓦片格式,增加jpeg、png、webp支持
  • 自定义图层加载、下载,支持上传geojson作为下载范围

注:软件仅作为学习交流使用

About

AutoNavi map, Baidu map (including Baidu custom map), Tencent map, OpenStreetMap, CartoDb, ArcGIS online map download

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 77.8%
  • Vue 21.1%
  • Other 1.1%