So you would like to while displaying all of them color differently based on a variable change?
Check this thread out.
Hi,
is there a way to link geojson files to queries?
we need to represent statistical data for areas. Create a new geojson for every value or set of values is not viable, we have hundreds of maps and thousands of values.
It could be very useful link table to geojson data with a key field.
Since you want it to be dynamic reading things from a local file is going to be difficult if not impossible to do styling changes.
if you serve the geojson data from an api service maybe you can use CSS styles to modify your points, line, polygons with thickness & color? Not sure if it will be picked up by grafana geomap plugin though
geojson, style
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [[
[-180.0, 10.0], [20.0, 90.0], [180.0, -5.0], [-30.0, -90.0]
]]
},
"style": {
"__comment": "all SVG styles allowed",
"fill":"red",
"stroke-width":"3",
"fill-opacity":0.6
},
"className": {
"baseVal":"A class name"
}
}
Also looks like someone already posted this issue
opened 06:53PM - 04 Jul 23 UTC
type/bug
area/panel/geomap
triage/needs-confirmation
###
# What went wrong?
**What happened**:
![изображение](https://gith… ub.com/grafana/grafana/assets/9244347/de8f6643-aee2-42ff-93c9-1d8c2b59a6d5)
I created a variable ("cn") to be able to choose one of the properties, which match to custom geoJSON properties.
Now I want to use this variable inside style rule (see attachment)
But it doesn't work ("not found" error).
**What did you expect to happen**:
GeoMap style rule should work with variable
###
# How do we reproduce it?
**Step 1**:
- Open [Geomap Multi Layers Dashboard](https://play.grafana.org/d/geomap_multi-layers/panel-tests-geomap-multi-layers) on Grafana Playground.
**Step 2**:
Create custom variable "country" with values:
![изображение](https://github.com/grafana/grafana/assets/9244347/37d47338-dcef-4b33-9b62-f9652ab169b4)
**Step 3**:
Open Panel settings and try to insert "$country" in the field instead of Canada
![изображение](https://github.com/grafana/grafana/assets/9244347/aee1b6b7-1f57-4140-800e-e15c4d441a40)
###
# What Grafana version are you using?
v9.5.1