-
Zh GoogleMap
-
Component
-
Auto center and auto zoom on markers
Auto center and auto zoom on markers
-
clever
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 9
-
Thank you received: 0
-
-
Less
More
-
Posts: 4609
-
Thank you received: 460
-
-
-
-
-
6 years 1 month ago #11519
by Dima
Hi.
I can add like this code to my extension, because I have all markers coordinates.
But I don't think it's good idea.
1 - you can easy set map center and zoom to show all markers (without this code). I agree with you - you need in this case a little bit more tries. But in any case you can set it easy.
2 - you can also center map by definite marker (by setting its ID in menu property or by plugin parameter)
And the big Cons. If you set dynamic loading placemarks (if you have lots of it on map, use AJAX loading), markers will get partly by data blocks (you set amount of it in map settings), and bounds will change by every data block. In this case your map can change zoom or center with every loading data block. And you can see "shaking" map.
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
-
Less
More
-
Posts: 9
-
Thank you received: 0
-
-
6 years 1 month ago #11520
by clever
Thanks for your reply.
I understand your concerns and I have successfully centered and zoomed my map accordingly.
They main goal would have been to have a dynamically resizing / rezooming map for all devices and resolutions.
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 4609
-
Thank you received: 460
-
-
-
-
-
6 years 1 month ago #11522
by Dima
You can manage map size
set
width=0 it means width=100%
height=0 it means height=100%
Set CSS class name in map details - you'll get your CSS name for main map div
And use CSS styles and apply any styles.
As for height=100% - read some posts in my forum - for complicated templates you can get empty map div due to collapse divs, but if your template can correct store div size, you can also call plugin in this div.
As for zoom for different resolutions - I can't control.
The following user(s) said Thank You: clever
Please Log in or Create an account to join the conversation.
Less
More
-
Posts: 4609
-
Thank you received: 460
-
-
-
-
-
-
clever
-
Topic Author
-
Offline
-
New Member
-
Less
More
-
Posts: 9
-
Thank you received: 0
-
-
6 years 1 month ago #11525
by clever
The "problem" is not with the full screen / responsive map. I would like to additionally have a dynamic zooming so I can always see all markers or clusters, no matter what resolution the user has.
Here are two screen shiots / examples:
That is what I'm trying to achieve.
Please Log in or Create an account to join the conversation.
-
Zh GoogleMap
-
Component
-
Auto center and auto zoom on markers
Time to create page: 0.187 seconds