Google Maps setCenter()

前端 未结 5 1376
予麋鹿
予麋鹿 2021-01-03 19:07

I\'m using google maps. In my code i\'ve used setCenter() function. My problem is that marker is always located on top left corner of map area (not at the center). Please te

5条回答
  •  天命终不由人
    2021-01-03 19:14

    For me above solutions didn't work then I tried

    map.setCenter(new google.maps.LatLng(lat, lng));
    

    and it worked as expected.

提交回复
热议问题