javascript - Angular google maps custom Icon -


i'm trying add icone doesn't show icon it's show default icon

html

<ui-gmap-google-map center="vm.map.center" zoom="vm.map.zoom" options="options"> <ui-gmap-marker icon="vm.options.icon" coords="vm.marker.coords" events="vm.marker.events" idkey="vm.marker.id"> </ui-gmap-marker>  </ui-gmap-google-map> 

controller

  var vm = this;       vm.map = {         center: {             latitude: 43.6042600,             longitude: 1.4436700         },         zoom: 10     };  vm.options = {icon:'images/location.png'};     vm.coordsupdates = 0;     vm.dynamicmovectr = 0;     vm.marker = {         id: 0,         coords: {             latitude: 43.6042600,             longitude: 1.4436700         },         events: {             dragend: function(marker, eventname, args) {                 var lat = marker.getposition().lat();                 var lon = marker.getposition().lng();                 $log.log(lat);                 $log.log(lon);                 vm.marker.options = {                     draggable: false,                     labelcontent: "",                     labelanchor: "100 0",                     labelclass: "marker-labels"                 };             }         }     }; 

for implementing custom icon can use following code snippet :

  var marker = new google.maps.marker({     position: mylatlng,     map: map,     icon: 'url_of_your_custom_image.png'   }); 

for further clarification can go through google maps documentation have mentioned how customize map marker.


Comments