Reputation: 13
I am using custom markers on Google Maps, and they work perfectly on browser mode, but the problem happens with device, I can't get picture of marker, not sure if I am placing image of marker right.
This is the code I am using.
var marker = new google.maps.Marker({
position: myLatLng,
map:this.map,
title: 'Pumpa',
icon: { url: "../assets/img/2.png",
scaledSize: new google.maps.Size(30, 30)
} });
any clues where should I put marker image and what path should I use then.
Upvotes: 1
Views: 4040
Reputation: 101
Not sure what the downvotes on the previous answer are about, using
url: "assets/img/2.png"
works for me
Upvotes: 3