Event.latLng latitude information is abnormal when polyline mouseover in Google Maps API

Asked 2 months ago, Updated 2 months ago, 4 views

If you use the code below to make the map an aerial photograph, there is no problem with longitude from Zoom, which is 45 degrees diagonally, not directly above, but the latitude is greatly shifted to the north, which is a problem.In the case of ROADMAP other than aerial photographs, there is no abnormality.

Google.maps.event.addListener(polyline, 'mouseover', function(event){
   console.log(event.latLng.lat()+", "+event.latLng.lng());

javascript google-maps

2022-09-30 12:09

1 Answers

It's self-less.
Resolved by adding map.setTilt(0); to prevent the aerial photograph from displaying 45 degrees diagonally.
In the Maps JavaScript API documentation, call the Map object setTilt(0) to disable the 45° image.

2022-09-30 12:09

If you have any answers or tips

© 2022 OneMinuteCode. All rights reserved.