Nemanja Milojkovic
Nemanja Milojkovic

Reputation: 13

Google Maps custom markers on ionic

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

Answers (2)

Calum Mackervoy
Calum Mackervoy

Reputation: 101

Not sure what the downvotes on the previous answer are about, using

url: "assets/img/2.png"

works for me

Upvotes: 3

Abdelkadre El Maghri
Abdelkadre El Maghri

Reputation: 13

i think you need to remove the 2 dots in url of icon

Upvotes: -2

Related Questions