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

transitive overlay uses fonts which might not be available on the tile server (leg geometries are sometimes not displayed / incomplete / rendering glitch?) #778

Closed
amenk opened this issue Feb 5, 2023 · 13 comments
Assignees

Comments

@amenk
Copy link

amenk commented Feb 5, 2023

We are using OTP react redux in the dev branch with vector tiles.

The trip leg geometries are not displayed reliably. Tested in a recent Chrome and Firefox browser.

image

The green part is added for illustration - here the blue line is missing.

However, when zooming in the part appears:

image

When zooming out, other parts disappear.

Is this a known issue? I could not find similar issues in the search.

@miles-grant-ibigroup
Copy link
Collaborator

I have yet to see this issue! It might be a priority issue with the tiles? We use default priority on the custom overlays, but your tiles may have something else set to a higher priority? This is my only guess as to what could be going on. We have never seen this before.

@miles-grant-ibigroup miles-grant-ibigroup self-assigned this Feb 6, 2023
@amenk
Copy link
Author

amenk commented Feb 6, 2023

@miles-grant-ibigroup okay, thanks. That could be it.

Do you have a hint how those priorities can be checked?

For the record: We use https://africa.tiles.openplaceguide.org/ ( a makinamaps instance) on https://web.addismaptransit.com where we spot this issue.

@miles-grant-ibigroup
Copy link
Collaborator

I wish I knew enough about MapLibre to tell you... I do know that if you peek at the transitive overlay you'll see where we define the layers and in that React layer component you should be able to set a priority or importance or similar. Hopefully that fixes things for you! I think we'd accept that change as well, since it would increase the layer's compatibility with different base tiles!

@amenk
Copy link
Author

amenk commented Feb 6, 2023

@miles-grant-ibigroup
Copy link
Collaborator

miles-grant-ibigroup commented Feb 6, 2023

Yes this is what I was thinking of! Thanks for figuring that one out. Please let me know if this fixes the issue for you!

@amenk
Copy link
Author

amenk commented Feb 11, 2023

@miles-grant-ibigroup which vector tile provider are you using in your installations where this is working?

I tried a some things, for example adding

"line-sort-key": 1000000 

here https://github.com/opentripplanner/otp-ui/blob/2f45f1e2369ff1d78028a0936776c182928dc578/packages/transitive-overlay/src/index.tsx#L259

but no effect.

It looks like the Canvas is hard to debug, a while ago Chrome and Firefox had Canvas debuggers but they were all removed.

The layers at transitive overlay all don't define any priority, so I believe everything should equally be displayed on top of the base map. Maybe this is a bug in Maplibre GL?

@amenk
Copy link
Author

amenk commented Feb 12, 2023

Asked over there: maplibre/maplibre-gl-js#2172

@amenk
Copy link
Author

amenk commented Feb 12, 2023

Okay, not a bug in maplibre-gl-js :)

The overlay generated by OTP-ReactRedux requests "text-font": ["Open Sans Bold", "Arial Unicode MS Bold"], which is not available on the tileserver we use, this caused the hick-ups in the rendering. If I use a font which is present on the server, it works flawlessly.

https://github.com/opentripplanner/otp-ui/blob/2f45f1e2369ff1d78028a0936776c182928dc578/packages/transitive-overlay/src/index.tsx#L73

there is also a fixme there - so we actually should use a fond which is available on the tile server or make this configurable?

@amenk amenk changed the title leg geometries are sometimes not displayed / incomplete / rendering glitch? transitive overlay might use fonts which are not available on the tile server (leg geometries are sometimes not displayed / incomplete / rendering glitch?) Feb 12, 2023
@amenk amenk changed the title transitive overlay might use fonts which are not available on the tile server (leg geometries are sometimes not displayed / incomplete / rendering glitch?) transitive overlay uses fonts which might not be available on the tile server (leg geometries are sometimes not displayed / incomplete / rendering glitch?) Feb 12, 2023
@amenk
Copy link
Author

amenk commented Feb 12, 2023

There is already a config option for the font:

  transitive:
    styles:
      labels:
        font-family: Hind, sans-serif

# font-family: Hind, sans-serif

But I think this is not used - maybe this is from pre-vectortiles-times?

@amenk
Copy link
Author

amenk commented Feb 12, 2023

I was able to solve this using serveAllFonts (maptiler/tileserver-gl#391)
Even I cannot add the Arial Unicode MS to the tile server, because it's a licensed font (openmaptiles/fonts#1) it is not really necessary. The fontstack fallback will just serve Open Sans. It did not do this before because - I believe - it's not used in the base map'S styles. But the serveAllFonts option fixes that.

@amenk amenk closed this as completed Feb 12, 2023
@miles-grant-ibigroup
Copy link
Collaborator

Thanks for all your detailed reporting! We'll try to set some more sensible defaults in the example config! Please let us know/open a PR if there's any other changes you think might be sensible!

@amenk
Copy link
Author

amenk commented Feb 15, 2023

Unfortunately the used font face seems to be not configurable at the moment.

@miles-grant-ibigroup
Copy link
Collaborator

Ah that makes sense good to know -- the long term plan is to fully transition https://github.com/conveyal/transitive.js/ to MapLibre. We'll keep this in mind for when this happens!

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