Auto center and auto zoom on markers

More
6 years 1 month ago #11539 by Dima
Replied by Dima on topic Auto center and auto zoom on markers
This code (your link), is useful when your map div changed dynamically, for example, in accordion when map is not on the first tab. Ie map div changed, and you'll need to notify map to resize (get new tiles).

Don't forget support my developments: post review in JED , donate , help with translation ;)
The following user(s) said Thank You: clever

Please Log in or Create an account to join the conversation.

  • clever
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago - 6 years 1 month ago #11540 by clever
Replied by clever on topic Auto center and auto zoom on markers
Hi and thanks for your replies.
Maybe my link is wrong or for another purpose...
Right now, the center and the zoom level seem to be set on page load.
If I resize the browser window or change the orientation of the tablet or phone, some markers are then outside of the viewport because the center and the zoom level of the map don't change on window resize.
I have to do a page reload with the new windows size or device orientation for the markers and zoom level to fit again.
I did a short screen capture, where I do a page reload after each resize...that is the behaviour I am looking for:

www.cleverworx.de/video/resizing.mov

That's why I thought, maybe some kind of "on window resize" listener might be able to do that and "recalculate" the center and zoom level, each time the window size or orientation changes.
Last edit: 6 years 1 month ago by clever.

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago #11541 by Dima
Replied by Dima on topic Auto center and auto zoom on markers
But what do you expect in case
1 - you open map (see all markers),
2 - after that zoom in to see only one you want,
3 - after that rotate device?

Today - you'll see this only one
You expect - all markers with new map size :)

Don't forget support my developments: post review in JED , donate , help with translation ;)
The following user(s) said Thank You: clever

Please Log in or Create an account to join the conversation.

  • clever
  • Topic Author
  • Offline
  • New Member
  • New Member
More
6 years 1 month ago #11542 by clever
Replied by clever on topic Auto center and auto zoom on markers
I would like the markers to be all visible on page load and every time the user changes orientation of the device or the browser window size.
As long as the user does not change window size or orientation of the device, the manual changes stay the way the user selected them (for example dragging the mao, zooming in or out, selecting POIs).
Once the user changes the window size or the orientation of the device (tablet / phone), the automatic center and zoom should take over again.
Sorry if I am not making any sense.

Please Log in or Create an account to join the conversation.

Time to create page: 0.071 seconds

Donate


Go to top