-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Maps] Auto adjust map center and zoom when filtering map #53831
Comments
Pinging @elastic/kibana-gis (Team:Geo) |
Any progress on this feature? |
There have been no PR made for this enhancement request |
I have a map of the whole country, cities and districts, when someone filters an specific city, he has to manually pan and zoom to find the city filtered, making the aplication useless. The "Fit to data" feature was disabled when you have geo_shapes, it is only active for geo_points. I tried with canvas to pass the center and zoom to a map to manually centralize, but the center and zoom are auto-adjustable. To make things worse, it is not possible even to pass a default center and zoom, so if someone zooms to a city, in the next day he has dicover where he is and to manually adjust to another city. I think maps is great, there are amazing things you can do, it is a great work. Unfortunately, I will have to start from scratch in the vizualizations using another tool. |
fitting to shapes is currently blocked by the absence of the geo_bounds aggregation for geo_shape-fields. This is actively being worked on at the Elasticsearch side: elastic/elasticsearch#37206 This issue here is similar to #29991, which is blocked for the same reason. We hope can close the loop on these features soon. Thank you for your patience! :) |
wrt:
Can you explain a little bit more in detail on how you would like to see this work? (maybe open a different ER for this). Right now, the zoom/center is saved when pressing the "save" button in the Maps-app. Is that not sufficient? |
I´m surprised, What I was trying to do is whenever I select a city I have the coordinates of the center of that city. I wanted to set in the map these coordinates using canvas. However, when I change the position in canves it changes automagically the center of the map in the expression editor center={mapCenter lat=-8.39467 lon=-58.55689 zoom=3.48} You can reproduce this easily. Embed a map in canvas, open the expression editor and move the map, the center changes. Next time it will open in the last change. |
Should I open a feature request or new issue? |
@flaviogoncalves can you open a new issue, specifically with canvas not preserving changes to map center. |
A short update on this. Starting 7.8, Maps has a fit2data button on the top-left hand side. Clicking this, the map will zoom to the extent of the data (with filters/queries applied). |
@thomasneirynck I have got the fit2data button working in my canvas project, but like other people have mentioned a user has to specifically press that button. For example I have over 2 million geojson features and wanted the user to pick a feature from the dropdown filter and the map filter (which is does) and then zoom to that single feature. Is there a way to trigger this by an Expression, maybe render, or an alternative method? |
thx @TimJMartin for the added context. There is no immediate work-around that comes to mind here. I do agree that requiring the user to explicitly click on the fit2data button is not ideal. For your use case, like in those kiosk-like apps with Canvas, a user would really prefer the auto-fitting to be automated. @nreese created a POC for this functionality #66452 cc @kmartastic |
The default behavior for every map should be to zoom to the bounds of the visible data. To be dramatic, I would die on this hill. If we have the fit to data button, I assume we can do this automatically. Beyond that, we should have an option to make layers "contextual" -- which basically treats them like a background map layer. |
Sorry to get in the thread, I had lot of expectations in the new feature. If we could at least fit to data on line strings and polygons, it is acceptable. The problem is when a user press the fit to data and nothing happens because it is a polygon map. The user is lost and don't understand what is happening. |
wrt
This manual-fit-to-data-bounds button is available in Kibana Maps starting 7.8. It will work both for layers with a |
hi @flaviogoncalves , thx for sharing :) This is likely because your index containing that To enable the "Fit to data" button, the So it would require you to re-index that shape data in 7.8. doc_values should be enabled by default then, and that fit-to-data button will become clickable. |
Thank you very much, I will try. |
@flaviogoncalves I have 2.5 million polygons as geo_shape and the fit to data button works, this was a brand new index I created yesterday using 7.8 @kmartastic totally agree about the default behaviour, I would also just leave the map as is, if there is no data left after a filter. |
Closed by #72129 |
I want to change center lat/long and zoom level to highlight select location in filters and default lat/long and zoom level in absence of any filter values.
I am showing some KPIs on map.
Now, When i use the filter to show KPIs on perticular area only.
Actual Result
This is showing kpis on selected region but without zooming in or highlighting the area in complete window.
Expected Result
I want to make this area auto zoom in (like fit to data functionality) and zoom out in case of absence of any filter.
Kibana Version:
7.5.1
OS:
Cent OS 7
Browser:
Google Chrome 79.0.3945.88
The text was updated successfully, but these errors were encountered: