我正在尝试将Inpost小部件添加到以纯HTML编写的网站中。当我添加mapWidget时,一切正常,但是当我尝试添加dropdownWidget时,chrome控制台显示错误:
未捕获的ReferenceError:未定义dropdownWidget 在Object.e.dropdownWidget(sdk-for-javascript.js:1) 在window.onload(1.html:16)
我的代码:
<script async src="https://sandbox-geowidget.easypack24.net/js/sdk-for-javascript.js"></script>
<link rel="stylesheet" type="text/css" href="https://sandbox-geowidget.easypack24.net/css/easypack.css">
<script type="text/javascript">
window.easyPackAsyncInit = function () {
easyPack.init({});
window.onload = function() {
easyPack.dropdownWidget('easypack-widget', function(point) {
console.log(point)
});
}
};
</script>
<div id="easypack-widget"></div>
我在以下地址找到了文档:https://docs.inpost24.com/display/PL/%5B4.5.0%5D+Geowidget+Documentation