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

OpenMapTiles 3.13 Features: Highway shields, Interstate filtering #72

Merged
merged 104 commits into from Jan 26, 2022

Conversation

ZeLonewolf
Copy link
Owner

@ZeLonewolf ZeLonewolf commented Jan 2, 2022

Fixes #6
Fixes #69
Blocked by openmaptiles/openmaptiles#1287 Update: OpenMapTiles 3.13 is released, MapTiler Cloud planet update is expected during the week of Jan 10, 2022.
Blocked by maplibre/maplibre-gl-js#188 with pending fix maplibre/maplibre-gl-js#716. However, we can proceed with a development version of maplibre taken from that branch until it's released.

Description

This branch contains work that is dependent on the upcoming release of OpenMapTiles 3.13. This description will be updated over time with screen shots of the pending features. PRs that are dependent on OMT 3.13 can be posted to this branch. This PR will be kept in a "draft" status until OMT 3.13 is released.

Features included in this branch:

  • Concurrent highway shields, with partial state-specific shield implementations for several states. This change removes the import of shield graphics from rebusurance in favor of style-specific shields.
  • Suppress non-interstate motorways from the lowest zoom
  • Wider shields and/or text scaling for longer refs
  • Ability to re-color a base shield, such as US:US:Historic shields or Georgia ADHS state routes

The following features are incomplete:

  • Complete implementation of state-specific shields
  • Highway shields outside of the US

Caveats

  • This branch includes a development version of maplibre-gl-js taken from Shield rotation maplibre/maplibre-gl-js#716, which is incompatible with the license of openstreetmap-americana. This must be resolved prior to merging. (Resolved)
  • Padding is needed between adjacent concurrent shields. Due to issues with front-end rendering, this needs to be implemented as a perimeter pad on generated shield imagery.

How to run this branch

  1. Clone the current master of OpenMapTiles from https://github.com/openmaptiles/openmaptiles
  2. Modify .env to set the desired zoom level to render to (defaults to 7, can go as high as 14)
  3. Run ./quickstart <name of area> to generate vector tiles (for example, ./quickstart rhode-island)
  4. Run make start-tileserver which starts a tile server on localhost:8080
  5. In openstreetmap-americana, create a config.js that looks like this:
const OPENMAPTILES_URL = `http://localhost:8080/data/v3.json`;
export default {
  OPENMAPTILES_URL,
};
  1. Run make run to run the style

Screen shots

Zoom 4 Interstate-only map of the US
image

Multiple-widths of highway shields (Interstates)
image

Highway shields, California
image

Highway shields, Minnesota
image

Highway shields, Pennsylvania
image

Highway shields, South Carolina
image

Highway shields, Vermont
image

Highway shields, Virginia
image

Triple-modifiers on US-30 in Pennsylvania
image

Test Areas (localhost-referenced):

@ZeLonewolf ZeLonewolf force-pushed the openmaptilers-new-features-test branch from 9aef2d8 to 888d5ed Compare January 2, 2022 19:15
style/index.html Outdated Show resolved Hide resolved
@ZeLonewolf ZeLonewolf mentioned this pull request Jan 4, 2022
@ZeLonewolf ZeLonewolf marked this pull request as ready for review January 5, 2022 12:27
@jleedev
Copy link
Collaborator

jleedev commented Jan 5, 2022

I'm getting very small fonts at 100% zoom:

Screenshot 2022-01-05 11 01 32

Looks ok at >100% zoom:

Screenshot 2022-01-05 11 01 39

@ZeLonewolf
Copy link
Owner Author

I'm getting very small fonts at 100% zoom:

Good catch, looks like I used px on the fonts which needs to get the multiplier applied.

Copy link
Collaborator

@jleedev jleedev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General questions:

  • Banners (TRK) seem to be commented out.
  • Font sizes are all over the place. For instance, the PA keystone text is larger than others. Perhaps a maximum size based on certain common shields could help, e.g. no larger than the one used on Interstate/US routes?

Comment on lines 158 to 162
/*
if (typeof shieldDef.modifiers !== "undefined") {
c = drawBanners(c, shieldDef.modifiers);
}
*/
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are banners still a work in progress then?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah, I forgot about those.

style/js/shield.js Outdated Show resolved Hide resolved
style/layer/highway_exit.js Outdated Show resolved Hide resolved
style/layer/highway_shield.js Outdated Show resolved Hide resolved
@zekefarwell zekefarwell linked an issue Jan 26, 2022 that may be closed by this pull request
Copy link
Collaborator

@zekefarwell zekefarwell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Lets go! 🤠

@zekefarwell zekefarwell linked an issue Jan 26, 2022 that may be closed by this pull request
@ZeLonewolf ZeLonewolf merged commit 864b3a6 into main Jan 26, 2022
@ZeLonewolf ZeLonewolf deleted the openmaptilers-new-features-test branch January 26, 2022 02:16
This was referenced Mar 12, 2022
@Pengor Pengor added this to the 1.0.0 milestone Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
7 participants