This is largely what I was after but I’m still struggling to get the HTML to work. I have:
var div = window.document.createElement('div');
div.innerHTML = 'Hello, world!';
var m1 =tomtom.L.marker([56.00190, -3.78390], markerOptions)
.addTo(map)
.on('click', function(e){
tomtom.L.popup()
.setLatLng(e.latlng)
.setDOMContent(div)
.openOn(map)
});
var m2 =tomtom.L.marker([56.10190, -3.98390], markerOptions)
.addTo(map)
.on('click', function(e){
tomtom.L.popup()
.setLatLng(e.latlng)
.setContent("<center><b>Place Name</b> <br> <i>("+ e.latlng.toString()+")</i></center>")
.openOn(map)
});
The above contains two markers, m1 and m2. The m2 works nicely, but note the popup refers to setContent which is not listed inthe API ( https://developer.tomtom.com/maps-sdk-web-js/documentation#Maps.Popup ) as a valid method/property. If I use SetDOMContent, or setHTML I get an error. It’s as if the popup class has a different interface. I note the string used by the set content does accept HTML, but got most upset when I tried to enter a URL even when the slashes were escape charactered.
What did I miss?