I've got this error: map.js:33 Uncaught TypeError: event.target.getPosition is not a function at yn.<anonymous> (map.js:33)
I've got this error: map.js:33 Uncaught TypeError: event.target.getPosition is not a function at yn.<anonymous> (map.js:33)
它没有向我显示 infobubble 弹出窗口,我尝试更改第 33 行的代码,但它仍然不起作用。
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);
而不是:
event.target.getPosition()
使用:
event.target.getGeometry();
它没有向我显示 infobubble 弹出窗口,我尝试更改第 33 行的代码,但它仍然不起作用。
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);
而不是:
event.target.getPosition()
使用:
event.target.getGeometry();