3 ms·
There no frontend to bring up an OSM? Literally you need a single line to load one up: (new map('map_div')).addLayer(new TileLayer('http://{s}.tile.openstree
by soheil 4y ago
There no frontend to bring up an OSM? Literally you need a single line to load one up:
(new map('map_div')).addLayer(new TileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'))
- simon04 4y agoUsing tile.openstreetmap.org is subject to the OSM tile usage policy: https://wiki.openstreetmap.org/wiki/Tile_usage_policy https://wiki.openstreetmap.org/wiki/Tile_usage_policy
- soheil 4y agoTheir data is also subject to this policy: https://wiki.openstreetmap.org/wiki/OpenStreetMap_License https://wiki.openstreetmap.org/wiki/OpenStreetMap_License They also heavily discourage bulk downloading tiles so I'm not sure if you're that much better off building your own tile server.
- Aeolun 4y agoIf you are building your own tileserver then you take one of the OSM dumps for your area.
- ellenhp 4y agoTo add onto this, those are raster tiles and the industry is moving away from raster tiles for a multitude of reasons. Headway doesn't bulk-download tiles from OSM, by default it takes an OSM extract from BBBike (with explicit permission) and brings up a server based on that. It generates vector tiles with planetiler and serves them with tileserver-gl-light. I've put a lot of thought into the way it all works in an effort to minimize load on the OSM ecosystem's infrastructure, provide attribution where required, etc. I can promise you that there's no one-line replacement for the work I've done here unless you want to go out and pay for a closed-source product.
- stereo 4y agoNote that the {s} part is for backwards compatibility, and that https://tile.openstreetmap.org https://tile.openstreetmap.org is enough, or maybe even a tiny bit faster, now that we have http 2.