google-mapsmapboxmapzen

Dynamic place label filtering


I’m working on a map that shows local names and translated place names (e.g., “Deutschland” and “Germany”) at the same time. A very rough Mapbox prototype is posted at http://www.svexit.com/realnameatlas.html, but I’m open to trying this using Mapzen, Google Maps, or others

I’m trying to figure out if it’s possible / the best way to dynamically filter out place labels when they’re the same (e.g., “United Kingdom” in English is still “United Kingdom” or “Hamburg”, which doesn’t have a separate English translation, but has translations in Russian, French, Spanish, and Chinese). The goal is to leverage the existing translations and not maintain my own separate data set.

Thanks!


Solution

  • I believe this Mapzen blog post shows something similar here with Tangram:

    https://mapzen.com/blog/languages-of-india/

    Because the name data is processed as a JavaScript object, you should be able to filter out any duplicates before drawing the labels.