cache and merge in new annotations with already loaded data#50
cache and merge in new annotations with already loaded data#50timwaters wants to merge 1 commit intokartta-labs:masterfrom
Conversation
…th new features on map move
|
I think if we are going to do this, then we also need to have a way to remove annotations from memory that are outside the current view. Otherwise as the user pans around, memory usage could grow without bound, right? |
|
Yeah, memory would grow as they pan around. We'd have to figure out how many objects a normal browser could handle. Some older ones would struggle more. Another way could be to only update the id array for the map and leave the annotations to be replaced as it is. If the user clicks on a polygon and the annotations hadn't been loaded yet, they wouldn't see any detail, so maybe there could be a new check for new info and re-populate the side panel, or just show a loading indicator until? The id array could be much larger but still wouldn't be able to have everything in it, I guess. Perhaps a loading indicator or refresh mechanism could be used for both approaches? |
This PR makes it so when annotation data is requested, it keeps, merges in, and removes duplicates with any existing data instead of just overwriting with new data. This means that a user, if they panned back to an area of the map they have already visited, should not see a few ms of no data while data is being requested and should see the previous style.