-
Notifications
You must be signed in to change notification settings - Fork 936
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
Add OpenMapTiles vector map #4042
base: master
Are you sure you want to change the base?
Conversation
I thought we had agreed that adding support for vector tile layers should be separate from adding any specific layer - certainly at the least I'd like them to be separate commits. The API key should probably be in the configuration file as well, as with the thunderforest layers, rather than hardcoded. What are all the 3D terrain bits about? |
Support for vector tiles is actually just adding If you agree, I can prepare such PR.
I'll look at it.
It is a link to a demo site that shows full capability of vector maps (map rotation, animation, 3D terrain) which is not possible with Leaflet and maplibre-gl-leaflet library. |
So are you actually adding two layers here then? The main vector tiles layer and the 3D one? Only the 3D one doesn't seem to be global so I don't think it's going to pass OWG review. I can't look at the other one because it's not actually working currently. |
This PR adds only one layer - vector map with carto-like style. Most of the code is actually about updating the link URL in the attribution of this map so that it would point to the same view of the external 3D map demo. |
You can see it live at http://osm.openmaptiles.org/ |
Ah yes it does work over HTTP but all the other links were HTTPS which doesn't work. I think the 3D stuff should be separated out - most of the code is only actually there to do that I think and I think that's going to be a lot more contentious that the rest of it. |
Do I understand correctly that the issue we are talking about is the "3D map ⛰️." link in the footer? We added it there to allow visitors to see the OSM in 3D. We would love to have it directly on osm.org. However, it is not technically possible because the site runs on Leaflet. Therefore, we added it at least as an external link. |
Yes that's what I'm talking about - it wouldn't be acceptable as a layer on the site anyway as it doesn't appear to cover the whole world and I think that also makes linking to it questionable which is why I'd rather separate that decision/discussion from the question of adding the vector tile layer to the site. |
Can you please report an area that is missing terrain/map? Because I am checking it on my side and the coverage is global - even in the remote places. |
Maybe I just don't understand how to operate it then... I clicked the bottom button to switch back to 2D mode, panned to my home area, then tried to switch back to 3D mode by pressing the same button again and nothing happened. Specifically I was looking at https://labs.maptiler.com/showcase/osm-3d-terrain/#style=openstreetmap&lang=en&mode=3d&position=15.46/51.76264/-0.00868 which is 2D and I can't find any way to switch to 3D there? |
Oh if I hold on that button and move my mouse I can make it tilt and pan... |
You can also drag the map with the right mouse button, or with Ctrl key pressed. Anyway, that area is not very hilly. |
Great to see progress on this, thank you for the PR.
This is great! Do you have any guidance for us as to how it handles regional languages, e.g. I want to make sure that the translations work for all of the languages that our user interface works in, hopefully so that there's no mismatch between what you can pick in the UI and what then happens with this layer. I also noticed on the wiki that it says "map labels translations from Wikidata" - can you clarify this? How does this interact with the translated labels available in OSM? If a contributor spots a mistake on the map, can they edit OSM to fix it, or do they have to edit something on Wikidata?
I don't think the layer attribution is the right place for linking to external sites to view other renderings. If we want to link to external sites to view other renderings, which haven't been through the new layer approval process, then let's discuss this separately. And if we want to adapt the site to support alternative (i.e. non-leaflet) tech, then let's discuss that separately too. But I don't think such links should be part of the attribution for another layer, and I definitely don't think that should be part of this PR. |
Supported languages of OMT are documented at https://docs.maptiler.com/schema/planet/#languages Comparison
Currently if the language is not supported then local language is used - same as on Carto map - value from the
I will discuss it with my team. In any case current implementation doesn't fallback to the other languages in the list but I will implement it into this PR. Also falling back to main locale if sub-locale is not available (
We have decided to use names primarily from wikidata because there are more translations than in OSM. If the name is not in wikidata then one from OSM is used.
We will adjust it in this PR. |
What about when the language of the name tag is in a script Maplibre does not support? |
Not sure if I understand you correctly, but for unsupported languages their local If you meant something else then please give me some example. You can try switching to (unsupported) language by setting it as primary in your browser (until I add a fallback to other languages your browser accepts - then try just with a single language configured). |
Meanwhile I have removed 3D map link in the attribution. |
done |
@tomhughes The map is 3D, but London is rather flat, sending better position: As metioned, you hold Ctrl key and can change the view angle. |
Maplibre doesn't support some scripts (e.g. Burmese, Lao, and other Brahmic scripts), so it can't display the local name. |
That's not exactly accurate. The issue is that MapLibre doesn't support ligatures and combining characters correctly, and instead displays them anywhere from slightly to terribly wrongly. However, OSM-Carto also renders some of these scripts wrongly as the examples below will show (and should probably be documented if they're not already). Whether the "wrong" rendering makes the label unreadable or just slightly off will depend heavily on the script involved, and in my experience, it's the worst in Right-to-Left scripts. This is what MapLibre displays for the United States label, in Lao: However, it is supposed to look like this: The issue is that the squiggly line above the second-to-last character is supposed to be directly over it, not off to one side. This issue is pervasive across all ligature/combiner scripts. While a Lao reader might still understand the script above, it would definitely look wrong, and this problem in other scripts results in mangled text that's absolutely unreadable to native speakers. This is something which has always been broken in mapbox-gl and is a high priority for maplibre-gl to get right, and it's documented in maplibre/maplibre#193. Examples of rendering the Lao capital of Vientiane, which should appear in local script as: ວຽງຈັນOSM Americana (based on MapLibre): However, looking at these examples, it seems that osm-carto isn't actually any different from what MapLibre is producing. Both MapLibre and osm-carto have the same issue with the diacritic being shifted to the right slightly. Let's take a look at Kathmandu, Nepal, which is supposed to appear as: काठमाडौँMandalay, Burma, perhaps? Should be: မန္တလေးBurmese is where we really start to see the problem, with that infinity-sign looking diacritic that's supposed to be under the second character coming in rather mangled. However, OSM-Carto also gets it slightly wrong by jamming the ligature up into the character when there's supposed to be space between them. |
It seems that this new vector map does not handle the display of Chinese very well. It displays the Traditional and Simplified varient at the same time, because a DWG member Even if I forcibly specify locale=zh-TW, the name:zh value mixed with various variants will still be preferred as the display label text |
Re "... because a DWG member ... combined the two variants in name:zh" that sounds like a tagging issue that's best discussed elsewhere - perhaps somewhere at https://community.openstreetmap.org/ ? |
Yes, use variants combined value is a tagging issue, we can discuss in other places. Whether this kind of edit is reasonable will not be discussed on this github issue @SomeoneElseOSM My reply is about vector map's label text( |
style: "https://api.maptiler.com/maps/openstreetmap/style.json?key=" + OSM.MAPTILER_KEY | ||
}, | ||
onAdd: function (map) { | ||
var supportedLanguages = "am,ar,az,be,bg,br,bs,ca,co,cs,cy,da,de,el,en,eo,es,et,eu,fi,fr,fy,ga,gd,he,hi,hr,hu,hy,id,is,it,ja,ja_kana,ja_rm,ja-Latn,ja-Hira,ka,kk,kn,ko,ko-Latn,ku,la,lb,lt,lv,mk,mt,ml,nl,no,oc,pl,pt,rm,ro,ru,sk,sl,sq,sr,sr-Latn,sv,ta,te,th,tr,uk,zh".split(","); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name:ja_kana
and name:ja_rm
are both documented on the wiki as being deprecated, although they are still in use to some extent. Is it a good idea to support these nonstandard language codes as part of the website?
style: "https://api.maptiler.com/maps/openstreetmap/style.json?key=" + OSM.MAPTILER_KEY | ||
}, | ||
onAdd: function (map) { | ||
var supportedLanguages = "am,ar,az,be,bg,br,bs,ca,co,cs,cy,da,de,el,en,eo,es,et,eu,fi,fr,fy,ga,gd,he,hi,hr,hu,hy,id,is,it,ja,ja_kana,ja_rm,ja-Latn,ja-Hira,ka,kk,kn,ko,ko-Latn,ku,la,lb,lt,lv,mk,mt,ml,nl,no,oc,pl,pt,rm,ro,ru,sk,sl,sq,sr,sr-Latn,sv,ta,te,th,tr,uk,zh".split(","); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This list doesn’t include the languages added to OpenMapTiles openmaptiles/openmaptiles#1477, including zh-Hans
and zh-Hant
. I assume that’s because the MapTiler-hosted tiles are on OpenMapTiles v3.14, whereas this change is still waiting to be released. Is there a way to automate this list so that the website maintainers won’t have to remember to update it based on OpenMapTiles’ release schedule and MapTiler’s upgrade schedule?
To be clear what languages are used in OSM tags are not directly relevant here - this is a mapping from web site locales to locales used by this layer. How the layer maps from OSM tags to it's supported languages is a matter for the layer and the tools used to generate it's tiles from the OSM data. |
Understood, but those OpenMapTiles properties are directly tied to the deprecated OSM keys, so it would essentially be a way to enable OSM users to enter nonstandard codes in OSM preferences to see those tags’ value. (As far as I can tell, your language preference can include language codes that the website has no localization for.) I guess it’s fine if these nonstandard codes end up being an obscure, undocumented edge case, but if they do get used, then that would be problematic for other components that rely on this same preference for localization, such as iD. |
I see on their own demo that they could correctly handle different Chinese variants (attach sample is Simplified Chinese only demo with 'zh-CN' browser setting). It seems that they do not explicitly document this. If it is possible to support |
@@ -11,6 +15,40 @@ L.extend(L.LatLngBounds.prototype, { | |||
} | |||
}); | |||
|
|||
if (OSM.MAPTILER_KEY) { | |||
L.OpenMapTiles = L.MaplibreGL.extend({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Arabic and Hebrew would be broken unless this code also installs the right-to-left text plugin. (Note that it only supports these two languages, not other languages in the same scripts or other right-to-left scripts.)
That’s the case we’re talking about here, if I’m not mistaken.
Let’s not turn this PR into a detailed rundown of Wikidata’s faults, as though the style brings in more Wikidata content than it actually does. Besides, Google Maps uses Wikidata for labels, not the other way around. |
In the recent release of OpenMapTiles 3.15, the Wikidata translations have been switched off: https://maptiler.com/news/2024/04/openstreetmap-data-prepared-for-advanced-cartography/ Are there any other blockers for accepting this PR? |
Can we test the current state somewhere? |
@tordans https://osm.openmaptiles.org/ - I've just started it again. |
Can the language selector be added as a combobox at the map layers panel? Would be more discoverable and selectable for users without osm account. |
There are already separate issues for adding a language selector for non-logged in users. |
Is it possible to disable automatic transliteration of non-Latin names? |
I think it is fine? In the same way as it would be fine to host nondefault layer showing names in Korean/Polish/Japanese? |
Any resolution regarding this PR? Can we have this PR merged and closed, I believed, we addressed the concerns and issues of the community. |
New layers are approved by the Operations Working Group, which has not happened yet. It was last discussed at their May meeting. I do not see that it has been on an OWG meeting agenda since. |
This PR was discussed at the 10/31 OWG meeting according to the public minutes. |
Commits such as "fix lint issues" 8887671 shouldn't exist, see CONTRIBUTING.md#pull-requests |
This is awaiting a response from MapTiler |
Still has "fix lint issues". |
This pull request adds OpenMapTiles vector tiles among the featured layers. To ensure compatibility with the current stack based on Leaflet, it uses maplibre-gl-leaflet binding.
The main advantage for users is support for labels in multiple languages: users can easily switch by changing language preferences in settings.
An official email with a link to this PR was sent, together with an edit of the “Featured tile layers” wiki page.