How can I know the actual scale that my Google maps is currently in?

后端 未结 1 2061
旧时难觅i
旧时难觅i 2021-01-16 04:20

I have a Google map (v3) on my site and I want to know what scale is my current zoom. The thing is that the user can change it\'s zoom so the scale can change.

The i

1条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-16 04:55

    So you can call map.getBounds(). Then you can use functions on the google.maps.geometry.spherical class like computeDistanceBetween or computeLength. Something like this I think should give you what you need:

    
    
    
    
    
    
    
    
    
    
    
    
    
        

    0 讨论(0)
提交回复
热议问题