How to display an icon in the map?

We re trying to display an  icon in the map shown below in the code but we are not being able to do it.

Is there any other way to display the icon in the map?

var marker = new google.maps.Marker({
position: myLatLng,
map: map,
icon:”docs/dot (11).png”,
title: PoleID
});

The error I am getting

Failed to load the resource:the server responded with a status of dot.png:1 401()

 

Posted: April 29, 2021 at 11:33 am
Replies: 1
May 3, 2021
Posted by Patrick Burma

The 401 error is because you are trying to access a restricted document. Use getDocumentUrl() method and that will get the file URL with an auth token.

var icon = client.getDocumentUrl(“docs/dot.png”);

Then reference the icon in your marker “icon:icon,” and you should be all set.

https://dev.vantiq.com/docs/system/cbref/index.html#getdocumenturl

 

 

  • This reply was modified 2 years, 10 months ago by Patrick Burma.
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
© Vantiq 2024 All rights reserved  •  Vantiq Corporation’s Privacy Policy and Cookie Policy