-
Notifications
You must be signed in to change notification settings - Fork 125
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
[BUG] Symbols with textFields added via the AnnotationManager don't show up on the map when using a custom glpyh source #466
Comments
It's not really possible to reproduce this behavior with the given information. All in all however I'd assume that it's a problem with your style json and not this package. Some ideas for debugging:
Closing this issue for now. We can reopen it if we get further information that make it possible to reproduce the problem (e.g. the information from my suggested steps). |
Related discussion here: https://osmus.slack.com/archives/C05J5FMH7JN/p1718870901513139?thread_ts=1718800634.449629&cid=C05J5FMH7JN The bug only happens on ios and web, while android works like expected. flutter-maplibre-gl/maplibre_gl/lib/src/annotation_manager.dart Lines 296 to 308 in e84442c
If the map style uses a different glyph source it is not guaranteed that these fonts are available. This shows up as a 404 in the network logs of the dev tools (here for web): |
I'm encountering the same issue on web (at least, haven't tried the other platforms yet). I'm using this style string: EDIT: Someone had the same problem before: hyperknot/openfreemap#10, in a slightly different situation though. I tried forking and I tried to set the default to Is there a workaround? |
Ok, I found a workaround. It's not pretty. I downloaded the "text-font": {
type: "array",
value: "string",
default: ["Noto Sans Regular"],
requires: ["text-field"],
expression: { interpolated: !1, parameters: ["zoom", "feature"] },
"property-type": "data-driven",
}, And I now served this modified file from my index.html file |
Related discussion: maplibre/maplibre-gl-js#4820 |
Platforms
all
Version of flutter maplibre_gl
0.20.0
Bug Description
Whenever I pass a textField parameter to the
SymbolOptions
, the related symbol is not visible on the map at all. When I removetextField
, it appears correctly with my custom icon. This happens only when I connect to my local maptiler server (http://localhost:3650/api/maps/basic/style.json).This server is configured in a basic way, as in the documentation. I'm using
maptiler-server-map-styles-3.14.1
with the map replaced to British Isles, but that doesn't seem to matter because the map renders correctly.If I only change a line of code:
const styleUrl = 'http://localhost:3650/api/maps/basic/style.json';
to:
const styleUrl = 'https://api.maptiler.com/maps/streets-v2/style.json';
then Symbols start showing up with both icons and names.
I've tried to provide
fontNames
parameters to symbol options and use some fonts that I can find in a subfolder of themaptiler-server-map-styles-3.14.1
, like:fontNames: ['Roboto Medium']
(I also tried: 'Noto Sans Regular', 'Roboto Condensed Regular', etc.) but this didn't fix the issue.Steps to Reproduce
As described above
Expected Results
The Symbols show up with icons and text fields
Actual Results
The Symbols are not visible when the textField parameter is provided
Code Sample
The text was updated successfully, but these errors were encountered: