-
Notifications
You must be signed in to change notification settings - Fork 506
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
添加多个TileLayer,控制台报错 #1936
Comments
@liuxuechao01 这个是正常的,浏览器里webglcontext个数是有限制的
|
@deyihu 目前业务确实有很多个TileLayer,而且要控制图层的叠加顺序和透明度,我用GroupTileLayer尝试过了,如果把图层加载到GroupTileLayer中,就无法单独控制图层的透明度和图层的叠加顺序(ZIndex修改无效),另外这些图层也是无法合并的~~~业务场景就这么设计的~~~ |
这么多tilelayer光是网络请求就可怕的要死,这个我也没法子了🙄,浏览器的限制摆在那里 |
@deyihu 可能要有3~4十个图层,当然这个是最多的情况,一般不会加载这么多,但是产品设计,是支持这么多图层的,这个问题我跟镇讲了,镇说优化,也不知道怎么优化,哈哈哈 |
@liuxuechao01 怎样优化都么有用,你知道30-40个tilelayer图层,单位时间内有多少个网络请求?,假设一个图层有20个瓦片,30个图层就 600个网络请求,浏览器会一直排队的,甚至超时,那个体验。。。。。。。。 |
描述:在map中添加超过16个tilelayer图层,会报错:Uncaught Error: Failed to create the buffer object
代码如下:
// 最多只能创建16个tileLayer,超过16个,会报错:Uncaught Error: Failed to create the buffer object
for (let index = 0; index < 16; index++) {
new maptalks.TileLayer(index, {
urlTemplate: 'https://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png',
subdomains: ['a', 'b', 'c', 'd']
}).addTo(map)
}
The text was updated successfully, but these errors were encountered: