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

[NOT READY] Implement v1 new style format for #172 - #230

Closed
ghost wants to merge 20 commits into
masterfrom
issue172-newstyle
Closed

ghost wants to merge 20 commits into
masterfrom
issue172-newstyle

Conversation

@ghost

@ghost ghost commented May 22, 2014

Copy link
Copy Markdown

This is still kinda broken, but it's doing a lot of the things which are needed for the v1 new style format (#172). The current bin/style.js for this branch is a copy of the outdoors-raw.js from the mapbox/gl-style test styles, and it uses nested layers for roads. Because this hasn't been merged with @kkaefer's nested layer code from #140, the roads stuff is broken, and there are probably other reasons as well.

This is what it looks like now:
screen shot 2014-05-21 at 10 01 42 pm

... it's interesting, but definitely wrong.

This is the checklist of things which I'm pretty sure that I've ported to llmr-native from @mourner's mapbox/mapbox-gl-js#363 (New style format). Many of the missing items were not implemented in llmr-native v0 to begin with, but there are probably also things which still can be done (line color pre-multiplying, etc), and which I don't really understand very well.

  • New style format mapbox-gl-js#363
    • debug/style.js
    • js/geometry/bucket.js
      • Promote text, point, line, and fill from values to keys
      • Change the syntax for point-size from a dictionary to an array
      • Change spacing to point-spacing
      • Change padding to point-padding
      • Add bucketFilter comparison for source and feature_type
      • Change join to line-join
      • Change cap to line-cap
      • Change miterLimit to line-miter-limit
      • Change roundLimit to line-round-limit
    • js/render/drawcomposited.js
      • Change name to id
    • js/render/drawfill.js
      • Change layer color to fill-color
      • Change layer stroke to stroke-color
    • js/render/drawline.js
      • Change line color to line-color
      • Change line width to line-width
      • Change line offset to line-offset
      • Change image to line-image
      • Change how the shader draws lines
    • js/render/drawpoint.js
      • Change point image to point-image
      • Change point color to point-color
      • Change point radius to point-radius
      • Change point invert to point-invert
      • Change point alignment to point-alignment
      • Change point rotate to point-rotate
    • js/render/drawtext.js
      • Change text path to text-path
      • Change text rotate to text-rotate
      • Change text size to text-size
      • Change text fontSize to text-max-size
      • Change text color to text-color
      • Change text stroke to text-halo-color
    • js/render/painter.js
      • Change name to id
      • Change test from bucket === 'background' to id === 'background'
      • Change class structure for bucket to reflect that text, point, line, and fill are now keys not values
      • Determine the bucket type, taking into account that text, point, line, and fill are now keys instead of values of type
      • Fix the warning about no bucket type being specified
    • js/style/bucket-filter.js
      • Implement bucket filtering
    • js/style/style.js
      • Change style's structure to layers
      • Change how line color pre-multiplication works
      • Change bucket.source to bucket.filter.source
      • Change name to id
      • Update how classes and styles work
        • Change classes key to styles
        • Change classes syntax (value is array) to styles syntax (value is dictionary)
        • Get rid of name key and promote its old values, default, satellite, and test to keys or, do it in a more general way where all top level keys become the name of a style.
    • js/style/styledeclaration.js
      • Change the structure of the javascript parsing engine to reflect multiple renamed keys
      • Change linear function to take a dictionary of parameters instead of an array
      • Change exponential function to take a dictionary of parameters instead of an array
      • Change how the min() and stopsFn() functions work
    • js/style/styletransition.js
      • Change how the interpolation of opacity, colors, line parameters, point parameters and raster parameters works for style transitions
    • js/text/placement.js
      • Change path to text-path
      • Change padding to text-padding
      • Change maxAngleDelta to text-max-angle
      • Change textMinDistance to text-min-distance
      • Change rotate to text-rotate
      • Change fontSize to text-max-size
      • Change alwaysVisible to text-always-visible
    • js/ui/geojsontile.js
      • Change how filtering works for feature types
    • js/ui/map.js
      • Change color to fill-color
    • js/worker/worker.js
      • Change how bucket filtering works
    • js/worker/workertile.js
      • Change how features are sorted out of tile layers into buckets
    • test/styledeclaration.test.js
      • Change width to line-width

... and potentially also this:

I want to merge this with #140 and see how close that comes to fixing things, but after that I'm probably going to need help to get it working right.

/cc @edenh @kkaefer @ansis @mourner @incanus @nickidlugash

@ghost

ghost commented May 22, 2014

Copy link
Copy Markdown
Author

@ghost

ghost commented May 22, 2014

Copy link
Copy Markdown
Author

I'm working on merging master (including the #140 merge) into this branch.

@ghost

ghost commented May 22, 2014

Copy link
Copy Markdown
Author

I merged master, including #140 nested layers, into this branch. There was no visual change, but now I'm getting lots of errors like this:

