Javascript, Change google map marker color

后端 未结 9 1231
自闭症患者
自闭症患者 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:23

    You can use the strokeColor property:

    var marker = new google.maps.Marker({
        id: "some-id",
        icon: {
            path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,
            strokeColor: "red",
            scale: 3
        },
        map: map,
        title: "some-title",
        position: myLatlng
    });
    

    See this page for other possibilities.

提交回复
热议问题