我试图在网站中首次嵌入谷歌地图,但我无法显示它。任何人都可以在代码中看到错误。谢谢你;
$(document).ready(function(){
function initMap() {
var location = {lat: 51.594808, lng: 0.084447};
var map = new google.maps.Map(document.getElementById("map"),{
zoom: 4,
center: location
});
var marker = new google.maps.Marker({
position: location,
map: map
});
}
async defer src="https://maps.googleapis.com/maps/api/js…"
});
答案 0 :(得分:0)
new AsyncTask<AIRequest,Void,AIResponse>(){
@Override
protected AIResponse doInBackground(AIRequest... aiRequests) {
final AIRequest request = aiRequests[0];
try {
final AIResponse response = aiDataService.request(aiRequest);
return response;
} catch (AIServiceException e) {
}
return null;
}
@Override
protected void onPostExecute(AIResponse response) {
if (response != null) {
Result result = response.getResult();
String reply = result.getFulfillment().getSpeech();
sendMessage(message);
mimicOtherMessage(reply);
mListView.setSelection(mAdapter.getCount() - 1);
}
}
}.execute(aiRequest);
答案 1 :(得分:0)
这就是这样做的:
document.write("<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3105.150381930865!2d-77.03872384899427!3d38.89767627947038!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x89b7b7bcdecbb1df%3A0x715969d86d0b76bf!2sThe%20White%20House!5e0!3m2!1sen!2sus!4v1614558773335!5m2!1sen!2sus" width="600" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>")
这嵌入了白宫。