publicmap / legacy

An open map by the public, for the public.

Home Page:https://publicmap.github.io/legacy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Multilingual option would be great

geochetan opened this issue · comments

With minimal effort it will be possible to add a switcher for the languages that the Mapbox tiles already support: local + 9 languages https://www.mapbox.com/vector-tiles/mapbox-streets-v7/#overview

Code: https://www.mapbox.com/mapbox-gl-js/example/language-switch/

Switching the language to any arbitrary name:code OSM tag in the browser will be much harder and is an unsolved challenge

The multilingual http://openstreetmap.in/demo required creating a custom tileset that included the multilingual name tags from OSM. This can work as a one time process, but it will be really hard to keep this tileset in sync with OSM as more translations are added.

A possible solution is to query overpass publicmap/publicmap.github.io#7 and dynamically create a geojson layer with objects with name:code that can be used to render the translations. This is practical at high zoom levels, but the query would fail at a country level scale.

cc @SrihariThalla

@planemad Is it possible to add custom name_* fields for tiles in Mapbox Studio? If not, generating (and re-using OSM.in) tilesets is the only option for now. We could definitely start with reusing them!

Overpass is just not feasible as

  • The Map has to cache translated names as it doesn't want to query again if the zoom changes
  • The places are just too countless for an in-browser cache
  • We certainly don't want to block [DoS] Overpass servers with our requests if there are many concurrent users scrolling/ zooming/ panning through the map!

@chtnha How often do you guys generate the tilesets in the languages displayed on OSM.in site?


On a side note, is it just me or you observe it too?
screenshot 2017-06-01 10 45 45

The names are to be rendered as "భారతదేశం", "హైదరాబాద్", ...

Also the first Kannada world map by @yogiks http://yogiks.github.io/osm-kn/map/

Tamil Map
The names are to be rendered as "భారతదేశం", "హైదరాబాద్", ...

It seems like Mapzen tiles and renderer are more suited for making multlingual maps compared to Mapbox. They expose all OSM tags (correct @srikanthlogic ?) and the tangram GL renderer supports complex text shaping for linear labels which has not landed in Mapbox GL mapbox/mapbox-gl-native#7774. There is complex text shaping for the raster Mapbox tiles though.

Tracking similiar ticket for multilingual maps on openstreetmap.in osm-in/osm-in.github.io#14

Is it possible to add custom name_* fields for tiles in Mapbox Studio? If not, generating (and re-using OSM.in) tilesets is the only option for now. We could definitely start with reusing them!

No, the default Mapbox tiles cannot be modified. Creating custom tiles is the only option. Tools to use for this:

  • osmlazer for .osm.pbf -> geojson of required features
  • tippecanoe for geojson -> mbtiles to upload to Mapbox

It seems like Mapzen tiles and renderer are more suited for making multlingual maps compared to Mapbox. They expose all OSM tags (correct @srikanthlogic ?)

Yes, Mapzen tiles include all OSM tags and all one needs to take care is styling and data.

and the tangram GL renderer supports complex text shaping for linear labels.

They also added support for curved labels a while back but havent tested it much though.

commented

Hey

I randomly got to this issue in my quest for something else, but being on the tangram team I can confirm the above from @srikanthlogic. We do have support for curve labels for all scripts except for Mongolian. If you have further questions on it, feel free to ping me or anyone on tangram gitter channel.