hi , i’m using ionic 4 google native maps and i need to make markers like this , any one can help ?
that’s my code :
goToMyLocation() {
this.map.clear();
this.map
.getMyLocation()
.then((location: MyLocation) => {
const markers = [
{
title: 'Giza',
snippet: 'This plugin is awesome!',
position: {
lat: 29.0049333,
lng: 28.5038869,
},
animation: GoogleMapsAnimation.BOUNCE,
},
{
title: 'Alexandria',
snippet: 'This plugin is awesome2!',
position: {
lat: 30.7974665,
lng: 29.1907279,
},
animation: GoogleMapsAnimation.BOUNCE,
},
{
title: 'Aswan',
snippet: 'This plugin is awesome2!',
position: {
lat: 24.0923728,
lng: 32.8825537,
},
animation: GoogleMapsAnimation.BOUNCE,
},
];
for (let index = 0; index < markers.length; index++) {
const element = markers[index];
let marker: Marker = this.map.addMarkerSync({
title: element.title,
position: element.position,
animation: GoogleMapsAnimation.DROP,
});
marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => {
// this.showToast('clicked!');
});
this.map.on(GoogleMapsEvent.MAP_READY).subscribe((data) => {
console.log('Click MAP', data);
});
}
})
.catch((err) => {
});
}

1 post - 1 participant