'I've got this error: map.js:33 Uncaught TypeError: event.target.getPosition is not a function at yn.<anonymous> (map.js:33)
It doesn't display me the infobubble popup and I tried to change the code, on line 33, but it still doesn't work.
var ui = H.ui.UI.createDefault(map, defaultLayers);
var marker1 = new H.map.Marker({ lat: 47.045299, lng: 21.919435 });
marker1.setData
(
"<p> Universitatea din Oradea, Facultatea de Geografie,
Turism și Sport <br> Adresa: <br> Nume Masterat:<br> Număr de
Studenți:
</p > "
);
marker1.addEventListener("tap", event => {
var bubble = new H.ui.InfoBubble(
***event.target.getPosition(),***
{
content: event.target.getData()
}
);
ui.addBubble(bubble);
}, false);
Solution 1:[1]
Instead of:
event.target.getPosition()
Use:
event.target.getGeometry();
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Jeremy Caney |
