Using google maps API, how can we set the current location as the default set location using map.setCenter function?

前端 未结 7 1400

I am writing JavaScript code using Google Maps API.

map = new google.maps.Map2(document.getElementById(\"map_canvas\"));
map.setCenter(new google.maps.LatLng         


        
7条回答
  •  -上瘾入骨i
    2020-12-25 14:23

    map = new google.maps.Map2(document.getElementById("map_canvas"));
    pos = new google.maps.LatLng(37.4419, -122.1419);
    map.setCenter(pos, 13);
    map.panTo(pos);
    

提交回复
热议问题