labaffa
Posts: 2
Joined: Thu May 11, 2023 2:32 pm

Zoom out when using fitToGeometry

Thu May 11, 2023 2:47 pm

Hello,

If I use the fitToGeometry property of mapView, I don't manage to zoom out from the initial view, i.e. it's like the fitToGeometry set a min zoom on the map.
I started from this [example][https://jsfiddle.net/gh/get/library/pur ... togeometry], and here is a simplified version to highlight my problem: [][https://jsfiddle.net/labaffa/7sbzd954/8/]

Is there a solution while still making use of fitToGeometry?
Thanks

dawid.d
Posts: 703
Joined: Thu Oct 06, 2022 11:31 am

Re: Zoom out when using fitToGeometry

Fri May 12, 2023 8:33 am

Hi,

Welcome to our forum and thanks for contacting us with your question!

Unfortunately, using fitToGeometry blocks the ability to zoom out further. If you want to be able to do that, it's better to use the zoom option and center to a given position like in the demo below.

Demo: https://jsfiddle.net/BlackLabel/jq10a3xf/

I hope you will find it useful
Best regards

labaffa
Posts: 2
Joined: Thu May 11, 2023 2:32 pm

Re: Zoom out when using fitToGeometry

Fri May 12, 2023 4:05 pm

Hi dawid,

I see. Thanks for your reply and example.

dawid.d
Posts: 703
Joined: Thu Oct 06, 2022 11:31 am

Re: Zoom out when using fitToGeometry

Mon May 15, 2023 12:03 pm

You're welcome!
In case of any further questions, feel free to contact us again.

Return to “Highcharts Maps”