Map now pans when marker is outside viewport

This commit is contained in:
Tim Head 2014-11-23 11:41:25 +01:00
parent 9cdd13343a
commit d5cae4c6b7
1 changed files with 3 additions and 0 deletions

View File

@ -130,6 +130,9 @@ var These3Words = (function () {
this.label = label; this.label = label;
this.marker.setPosition(latLng); this.marker.setPosition(latLng);
this.marker.setTitle(label); this.marker.setTitle(label);
if (!this.map.getBounds().contains(latLng)) {
this.map.panTo(latLng);
}
}; };