Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Support using maki as a value for image property #196

Merged
merged 7 commits into from
May 19, 2014
Merged

Support using maki as a value for image property #196

merged 7 commits into from
May 19, 2014

Conversation

kkaefer
Copy link
Member

@kkaefer kkaefer commented May 15, 2014

Currently we cannot use the variable maki as a value for the image property for poi_label markers. As a workaround, we are creating individual buckets for each maki type, but this is problematic because 1) we cannot also use the scalerank field to then control label/marker density, and 2) it is not practical to make a bucket for every single maki type.

Example showing only parks:
poi_density-04

@edenh edenh added this to the WWDC milestone May 14, 2014
kkaefer added a commit that referenced this pull request May 15, 2014
@kkaefer
Copy link
Member

kkaefer commented May 15, 2014

It looks like we're going to have to implement a way for updating our buffers after they were uploaded to the GPU. This is necessary because otherwise we'd have to wait until the sprite is loaded before requesting/parsing any tiles, since they are now dependent on the sprite.json file.

@kkaefer
Copy link
Member

kkaefer commented May 15, 2014

This just renders all points in the poi vector tile layer, using the maki property for looking up the appropriate texture: sdjy1

Missing things before this can be merged:

  • If the sprite is not yet available (because it is still being downloaded), we need to reparse the layer and assign the correct texture coordinates
  • Rendering on retina screens is not working properly
  • Make sure we're creating a dedicated dot bucket in case we don't want to assign a texture
  • We are currently drawing one fixed size of icons per bucket

Reparsing the tiles seems like a slightly larger effort, so as a quick stopgap, we could change the sprite class so that it is always allocated from the beginning. As we add named icons, we reserve space in the sprite (like the glyph atlas), but use some sort of default icon (e.g. a dot) that we hardcode into the app. When the sprite loads, we're going to decode the image file, and copy the icons over to the correct spot in the sprite image.

We could also move the dot shader to use this system, by reusing the same infrastructure; instead of actual icons, we generate the "dots" on the CPU and use them as textures.

@kkaefer kkaefer merged commit ee82986 into master May 19, 2014
@mourner mourner deleted the icons branch May 19, 2014 13:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants