I am using KML file to overlay my data on google map . Actually I want to change the marker color based on some value which in the KML file .
How can I do that .
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.
First of all: KML supports the styling of icons, but the
<color>-element is not supported for<iconStyle>by the Maps-API, so you cannot change the color of an Icon(see https://developers.google.com/kml/documentation/kmlelementsinmaps for more details).What you can do is use different icon-images with the desired colors.
But afaik there is no “dynamic” way to change the
<href>of an<icon>.However, you may create a serverside script that parses the original KML and delivers a modified KML to google.