[WARNING] layer 'admin' does not exist in source 'outdoors'
[WARNING] layer 'aeroway' does not exist in source 'outdoors'
[WARNING] layer 'barrier_line' does not exist in source 'outdoors'
[WARNING] layer 'bridge' does not exist in source 'outdoors'
...

I think that's progress. It looks to me like I've probably omitted some critical step of porting the v0 to v1 style format change, but I'm not sure what that would be.

/cc @edenh @kkaefer @mourner

@ghost

ghost commented May 22, 2014

Copy link
Copy Markdown
Author

The master branch using the v0 outdoors style is giving pretty similar warnings about layers not existing, and it's drawing a decent map, so I don't thing that's the problem. Hmm...

This is an example of the errors from master by way of make iproj:

[WARNING] there is no layer associated with 'landuse_snow'
[WARNING] can't find class named 'contour_label' in style
[WARNING] layer 'landuse' does not exist in source 'outdoors'
[WARNING] layer 'landuse_overlay' does not exist in source 'outdoors'
[WARNING] layer 'waterway' does not exist in source 'outdoors'
...

and this is what I got with a make xproj:

[WARNING] there is no layer associated with 'landuse_snow'
[WARNING] can't find class named 'contour_label' in style
[WARNING] layer 'landuse_overlay' does not exist in source 'outdoors'
[WARNING] layer 'barrier_line' does not exist in source 'outdoors'
[WARNING] layer 'aeroway' does not exist in source 'outdoors'
...

In both cases, I processed the console log with a text editor to remove duplicate warnings along with some stuff about sprites and fps measurements.

@ghost

ghost commented May 23, 2014

Copy link
Copy Markdown
Author

I made some major improvement with 6918752 so that now feature_type will get set properly for buckets which have a type and include a filter object which does not specify a feature_type. The new behavior in that case is to use the bucket's feature type for the filter too.

Making the feature_type detection change caused a whole bunch of road and building stuff to show up like magic, and I'm still using an out of date copy of mapbox/gl-style outdoors-raw.js. Next up is to see what happens when I use the scripts to convert the current v0 outdoors style to -v1, then -raw.

@ghost

ghost commented May 23, 2014

Copy link
Copy Markdown
Author

Need to figure out why zero text labels are showing anywhere.

@ghost

ghost commented May 23, 2014

Copy link
Copy Markdown
Author

Just updated the old style I was testing with to use a v0 -> v1 -> raw migrated version of the latest style.js (outdoors) from master.

It's still messed up. Labels are missing, and all the fills and lines seem to be drawn with 100% opacity. It's also possible that things are not colored the way they are supposed to be.

@ghost

ghost commented May 23, 2014

Copy link
Copy Markdown
Author

Replacement of constants is definitely broken... digging to figure out why. Actually, replaceConstant(...) seems to be working fine. I just didn't understand what it was supposed to do.

@ghost

ghost commented May 23, 2014

Copy link
Copy Markdown
Author

Making major progress, here's what the code I'm getting ready to commit looks like:

screen shot 2014-05-23 at 12 13 50 am

Main broken things which are immediately obvious:

  • The rendering for line-opacity is broken. If I turn it on, the map looks much worse
  • Labels are still missing

@kkaefer

kkaefer commented May 23, 2014

Copy link
Copy Markdown
Member

@wsnook I added the warnings as a debugging aid, to spot errors in styles early on. However, not all tiles contain all layers (they might be empty). In those cases, you can just ignore the warnings.

@ghost

ghost commented May 23, 2014

Copy link
Copy Markdown
Author

@kkaefer Thanks. I found the constants to turn those on and off, and they are definitely useful at times.

I added the warnings as a debugging aid

If you have some time, could you maybe take a look at the code I've got and see if you can find an obvious reason why the opacity for fills and lines is not working correctly. It seems like everything is drawing opaque, or not drawing at all. There should be blending, but somehow I seem to have broken it.

@ghost

ghost commented May 23, 2014

Copy link
Copy Markdown
Author

@incanus @edenh @kkaefer tl;dr New style format isn't happening this week (i.e. today), but having it done by Wednesday still seems like a realistic possibility.

For a bit more detail, I was looking a bit just now at what will be involved to merge Justin's style transition code stuff from yesterday into the new style format branch... it looks like there will be some pretty major conflicts which will take time to sort out. There are also some key broken things which I need to track down with the v1 style format (labels, opacity / blending of layers). I'm expecting the fixes might be one-liners, but finding which lines will be some work.

Conflicts:
	bin/style.js
	src/shader/shaders_gl.cpp
	src/shader/shaders_gles2.cpp
	src/style/style_parser.cpp
@kkaefer kkaefer closed this Jul 7, 2014
@kkaefer
kkaefer deleted the issue172-newstyle branch July 7, 2014 16:33
acalcutt pushed a commit to acalcutt/mapbox-gl-native that referenced this pull request Apr 30, 2022
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.5 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](node-fetch/node-fetch@v2.6.5...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

2 participants