Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Contour Colors]: It would be great to be able to change the color of contours when inside a polygon #265

Open
fallaciousreasoning opened this issue Jul 30, 2024 · 1 comment

Comments

@fallaciousreasoning
Copy link

Sorry, filing this here as I didn't want to disrupt the spec discussion:

The raster topographic maps provided by the NZ government changes the color of contour lines to blue when inside a glacier.

image

I find this makes it much easier to distinguish the feature than what opentopomap and other vector tiles generally do (which is put a white polygon with a blue outline under the contours:

image
(it's hard to see, but this map actually has a bunch of glaciers marked)

I find this makes it much easier to quickly orient yourself (by the shape/amount of glacier cover) when zoomed out.

I was thinking of extending maplibre-contour to optionally take a polygon which it should only render contours within and then have two separate sources:

  1. Does the normal maplibre contour thing
  2. Downloads the Mapbox Vector Tile & DEM for the current point extracts the glacier polygons and clips the contour lines to be inside the glacier polygons.

Do you think upstream would be interested in this? Alternatively, I could see it working if there was some maplibre-gl expression for inside which takes another polygon on the tile, but I'm a bit of a maplibre noob, so dunno if they'd be interested.

@msbarry
Copy link
Contributor

msbarry commented Jul 31, 2024

You definitely could do something just for contours in the plugin or maplibre code when this gets merged, but this problem isn't unique to contour lines. What we really want is the ability to control how maplibre blends certain layers together so we could customize it to make glacier polygons change the color of contour lines they are above, and also so that regular contour lines show up consistently above different color backgrounds.

There has been a maplibre-gl issue for this open for a while: maplibre/maplibre-gl-js#48 but people really want it so there's also a $5k+ bounty associated with it: maplibre/maplibre#269.

Here's a blog post on the benefits this would add even for regular contour lines: https://oliverwipfli.ch/color-blending-of-contour-lines-2024-04-03/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants