Javascript, Change google map marker color

后端 未结 9 1247
自闭症患者
自闭症患者 2020-12-07 11:44

May I know a way to change the Google Map marker color via Javascript.. I am new at this and any help would be much appreciated, Thank you.

I used the following code

9条回答
  •  生来不讨喜
    2020-12-07 12:10

    You can use this code it works fine.

     var pinImage = new google.maps.MarkerImage("http://www.googlemapsmarkers.com/v1/009900/");
    
     var marker = new google.maps.Marker({
                position: yourlatlong,
                icon: pinImage,
                map: map
            });
    

    see Example here

提交回复
热议问题