About Western Morroco borders


Sorry but I would like to talk about this subject again : https://help.openstreetmap.org/questions/53812/contested-border-sahrawi-morocco-decision-to-display

I’m not contesting the decision nor approving it.
I just want to know if there is a feature like in Google Maps to choose whether or not to display parts of the map based on the users’ location.

Is there any ?


Yes, it would be possible for a map made with OSM data to do this - any map made with OSM data can decide what borders to show. I think that here pretty much all of the options are actually in the OSM data - Western Sahara for example is https://www.openstreetmap.org/relation/2559126 .

Different maps can display different boundaries - for example https://openstreetmap.in shows India’s claimed boundaries, which are different to India’s actual boundaries that you can see at https://www.openstreetmap.org/#map=4/24.13/67.68 .

Thank you for the reply.

My use case is for Moroccan people living in Morocco (or using a particular URL of OSM) to see the borders as their government recognizes them.

I’m a senior web developer but new to OSM ; where should I start to achieve this ?

The old diary entry by Arun (PlaneMad) may be able to help: https://www.openstreetmap.org/user/PlaneMad/diary/38176

See the bit in there that says “‘Fixing’ the boundaries of India”. In your case you’ll want to use https://www.openstreetmap.org/relation/13834513#map=5/28.614/-9.159 instead of https://www.openstreetmap.org/relation/3630439#map=5/28.246/-9.272 .

The way that you do that will depend on the method you’re using to create the map. If you were following https://switch2osm.org/serving-tiles/ to create the map using OSM’s “standard” map style you could modify one of the lua functions to do that - there are functions from https://github.com/gravitystorm/openstreetmap-carto/blob/master/openstreetmap-carto.lua#L285 downwards that get called every time something is updated.

Again, thank you very much.

The links you provided seem to be enough for me to start experimenting.
Let’s see what I can achieve… !