[英]Google maps isn`t showing properly
當我嘗試在瀏覽器中運行此代碼時,會出現google maps窗口,但衛星或地圖圖像無法正確顯示。 我幾乎看不到地圖或衛星圖像。
<DOCTYPE html>
<html lang="no">
<head>
<title>Kontakt</title>
<meta charset="utf-8">
<link rel="stylesheet type=text/css" href="stylesheetfgross.css">
</head>
<body>
<header>
<h1>Kontakt</h1>
</header>
<div id="map" style="width:400px;height:400px">
<script>
function myMap() {
var mapOptions = {
center: new google.maps.LatLng(59.234389, 11.137546),
zoom: 10,
mapTypeId: google.maps.MapTypeId.HYBRID
}
var map = new google.maps.Map(document.getElementById("map"), mapOptions);
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?callback=myMap"></script>
</body>
我剛剛從您的代碼中刪除了function myMap()
,並且Google腳本現在看起來像這樣: <script src="https://maps.googleapis.com/maps/api/js"></script>
,剛剛從網址,現在可以使用。 檢查jsFiddle
我用了這個,對我有用。
<iframe width="600" height="450" frameborder="0" style="border:0"
src="key" allowfullscreen="">
</iframe>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.