Git Product home page Git Product logo

bmap-offline-for-web's Introduction

bmap-offline-for-web

Baidu Map Web Localization Solution(百度地图Web端离线解决方案)

开始使用 (Getting Started)

下载 (Download)

$ git clone https://github.com/muxfe/bmap-offline-for-web.git

或者 (or)

下载压缩包 (Download ZIP)

配置 (Configuration)

加载 BaiduApi_2.0.js 之前修改自定义配置:

custom config before load BaiduApi_2.0.js:

window.__BMAP_EXTRA_CONFIG__ = {
    enable: true,
    host: '', // exmaple in nginx container
    path: '',
    tilePath: 'tiles/tile',
    satellitePath: 'tiles/it',
    roadPath: 'tiles/road'
}

默认配置 (default configuration):

{
    // 是否启用离线地图 (main switch)
    enable: false,
    // 部署离线地图的服务器地址 (deploy bmap-offline server host)
    host: '',
    // 静态资源路径,相对于 [host]/
    // (static resources path (relative host root path))
    path: '',
    // 瓦片图资源路径,相对于 [host]/[path]/
    // (tile pics resources path)
    tilePath: 'tiles/tile',
    // 卫星图资源路径,相对于 [host]/[path]/
    // (satellite pics resources path)
    satellitePath: 'tiles/it',
    // 混合地图中的路网图资源路径,相对于 [host]/[path]/
    // (satellite street pics resources path)
    roadPath: 'tiles/road',
    // 瓦片图时间戳 (tile updated date)
    tileUdt: '20170927',
    // 卫星图时间戳 (satellite updated date)
    satelliteUdt: '20170927',
    // 混合地图中的路网图时间戳 (satellite street updated date)
    roadUdt: '20170927',
    // 离线化的功能模块 js 文件
    // (localized modules (path is [host]/[path]/[getmodules]/[mod].js))
    modules: [
        'map,scommon,mapclick,oppc,newvectordrawlib,style,tile,navictrl',
        'canvablepath,common,symbol,marker,copyrightctrl',
        'draw,drawbycanvas,drawbysvg,drawbyvml,poly'
    ],
    // 百度地图自身 API 请求拦截器 (BMap request interceptor)
    interceptor: function (url) {
        return /(qt=vQuest|qt=verify|qt=cen)/.test(url);
    }
}

部署 (Deploy)

可以部署在 nginx 等 web 容器中。(Example nginx or others).

百度地图瓦片图和卫星图下载器 (Download Baidu Map Tiles)

bmap-offline-for-web's People

Contributors

muxfe avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.