Skip to content

Instantly share code, notes, and snippets.

@timdeschryver
Created November 3, 2019 16:29
Show Gist options
  • Select an option

  • Save timdeschryver/c33751c896980f63d6f4a1b8644bb070 to your computer and use it in GitHub Desktop.

Select an option

Save timdeschryver/c33751c896980f63d6f4a1b8644bb070 to your computer and use it in GitHub Desktop.
export class AppComponent implements OnInit {
addMarker() {
this.markers.push({
position: {
lat: this.center.lat + ((Math.random() - 0.5) * 2) / 10,
lng: this.center.lng + ((Math.random() - 0.5) * 2) / 10,
},
label: {
color: 'red',
text: 'Marker label ' + (this.markers.length + 1),
},
title: 'Marker title ' + (this.markers.length + 1),
options: { animation: google.maps.Animation.BOUNCE },
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment