Google Maps choose zoom to fit country TIGHTLY in given window

前端 未结 2 905
闹比i
闹比i 2021-01-28 18:28

I am just starting out with the Google Maps API. I have successfully managed to create a map centered on a given country

function create_map (geometry) {
    var         


        
2条回答
  •  别那么骄傲
    2021-01-28 18:49

    You are using wrong object property. geometry.position is undefined. You have to use geometry.location and you will get better map without map.fitBounds()

提交回复
热议问题