You are not logged in.
- Topics: Active | Unanswered
Announcement
Please create new topics on the new site at community.openstreetmap.org. We expect the migration of data will take a few weeks, you can follow its progress here.***
Pages: 1
#1 2021-06-08 20:35:06
- Buraq911
- Member
- Registered: 2021-06-08
- Posts: 5
Offline hosting using openlayers
Hi everyone
I am really new on this!
I have developed a tracking web-based application using openlayers and OSM. Everything is working fine
Now I need to make the application works offline i.e. host certain country map on my local server. I downloaded .OSM data for the required country.
My questions:
1- How I will render and host this data?
2- How I should included the hosted map in my code?
It may be very easy and basic to most of you guys, but I am struggling on this!
I do appreciate your help!
Thanks,
Buraq
Offline
#2 2021-06-10 20:50:25
- stephan75
- Member
- Registered: 2008-05-28
- Posts: 2,918
Re: Offline hosting using openlayers
Do you want to store bitmap tiles or vector tiles on your server?
What data storage, CPU and RAM size do you have on your local hardware in detail?
What are your results when you browse the OSM wiki for "Tiles" or "Vector Tiles" or "Rendering"?
Offline
#3 2021-06-11 11:44:25
- Buraq911
- Member
- Registered: 2021-06-08
- Posts: 5
Re: Offline hosting using openlayers
Hi Stephan,
Thanks for your replay,
I want to use vector tiles.
My server is: 500 GB, RAM 4G, Intel(R) Core(TM) i5-3210M CPU @ 2.50GHz, 2501 Mhz, 2 Core(s)
I have not found a detailed results.
I appreciate your help.
Cheers,
Buraq
Offline
#4 2021-06-11 12:58:42
- SomeoneElse
- Member
- Registered: 2010-10-13
- Posts: 1,601
Re: Offline hosting using openlayers
There's quite a lot of stuff at https://switch2osm.org/serving-tiles/ . If the country that you're talking about is the one that I think that it is (about the same size as Scotland in OSM terms) then your 4Gb server should deal with that OK. The tiles will be raster tiles (like the ones at OpenStreetMap), not vector, though. You can point OpenLayers at those tiles. An OSM tile has a URL like https://a.tile.openstreetmap.org/7/69/42.png . Your server will have a different URL; just use that when you set up the tile layer in OpenLayers.
If you absolutely want vector tiles have a look at https://openmaptiles.org/ - although it's not something that I've got a lot of familiarity with.
Offline
#5 2021-06-11 17:08:35
- Buraq911
- Member
- Registered: 2021-06-08
- Posts: 5
Re: Offline hosting using openlayers
Thanks a lot, I will have a look on what you mention.
Offline
#6 2021-06-11 17:23:47
- Buraq911
- Member
- Registered: 2021-06-08
- Posts: 5
Re: Offline hosting using openlayers
This https://switch2osm.org/serving-tiles/ for Linux only right? I am using windows.
Offline
#7 2021-06-11 20:09:45
- SomeoneElse
- Member
- Registered: 2010-10-13
- Posts: 1,601
Re: Offline hosting using openlayers
Here's a diary entry that I wrote earlier: https://www.openstreetmap.org/user/Some … iary/42617 . That was done with WSL1, but I'm sure it'd work with WSL2 as well. Also, I'm pretty sure that people have used https://switch2osm.org/serving-tiles/us … container/ on Windows.
Having said that however, is there a logical reason why you' want to use Windows for a tile server? You may of course have Windows-specific stuff in your main application, but you can view the tile server as a "black box" that just gives you tiles when you provide the appropriate URL.
Offline
#8 2021-06-11 21:00:01
- Buraq911
- Member
- Registered: 2021-06-08
- Posts: 5
Re: Offline hosting using openlayers
Yes, we do have some other functions that need to be done under windows - user requirements!
Offline
#9 2021-06-12 01:42:33
- Viajero Perdido
- Member

- Registered: 2016-10-13
- Posts: 194
Re: Offline hosting using openlayers
Or a virtual machine. You could host a Linux VM inside your Windows box. Same idea as Docker.
An idea... OSM is available in country-sized chunks as vector maps, MapsForge format, and there's a library for displaying the map directly, applying a theme to style the result as desired. This all fits in a phone. (In my phone's case, all of Western Canada, a huge place, offline.)
Maybe just maybe... Has anybody written a module to convert the output from this MapsForge library, for a given square, into a vector tile as requested above? Seems simple enough: convert a square of vector data from one format to another. It might be a path to a solution...
Last edited by Viajero Perdido (2021-06-12 01:46:59)
Offline
Pages: 1