Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

天地图加载不出来,请求200,但是返回了的图片有问题 #2

Closed
yangyang158 opened this issue Jul 5, 2019 · 2 comments

Comments

@yangyang158
Copy link

yangyang158 commented Jul 5, 2019

import { WMTSTileLayer } from 'maptalks.wmtstilelayer'
     
 let map = new maptalks.Map('map', {
            center: [105.08052356963802, 36.04231948670001],
            zoom: 4,
            minZoom:1,
            maxZoom:18,
            spatialReference:{
              projection:'EPSG:4326'
            },
            baseLayer: new WMTSTileLayer('base', {
                tileSystem : [1, -1, -180, 90],
                layer:'vec',
                tilematrixset:'c',
                format:'tiles',
                urlTemplate:'http://t{s}.tianditu.com/vec_c/wmts?tk=64a504e50b1f7d53ggggec3d86f4a522f86b',
                subdomains:['1', '2', '3', '4', '5'],
                attribution : '&copy; <a target="_blank" href="http://www.tianditu.cn">Tianditu</a>'
            }),
            layers : [
                new WMTSTileLayer('road', {
                    layer:'cva',
                    tilematrixset:'c',
                    format:'tiles',
                    urlTemplate:'http://t{s}.tianditu.com/cva_c/wmts?tk=64a504e50b1ffff7d53ec3d86f4a522f86b',
                    subdomains:['1', '2', '3', '4', '5'],
                    opacity:1
                })
            ]
        })
@lifefriend
Copy link
Owner

@yangyang158
上面贴出来的代码,天地图 key有问题,更换 tk 后,地图正常显示。

@yangyang158
Copy link
Author

感谢,已解决了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants