Skip to content

Commit

Permalink
Update public.gmaps.js
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebacker committed May 13, 2020
1 parent 22b2fcf commit 64a6248
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion public/js/public.gmaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,14 @@ var map = {
if (this.places.length > 1) {
this.map.fitBounds(bounds);
} else if (this.places.length === 1) {
this.map.setCenter(new google.maps.LatLng(this.places[0].latitude, this.places[0].longitude));
this.openMarker(this.places[0].marker);
}
},
openMarker: function(marker) {
this.map.panTo(marker.position);
this.map.setZoom(13);
google.maps.event.trigger(marker, 'click');
},
onMarkerClick: function(marker) {
this.infoWindow.setContent(marker.content);
this.infoWindow.open(this.map, marker);
Expand Down

0 comments on commit 64a6248

Please sign in to comment.