I have successfully built a map.
But I'd like to be able to choose whether or not any given Marker bounces or drops as it is placed on the map… typically to draw attention to one of two or three dozen Markers that are all visible simultaneously.
Defining the Marker's properties like this (from values held in an array) works perfectly:
1. let marker = new google.maps.Marker(
2. {
3. map: map,
4. position: array[i],
5. title: array[i].title,
6. *
7. }
8. );
How do I selectively add:
animation: google.maps.Animation.BOUNCE
on line 6, please?
My array already contains an item ("true" vs "false") for every object/item such that its logic - if my Marker code were like this - would either be null or contain the code to BOUNCE the Marker:
if (array[i].DropOrNot == "true") {
set animation string to "animation: google.maps.Animation.DROP"
}
else {
set animation string to ""
}
IOW how do I conditionally display a Property of the Marker construct, please?