alexandrainst / alexandra-trackmap-panel

Grafana map plugin to visualise coordinates as markers, hexbin, ant path, or heatmap.
MIT License
78 stars 26 forks source link

Filter by geographical displayed extent #1

Closed alexvaut closed 4 years ago

alexvaut commented 5 years ago

Hi,

first: very nice plugin ! second: is there a way to use the displayed extent in the query, something like that:

``SELECT time_index, latitude as lat, longitude as lon FROM doc.table_name WHERE $__timeFilter(time_index) AND lat >= $minLat AND lat <= $maxLat AND lon >= $minLong AND lon <= $maxLong ORDER BY time_index

I have a DB with billions of locations so retrieving only what is viewed would make this plugin usable.

Thanks !

Drazair commented 4 years ago

A new version of the plugin is now available here. It has been updated with a setting to enable the use of the maps bounding box in the query like your example. A pull request have also been made to grafana, but it will take abit of time before they update it there.

alexvaut commented 4 years ago

That is great, thank you very much, I will test it as soon as I can !

Alkarex commented 4 years ago

For reference: https://github.com/alexandrainst/alexandra-trackmap-panel/commit/5bb5276ac318d131ab582847bb634004208f4fa4