I have a view using search api that shows a map of the world which can be searched/faceted. I'm using zoom-to-layer to have the map zoom in to search results. However, when no search/facet has been chosen and all data points are visible, zoom to layer was zooming in to the greatest maximum zoom (rather than showing all results on the world map).

I tracked this down to zoomtolayer.js checking for null values while it was getting NaN values instead. This patch solved my problem.

Comments

jody lynn’s picture

StatusFileSize
new1.19 KB

New patch that's better handling my map.

I think the problem is that I'm showing a list of locations and also a map, but not all locations have been geocoded so this screws up the zoom.

Status: Needs review » Needs work

The last submitted patch, openlayers-1664738-1.patch, failed testing.

isolpa’s picture

Sweet! I was having some issues with a similar view, where some items have wkt points and other wkt are empty. This patch fixed the zoom in my case. Thanks!

pol’s picture

Status: Needs work » Fixed

Hello,

Could you try with the latest dev version ?
Work has been done on the zoom to layer behavior, and it's most likely fixing this.

Reopen the issue if problem found.

Thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.