gpt4 book ai didi

javascript - 未捕获的类型错误 : Cannot read property 'authenticateClientAndRetrieveSessionId' of undefined

转载 作者:行者123 更新时间:2023-12-05 06:50:39 24 4
gpt4 key购买 nike

我正在使用 Vue.js 和 Vuetify 框架。我需要使用带有位置地址字段的表单。当用户开始输入地名时,该字段必须建议位置地址列表。 enter image description here最终目标是在 Vue js 框架上实现如下所示:https://www.bing.com/api/maps/sdk/mapcontrol/isdk/autosuggestuiwithoutmap#JS

 <template>
<v-app>
<div id="searchBoxContainer">
<v-text-field
id="searchBox"
v-model="startlocation"
label="Start Location"
prepend-inner-icon="mdi-map-marker"
outlined
rounded
dense
></v-text-field>
</div>
</v-app>
</template>
<script type='text/javascript' src='https://www.bing.com/api/maps/mapcontrol?key=[bing-map apikey]'></script>

 metaInfo () {
return {
script: [{
src: `https://www.bing.com/api/maps/mapcontrol?key=[bing_map apikey]`,
async: true,
defer: true,
callback: () => this.loadMapScenario() // will declare it in methods
}]
}
},
methods: {
loadMapScenario() {
Microsoft.Maps.loadModule("Microsoft.Maps.AutoSuggest", {
callback: () => {
var options = { maxResults: 5 };
var manager = new Microsoft.Maps.AutosuggestManager(options);
manager.attachAutosuggest("#searchBox", "#searchBoxContainer");
},
});
},

最佳答案

我找到了解决办法!

我使用了共享的片段 here我的代码现在看起来像这样:

function GetMap() {
Microsoft.Maps.loadModule('Microsoft.Maps.AutoSuggest', {
callback: onLoad,
errorCallback: onError
});
function onLoad() {
var options = { maxResults: 5 };
var manager = new Microsoft.Maps.AutosuggestManager(options);
manager.attachAutosuggest('#search_78', '#header-search', selectedSuggestion);
}
function onError(message) {
document.getElementById('printoutPanel').innerHTML = message;
}
function selectedSuggestion(suggestionResult) {
document.getElementById('printoutPanel').innerHTML =
'Suggestion: ' + suggestionResult.formattedSuggestion +
'<br> Lat: ' + suggestionResult.location.latitude +
'<br> Lon: ' + suggestionResult.location.longitude;
}

}

回到我的页面后,错误发生了变化,它说我的凭据无效,并将我重定向到 https://www.bingmapsportal.com/Application我可以在哪里创建一个有效的 key 。使用该 key 解决了问题,现在我可以看到建议的地址表。

关于javascript - 未捕获的类型错误 : Cannot read property 'authenticateClientAndRetrieveSessionId' of undefined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66363341/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com