-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cleanup osm service notes and caches, remove state variable
This seems like a lot but the main things here are: - remove the _loadingTiles "global" variable. It was causing problems because it was being checked from the callbacks, which are async. - cleanup the caches - use DOM API getElementsByTagName('id') to get note id - set a lower tilezoom z13 for notes (meaning: fetch larger bounding boxes)
- Loading branch information
Showing
2 changed files
with
89 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
229484a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bhousel these are great cleaning updates. To clarify, the _seenEntity cache will hold all entities seen, notes and osm alike, correct?
229484a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah - it can, although I was thinking about it more, and I think we can just skip adding notes to this cache.
The purpose of this
_seenEntity
cache is to avoid re-parsing an entity that we've already parsed - it gives iD a slight performance improvement. Large objects like roads or forests can span across several tiles, so as iD fetches more tiles, we'd end up parsing the same object again.Notes don't really work this way, so there is no advantage to adding them to the cache.