Yubraj Pokharel
Yubraj Pokharel

Reputation: 485

How to change Marker Icon using Google Api in Polymer-Project?

help me please ,I generated multiple markers by using core-ajax, the default markers are shown well, but want to add the custom marker instead of the default red marker

<template repeat="{{x in views}}">
    <google-map-marker latitude="{{x.lat}}" longitude="{{x.long}}"
                       draggable="false">
            <img src="1.png" height="20px" width="20px">
    </google-map-marker>
</template>

as mentioned in the tutorial this but is not working

the customized image position not set properly

Upvotes: 0

Views: 1023

Answers (1)

Yubraj Pokharel
Yubraj Pokharel

Reputation: 485

I got this answer and dont know why people -ve the question about the google-map marker Solution we just add the specified icon using the icon attribute in the google-map-marker

<google-map-marker latitude="{{x.lat}}" 
        longitude="{{x.long}}"
        draggable="false"
        icon="components/elements/imagename.png"
        title="{{x.VDC}}-{{x.area}}">
</google-map-marker>

Upvotes: 3

Related Questions