Skip to content

Latest commit

 

History

History
48 lines (42 loc) · 1.03 KB

README.md

File metadata and controls

48 lines (42 loc) · 1.03 KB

javascript toolkit base project

Usage

npm install -S leaflet.chinaProvider

Example

  • baidu tile layer
    import L from 'leaflet';
    import 'leaflet.chinaProvider';
    const map = L.map('map', {
      crs: L.CRS.Baidu, // if use baidu
      center: [31.59, 120.29],
      zoom: 12,
      maxZoom: 18,
      minZoom: 5
    })
    L.tileLayer.chinaProvider('Baidu.Normal.Map', { customid }).addTo(map);
  • google tile layer
    import L from 'leaflet';
    import 'leaflet.chinaProvider';
    const map = L.map('map', {
      center: [31.59, 120.29],
      zoom: 12,
      maxZoom: 18,
      minZoom: 5
    })
    L.tileLayer.chinaProvider('Google.Normal.Map').addTo(map);

alt text

Development

Envirenment

  • node v10.8.0

feature list

0.1.0

  • 拆分各个地图公司的配置,以统一出口对外输出
  • proj2leaflet 需要引入 leaflet, 怎么解决