Hi there!
Could it be possible to change a Marker with an Icon on the web SDK v.5?
Or add a picture on a marker popup?
Thanks for your help!
Hi there!
Could it be possible to change a Marker with an Icon on the web SDK v.5?
Or add a picture on a marker popup?
Thanks for your help!
Hi,
Yes, it is possible
example:
var marker = new tt.Marker().setLngLat([-122.492544, 37.768454]).addTo(map);
marker.getElement().innerHTML = "<img src='LI-In-Bug.png'>";
Super, many thanks for your response!
When I"m working on such SDK or API, I forgot my JS…
Thanks!
Other way, more preferred:
var markerElement = document.createElement('div');
markerElement.innerHTML = "<img src='LI-In-Bug.png' style='width: 35px; height: 35px'>";
var marker = new tt.Marker({element: markerElement}).setLngLat([-122.492544, 37.768454]).addTo(map);