grafana / worldmap-panel

Worldmap panel plugin for Grafana 3.0 that can be overlaid with circles for data points.
MIT License
311 stars 199 forks source link

How I make it work offline ? #48

Open malkin13 opened 7 years ago

malkin13 commented 7 years ago

I need to run this plugin on a PC without Internet, and I think if you are using openstreetmap it is possible

daniellee commented 7 years ago

Interesting. I'd missed this before: http://osm2vectortiles.org/downloads/

Here you can download all the tile data. This might be plausible depending on what zoom level you want. All levels is 54 GB, from level 0-8 is 261 MB and level 0-5 is 10 MB. Unfortunately, even 10 MB is too large to include in the plugin. The mbtile format is basically an sqlite database and it seems you need a server to serve the map files.

You can build your own tile server: https://switch2osm.org/serving-tiles/building-a-tile-server-from-packages/ There are loads of servers, most seem to be dead projects though. These were the only active projects I found that serve mbtiles: http://tilestache.org/ and https://github.com/mapbox/mbview (I think this is just a viewer)

I did a quick test of mbview and it kind of worked but with some strange artifacts on the map:

image

So having an offline map is possible but I don't see any way to include all this in a Grafana plugin.

If someone has their own server serving maps, then it would be easy to add support in WorldMap to use that url instead of the free CartoDB maps currently being used.

Fox32 commented 7 years ago

A general way to provide a custom tile server url would be nice. That way one could use a different style or even a custom server in the local network.

daniellee commented 7 years ago

Would it be used though? I had loads of maps to choose between at the start but removed it and went with one suitable map for the dark theme and one for the light theme. Lots of maps looked really strange on a dark background. Extra options means more complications and there are a lot of options already.

Let me know (by +1:ing) and I can add it in again.

Fox32 commented 7 years ago

A custom url would also allow for a satellite view (#24) or even allow to display completely different data (e.g. gradient map)? But I have to admit that I currently don't have any use case.

samhatchett commented 7 years ago

+1 - for custom map url. My use case is that I want to display my own rendered content, which is a street map that includes other municipal infrastructure. Existing free map DBs don't include this content of course, so i have to render it myself and serve up the tiles.

kpachhai commented 7 years ago

+1 - for custom map url. This is particularly useful for someone who has limited access to the internet and just being able to use a custom offline map would ensure that we can have a worldmap view panel without having to rely on proxy and such. Also, it's neat.

JimMaud commented 7 years ago

Hi Guys, I am also struggeling with this, I read the issues and the stack exchange post. Is it the grafana server or the client accessing the dashboard which needs internet access to the cartodb-basemaps urls?

I also add +1 for offline custom map url.

Thanks

qingweiqm commented 7 years ago

+1 for offline map, not need to be so accurate.

kpachhai commented 7 years ago

It's the browser itself trying to connect to the internet to access that map in order to display it on a panel/graph.

daniellee commented 7 years ago

@JimMaud it is client side so it is your browser that fetches the tiles for the map and so to work your browser needs access to the internet (grafana server does not).

wolfohyeah commented 6 years ago

+1 for the offline map. I have struggled with the map for many days.

sonyzhang commented 5 years ago

+1 I need offline grafana world map too,Hua

neoevoman2 commented 5 years ago

Daniellee, what is the best configuration in tables in order to render the tiles and points very fast. Right now I have some hundreds of thousands coordinates and it takes a while ( up to 5 minutes ) to render them if I have luck.Other grafana shows a network error even I run it locally. Thanks

anatolyza commented 4 years ago

It's not that straight forward but what i did is something like this : Start a tile server (used http://tileserver.org/) start their docker container and add a map Note that the requests to tile server are from your browser and not from server side so you will need to expose the port of the tile server from outside of the docker stack

I didn't find any configurable forks of the worldmap panel , so i grabbed a near enough fork and changed the url directly in the worldmap.ts , compiled and woullah

Set to this url for example http://[your tile server]/styles/osm-bright/{z}/{x}/{y}.png

Hope this helps

smargo171 commented 4 years ago

+1 for the offline map. Our cutomers (public safety) don't allow internet connection from the Grafana server.

guanucoluis commented 2 years ago

+1 is there any implementation for this request?