Google Map API 3 creating different colors for markers from code of API 2

后端 未结 1 1843
南旧
南旧 2021-01-28 23:01

I used this code in API 2 but I can not find equivalent code for API 3. I want to create different colors for markers depending on severity so they are not static values. I have

相关标签:
1条回答
  • 2021-01-28 23:39

    GIcon is no longer part of GMap API V3. But Gabriel Schneider created a Marker extension which solves your problem.

    StyledMarker with documentation and examples.

    This example demonstrates color changes for the default GMap icons with a letter added. Example

    I think you'd want something like:

    var styleMaker1 = new StyledMarker({styleIcon:new StyledIcon(StyledIconTypes.MARKER,{color:"66FF33"}),position:myLatLng,map:map});
    ... // etc.
    
    0 讨论(0)
提交回复
热议问题