zoukankan      html  css  js  c++  java
  • 开源免费瓦片地图下载器MapDownload

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

    map-download

    项目地址:https://github.com/Hxy1992/MapDownload
    软件下载地址:https://github.com/Hxy1992/MapDownload/releases
    基于electron和maptalks实现高德地图、百度地图(包括百度自定义地图)、腾讯地图、OpenStreetMap、CartoDb、ArcGIS在线地图、天地图(需Key)、MapBox(需Key)的下载

    Build Setup

    # 安装依赖(依赖较大,使用国内镜像)
    npm install
    
    # 热更新服务
    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'
      })
    });
    
  • 相关阅读:
    c++ Knight Moves 超级升级版
    百度招聘彩蛋
    C++ 八数码问题宽搜
    c++ 动态规划(数塔)
    c++ 深度优先搜索(迷宫)
    c++ 宽搜(倒水)
    c++ matrix逆时针螺旋
    c++ 基数排序
    c++ 二分答案(解方程)
    c++ 二分答案(数组查找)
  • 原文地址:https://www.cnblogs.com/dullfish/p/15723853.html
Copyright © 2011-2022 走看看