-
Hi - I've got 30,000 polygons and 400,000 points in mbtiles that I can render just fine. I don't expect them to change much if at all ever, like once per year/quarter maybe. I have 350kb of json data that changes weekly I'd like to use to style them. I could put the data into the tiles but then everyone would have to download MBs of new tiles weekly instead of just the data. Using feature-state I can conditionally change the color of the polygons and the points. Is there a way to set features state on the polygons/points from the source such that when each tile is loaded it uses the feature's state that's already been set? Right now I only know how to do it using Is there a way to pause or skip painting then resume it once the states have been updated? Also - because Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Do you have a small example you can share to better explain the problem? I'm not sure I fully understand it from what you wrote... |
Beta Was this translation helpful? Give feedback.
-
Yea sure lemme make one. I'm making a dot density map that alternately shows isochrones, based on user choice. Based on the variable in the json the user wants to look at, I make quintiles and color the polygons and dots based on which quintile they're in. Not all of the polygons or dots are shown for each variable. I want to sort them so the upper quintile dots and polygons are above the lower ones. Hence the multiple layers of identical data. |
Beta Was this translation helpful? Give feedback.
-
Here is a codesandbox that shows the gist of what I'm doing. Its just for 4 polygons about 100 points. When there is a ton of points or polygons profiling shows most of the time is spent in https://codesandbox.io/s/crimson-frost-d676dv?file=/src/index.js |
Beta Was this translation helpful? Give feedback.
-
The answer to my problem was that I should have only been doing the |
Beta Was this translation helpful? Give feedback.
The answer to my problem was that I should have only been doing the
setFeatureState
called in response to adata
event and only use thequerySourceFeatures
to find the features that needed it, and cacheing the ids of the ones I'd set the state for. W