0

I am using google maps api and for the marker I am trying to use an svg file

var marker = new google.maps.Marker({
    position: coords, map: map, icon: '/assets/pin/pin.svg' 
  });

The image actually is been displayed but I am getting a console error.

GET http://localhost:3000/assets/pin.svg 406 (Not Acceptable)

The request headers

Accept:image/webp,*/*;q=0.8
Accept-Encoding:gzip,deflate,sdch
Petran
  • 7,677
  • 22
  • 65
  • 104

1 Answers1

0

Typically, the icon requres a url e.g.

var myIcon={
    url: 'pin.svg',
    size: new google.maps.Size(10, 10),
    origin: new google.maps.Point(0,0),
    anchor: new google.maps.Point(5, 5)
    };

Then,

var myMarker= new google.maps.Marker(
        {
            position: location,
            map: MyMap,
            icon: myIcon
        });
Francis Hemsher
  • 3,478
  • 2
  • 13
  • 15