I need to make some markers semi-transparent depending on time. Is there any way to control the CSS opacity of a marker? Or is it possible to reliably find out a marker’s DOM element?
I use Google Maps API v3.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no way via CSS. You could reference the markers in an array, and then loop through the array using the
setIcon()method on each marker object to reference icons with different opacities (presuming you’re using PNGs with alpha transparency). You’ll have to call a function to change the icons based on user input or some other event.