In Leaflet map I want to have like you see above an OSM baselayer with only one country the rest of the world has to be just a blank, only with international border. How can we create this? which URL of tillelayer give us this result?
-
4you will need your own tile server github.com/gagan-bansal/osm-for-my-country– Mapperz ♦Jan 26, 2021 at 14:26
-
1From @TomazicM: OpenStreetMap is open vector map data set (see openstreetmap.org/copyright), that can be used by anyone. OpenStrreetMap tiles is a tiled raster map, created from OpenStreetMap data, and intended exclusively for testing, not for production (see operations.osmfoundation.org/policies/tiles). There are vector subsets for individual countries (see download.geofabrik.de), but you would need a server to deploy them. There's plenty of other maps, based on OpenStreetData, and for that you should ask on OpenData SE opendata.stackexchange.com.– Aaron ♦Jan 26, 2021 at 16:22
Add a comment
|
1 Answer
There is a Leaflet plugin that lets you mask a tile layer:
https://github.com/aparshin/leaflet-boundary-canvas
The demo shows a region around Moscow:
http://aparshin.github.io/leaflet-boundary-canvas/examples/canvas-boundary-providers.html
but notice how labels get cropped at the edges:
-
This is much easier than the first method ! but the first method of having their own server is the one used on the example of my question Jan 26, 2021 at 14:47