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

get OSM Bright style working #159

Closed
incanus opened this issue Apr 23, 2014 · 17 comments
Closed

get OSM Bright style working #159

incanus opened this issue Apr 23, 2014 · 17 comments
Assignees
Labels
GL JS parity For feature parity with Mapbox GL JS
Milestone

Comments

@incanus
Copy link
Contributor

incanus commented Apr 23, 2014

From https://github.com/mapbox/osm-bright-gl/blob/master/style.js

/cc @edenh

@incanus incanus added the parity label Apr 23, 2014
@incanus
Copy link
Contributor Author

incanus commented Apr 23, 2014

Working with @edenh on this yields success on OS X and iOS:

ios simulator screen shot apr 23 2014 4 18 15 pm

@edenh
Copy link
Contributor

edenh commented Apr 23, 2014

🎆
some notes:

  • dasharray property ignored
  • translate property ignored
  • road labels appear intermittently. in general, labels are very sparse
  • have not successfully used sprite

@incanus
Copy link
Contributor Author

incanus commented Apr 23, 2014

Sprite's working for me and in general I have seen labels to be sparse overall previously. I haven't looked into that yet but @kkaefer might have some insight.

@incanus
Copy link
Contributor Author

incanus commented Apr 24, 2014

@incanus
Copy link
Contributor Author

incanus commented Apr 24, 2014

POIs aren't coming through, either.

@incanus
Copy link
Contributor Author

incanus commented Apr 25, 2014

@edenh Try grabbing the latest from the stylequest branch, which includes OSM Bright as the style, and see if the sprite works for you. It does for me (no POIs still, though).

@edenh
Copy link
Contributor

edenh commented Apr 25, 2014

@incanus sprite works. looking good 👍

@incanus
Copy link
Contributor Author

incanus commented Apr 26, 2014

POIs now work as of c379c9b. Just something odd about (I think) translucency that I still have to look into. Coloring is working ok, though.

screen shot 2014-04-25 at 6 18 16 pm

(Translation building shadow, also.)

@incanus
Copy link
Contributor Author

incanus commented Apr 28, 2014

POIs are ok, I think. Bigger problem right now that I'm working on is country/admin/marine line features not showing up.

@incanus
Copy link
Contributor Author

incanus commented Apr 28, 2014

These line features are related to parsing of vector tiles, not rendering. Getting close, but this part of the code is pretty new to me.

@incanus
Copy link
Contributor Author

incanus commented Apr 30, 2014

Argghhhh... finally solved.

screen shot 2014-04-30 at 3 40 17 pm

Turns out this std::find:

https://github.com/mapbox/llmr-native/blob/797f590cfb846e978561f2ff1e6921e37c2d4aff/src/map/vector_tile.cpp#L242

Does not work for numeric feature values (such as when looking for admin_level = 2 and maritime = 1) but does work for string values (most of the other layers).

This happens because the type of number parsed from the protobuf in value.cpp (https://github.com/mapbox/llmr-native/blob/797f590cfb846e978561f2ff1e6921e37c2d4aff/src/style/value.cpp#L6) doesn't necessarily correspond to the type of number iterated out of bucket_desc.source_value (https://github.com/mapbox/llmr-native/blob/797f590cfb846e978561f2ff1e6921e37c2d4aff/src/map/vector_tile.cpp#L241), i.e. it could be comparing 32-bit and 64-bit floats and finding inequality.

So subtle, so much pain.

xexw7ie

@incanus
Copy link
Contributor Author

incanus commented Apr 30, 2014

With this I think stylequest is done and we can merge it into master with OSM Bright as the new default theme for now. Label sparseness is tracked in #162 and nested layers in #140, so I think we're in good shape.

@kkaefer thoughts on merging to master?

@springmeyer
Copy link
Contributor

nice work getting to the bottom of this @incanus. Hope you have a warm dinner or tasty beverage in your future to help unwind this bug from your head.

@kkaefer
Copy link
Member

kkaefer commented May 2, 2014

Hah, dang. I meant to fix that by implementing cross-type compare functions a long time ago (I already have an implementation somewhere (i.e. we shouldn't convert everything to a string, but instead cast strings to numbers if possible)

@mikemorris
Copy link
Contributor

Damn you static typing and strict comparisons!

@incanus
Copy link
Contributor Author

incanus commented May 2, 2014

Yeah, I should have guessed at something like this (20/20) but it took me a while to get down to that level, stepping through buckets and manually parsing out vector tile features (as well as learning the vector tile format) but in the end, the way I was debugging at first was outputting things as integers, which the values essentially were, and the opacity of pbf types contributed, too. Anyway, onward! I now know both the tile format and the basics of pbf a lot better.

@kkaefer I've ticketed that in #166 to improve if you can dig up that code.

@incanus
Copy link
Contributor Author

incanus commented May 7, 2014

Stylequest is now merged and OSM Bright is the default style in master.

@incanus incanus closed this as completed May 7, 2014
acalcutt pushed a commit to acalcutt/mapbox-gl-native that referenced this issue Apr 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
GL JS parity For feature parity with Mapbox GL JS
Projects
None yet
Development

No branches or pull requests

5 participants