dashboards-maps
dashboards-maps copied to clipboard
[BUG] Precision does not automatically update when zooming on coordinate map on a dashboard
What is the bug? When a coordinate map visualization is used on a dashboard and 'Change precision on map zoom' is activated, it often happens that the precision level does not update correctly while zooming.
How can one reproduce the bug? Steps to reproduce the behavior:
- create index with mapping:
"mappings": { "properties": { "location": { "type": "geo_point" } } }
- index data to end up with ~100 documents with data such as this:
"_source" : { "some_data" : 92.47, "date" : "2022-03-10T09:33:28", "location" : "40.450655,11.510062" }
- create a coordinate map visualization of the data and end up with something like this:
http://localhost:5601/app/visualize#/edit/7a0cad60-c148-11ec-b44a-e3ba16249f67?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:now-24h,to:now))&_a=(filters:!(),linked:!f,query:(language:kuery,query:''),uiState:(mapCenter:!(45.42737117898911,10.39583873351052),mapZoom:10),vis:(aggs:!((enabled:!t,id:'1',params:(field:some_data),schema:metric,type:max),(enabled:!t,id:'2',params:(autoPrecision:!t,field:location,isFilteredByCollar:!t,precision:5,useGeocentroid:!t),schema:segment,type:geohash_grid)),params:(addTooltip:!t,colorSchema:'Yellow%20to%20Red',heatClusterSize:1.5,isDesaturated:!t,legendPosition:bottomright,mapCenter:!(0,0),mapType:'Scaled%20Circle%20Markers',mapZoom:2,wms:(enabled:!f,options:(attribution:'',format:image%2Fpng,layers:'',styles:'',transparent:!t,version:''),selectedTmsLayer:(attribution:'%3Ca%20rel%3D%22noreferrer%20noopener%22%20href%3D%22https:%2F%2Fwww.openstreetmap.org%2Fcopyright%22%3EMap%20data%20%C2%A9%20OpenStreetMap%20contributors%3C%2Fa%3E',id:road_map,maxZoom:10,minZoom:0,origin:elastic_maps_service),url:'')),title:test_map,type:tile_map))
- Add the visualization to a dashboard, save it, and start trying to zoom in and out. It looks like the precision is set to 2 while zooming out and stays fixed at 2, even when one zooms back in.
What is the expected behavior? Precision level is updated according to zoom level.
What is your host/environment?
- OS: Arch Linux
- Opensearch Dashboards Version: 1.3.1
- Plugins: none
Do you have any screenshots? see https://discuss.opendistrocommunity.dev/t/map-visualizations-in-opensearch-dashboards/9000/9?u=adam
Do you have any additional context? Probably the same issue as https://github.com/elastic/kibana/issues/74714