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

How to change vector tile data in mapbox? #8244

Closed
xiaofsu opened this issue May 14, 2019 · 8 comments
Closed

How to change vector tile data in mapbox? #8244

xiaofsu opened this issue May 14, 2019 · 8 comments
Labels
feature 🍏 needs investigation 🔍 Issues that require further research (e.g. it's not clear whether it's GL JS or something else)

Comments

@xiaofsu
Copy link

xiaofsu commented May 14, 2019

Use MapBox on the web.

When I first load the vector tile I want to make him reload other vector tiles is still using this layer id.(Can I have a layer request data again?)

And I see #3037
Use addSource and removeSource
Will flash on the screen. This is not good.(I don't quite understand how to solve the problem of flickering in #1989.)
And show/hide them
Will cause the browser to be severely stuck because of the large amount of data
I need to render nearly 20 kinds of data, and they are all 15 days.

It looks like geojson's setData and image's updateImage

Unfortunately, I didn't find a way to change the data in the vector.

So, I want to ask How do I change the request path in the vector and have the MapBox request the resource again and render it to the map.

But I don't know how to implement it, how to get it done.

Or you have a better way, please help me. Thank you

Browser: Chrome 75.0.3770.142
System: windows10
Mapbox-gl-js: 1.1.1

@xiaofsu
Copy link
Author

xiaofsu commented May 14, 2019

And I see mapbox/mapbox-gl-style-spec#570
It’s too bad for me, isn’t it?

@joedjc
Copy link

joedjc commented May 14, 2019

@xiaofsu I'm looking for this as well. I'm hoping this will fix #8048. Not sure of the status of it though

@xiaofsu
Copy link
Author

xiaofsu commented May 15, 2019

@xiaofsu I'm looking for this as well. I'm hoping this will fix #8048. Not sure of the status of it though

I think this method can solve my problem.
But it's a bad news to be unsure of when this method can be used.🤔🤔🤔

@jacknkandy
Copy link

@xiaofsu at the moment you can try something like this #3709 (comment) however I am using this "hack" and am sometimes am getting random errors (see #8233). Hopefully #8048 will be what we're after!!

@ahk ahk added needs investigation 🔍 Issues that require further research (e.g. it's not clear whether it's GL JS or something else) feature 🍏 labels May 29, 2019
@xiaofsu
Copy link
Author

xiaofsu commented Jul 30, 2019

@xiaofsu at the moment you can try something like this #3709 (comment) however I am using this "hack" and am sometimes am getting random errors (see #8233). Hopefully #8048 will be what we're after!!

Currently in use #3709 ,But the screen is still blinking, I don't think this is the reason for the network, because the browser has helped me with the cache. Hope #8048 can help us.😂😂

@xiaofsu
Copy link
Author

xiaofsu commented Jul 30, 2019

TestDemo
This is my recording of the demo I am implementing now, you can see the obvious flashing
image
These data are also cached by the browser.

@xiaofsu
Copy link
Author

xiaofsu commented Jul 31, 2019

I think I did the wrong direction at the beginning, I have been thinking about multiple mbtiles files, and then requesting different files to achieve the purpose of weather refresh. But I didn't think about an mbtiles file. There are multiple weather information in this file, and then filter to control what weather is displayed in each time period. Obviously an mbtiles file is correct this way.
111

@xiaofsu
Copy link
Author

xiaofsu commented Jul 31, 2019

@xiaofsu I'm looking for this as well. I'm hoping this will fix #8048. Not sure of the status of it though

@xiaofsu at the moment you can try something like this #3709 (comment) however I am using this "hack" and am sometimes am getting random errors (see #8233). Hopefully #8048 will be what we're after!!

I am going to close this question because I have found the answer I want. I hope that you can also use this method to solve the current problem.
image

@xiaofsu xiaofsu closed this as completed Jul 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🍏 needs investigation 🔍 Issues that require further research (e.g. it's not clear whether it's GL JS or something else)
Projects
None yet
Development

No branches or pull requests

4 participants