Having some issues with the functionality of the pan
function. It's working, but not quite how I need it to.
Currently, I have a logo overlaying a map and I want to pan away from the logo automatically to show an infowindow (panning left or right). Here's the code snippet:
if(locations[i][0] == 1){
var infowindow = new google.maps.InfoWindow({
content: '<div class="oblacek"><h4>'+locations[i][1]+'</h4>'+locations[i][2]+'</div>',
position: new google.maps.LatLng(locations[i][3], locations[i][4]),
});
map.panTo(marker.getPosition());
infowindow.open(map,marker);
}
A visual representation would help illustrate the issue: