A
A
Alexis_D2019-03-26 08:56:21
JavaScript
Alexis_D, 2019-03-26 08:56:21

Perform zoom Google maps when scrolling another element?

Good day. There is a google maps map 300x300 and there is, let's say, a div with id="scrollMe" 500x500, how to make the map zoom when scrollMe scrolls (depending on which direction you scroll)?
If there are links where you can read I will be grateful. Thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Bay, 2019-03-26
@kawabanga

Read the google maps js api documentation, there are methods that are responsible for zoom.
I think you will only need these two methods, which will be tied to the scroll event.
map.setCenter(latlngset);
mapsetZoom(12);
note that the zoom is in steps, i.e. you can not smoothly increase the zoom on the map.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question