htoooth / Leaflet.ChineseTmsProviders

Provider for Chinese Tms Service
https://htoooth.github.io/Leaflet.ChineseTmsProviders/
MIT License
1.01k stars 300 forks source link

天地图更新后需要申请key才能使用,我修改了一下源码 #15

Closed lilu0826 closed 5 years ago

lilu0826 commented 5 years ago
    在后面增加&tk=你申请的key即可使用天地图服务
Normal: {
            Map:'http://t{s}.tianditu.gov.cn/vec_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=vec&tileMatrixSet=w&TileMatrix={z}&TileRow={y}&TileCol={x}&style=default&tk=你的key',
            Annotion: "http://t{s}.tianditu.gov.cn/cva_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=cva&tileMatrixSet=w&TileMatrix={z}&TileRow={y}&TileCol={x}&style=default&tk=你的key"
        },
        Satellite: {
            Map: "http://t{s}.tianditu.gov.cn/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={z}&TileRow={y}&TileCol={x}&style=default&tk=你的key",
            Annotion: "http://t{s}.tianditu.gov.cn/cia_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=cia&tileMatrixSet=w&TileMatrix={z}&TileRow={y}&TileCol={x}&style=default&tk=你的key"
        },
        Terrain: {
            Map: "http://t{s}.tianditu.gov.cn/ter_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=ter&tileMatrixSet=w&TileMatrix={z}&TileRow={y}&TileCol={x}&style=default&tk=你的key",
            Annotion: "http://t{s}.tianditu.gov.cn/cta_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=cta&tileMatrixSet=w&TileMatrix={z}&TileRow={y}&TileCol={x}&style=default&tk=你的key"
        },
        Subdomains: ['0', '1', '2', '3', '4', '5', '6', '7']
    },
zjffun commented 5 years ago

我刚才测试还得改成 com 的域名的才行

https://github.com/htoooth/Leaflet.ChineseTmsProviders/pull/11 这个 pr 中加入了配置天地图的 key

htoooth commented 5 years ago

已经合并了