Auto center and auto zoom on markers
- Dima
 - 
            
				
                                 - Offline
 - Platinum Member
 - 
            
         
        Less
        More
        
    
        
            
        
                7 years 7 months ago                #11539
        by Dima
    
    
            
Don't forget support my developments: post review in JED , donate , help with translation
        
    
    
            
            
            
            
                                
    
                                                
    
        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
 - 
            
         
        Less
        More
        
            
    
        - Posts: 9
 - Thank you received: 0
 
            
        
                7 years 7 months ago         -  7 years 7 months 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.
    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: 7 years 7 months ago  by clever.            
            Please Log in or Create an account to join the conversation.
- Dima
 - 
            
				
                                 - Offline
 - Platinum Member
 - 
            
         
            
        
                7 years 7 months ago                #11541
        by Dima
    
    
            
Don't forget support my developments: post review in JED , donate , help with translation
        
    
    
            
            
            
            
                                
    
                                                
    
        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
    
            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
 - 
            
         
        Less
        More
        
            
    
        - Posts: 9
 - Thank you received: 0
 
            
        
                7 years 7 months 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.
    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.203 seconds