When I use a Geomap panel with “initial view” set to coordinates, you can zoom and pan around the map once the dashboard has loaded - all good. The dashboard refresh has no affect. This is good.
But if I set the “initial view” to fit-to-data then on each refresh it also resets the view back to “initial”.
It seems odd that these two view options work in different ways.
Does anyone know a good way around this (I really need to use “fit to data” since different teams will be interested in different geographical areas and will see different data / markers)?
Also, my dashboards for non-Grafana-experts - so asking them to deactivate the refresh while zooming would be less than ideal. I’d like to give them something a bit more user-friendly.
Ah, man, I thought I’d worked out a good way around this. It’s somewhat convoluted but my idea was…
Install the Infinity datasource
Serve the required “initial view” values (latitude, longitude and zoom) via CSV (these can then be different per user group / geographical interest region)
Set them as hidden variables (since I don’t want to the users to see this stuff)
Substitute variables in the panel initial view coordinates: for latitude, longitude and zoom.
But noooo!!! The panel does not accept variables here - only constant numeric values
I tried manually adding it to the dashboard json (in desperation now) - and they just appear blank in the dashboard.
do you have teams to geo areas relationship in a db somewhere? because if you do you could leverage that relationship, based on login name, to auto zoom with fit to data see below. This is mock to emulate what could happen. Bonus fry: even with refresh it does not move from last zoom
Thanks for the reply. I could do that with the DB. What I find though is and you might find the same (looking at your emulation - and assuming you have “fit-to-data” here - which I guess you must have for this) once you select a “team” and the map zooms to those markers, if you zoom out manually (with the map controls) or drag the map to pan to a different area - this is when a dashboard refresh will snap the map back to the “fit” area. Do you see the same?
(PS - this only happens for me with “fit-to-data” - if you set “coordinates” for initial view, you can zoom / pan and then a refresh doesn’t reset.
Hmmm, that’s a shame. OK, I’ll check that out - though I confess I’ve been a bit reluctant to use Volkov Labs stuff since the “closed-for-business” announcement earlier this year… (which is a shame since they’ve produced some good plugins - but I guess there’s some uncertainty now about the future of those). But I will take a look