Merge pull request #16 from betatim/panning
Map now pans when marker is outside viewport. Closes #12
This commit is contained in:
commit
365114dd8c
|
@ -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);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue