1

I am having trouble with pan function. Its working but not as I want it to.

I have logo over map and would like to pan away from this logo so infowindow would be seen (auto pan left or right).. Here is code:

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 picture will explain it better:

Mp0int
  • 18,172
  • 15
  • 83
  • 114
user3278890
  • 89
  • 1
  • 13
  • So you want to slide the map to the side to see info popup? Maybe make your logo smaller then? – Pavlo Feb 11 '14 at 15:14
  • I want to slide info window left or right soo infowindow would be seen and also logo would be seen. I cant make logo smaller, it has to be that size. – user3278890 Feb 11 '14 at 15:19

1 Answers1

0

What you are trying to achieve is similar to what this question and this another question discusses. As it states, with panBy() you'll problaby achieve what you want.

Community
  • 1
  • 1
Ciro Costa
  • 2,455
  • 22
  • 25