0

ページの 1 つにマップを追加しましたが、コンテンツがコンテナーと一致しません。スタンドアロン ページで同じマップを試したところ、正常に動作しました。

マップは次のように表示されます:ここにリンクの説明を入力してください

マップは実際にはロンドンを中心にしているため、線形の問題のように見えますが、修正できていません。マップを作成する関数は次のとおりです。

function loadMap(){
    geocoder = new google.maps.Geocoder();
    var address = document.getElementById('address').value;
    geocoder.geocode( { 'address': address}, function(results, status) {
    if (status == google.maps.GeocoderStatus.OK) {
        thisLocation = results[0].geometry.location;
        console.log("location = " + thisLocation);
        var tagem = new google.maps.LatLng(thisLocation);
        var mapProp = {
            center:new google.maps.LatLng(51.51121389999999, -0.11982439999997041),
            zoom:5,
            mapTypeId:google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById("googleMap"),mapProp);
        marker = new google.maps.Marker({position:tagem,animation:google.maps.Animation.BOUNCE});
        marker.setMap(map);
    }else{
        console.log('Geocode was not successful for the following reason: ' + status);
    }
    });
}

どんな助けでも大歓迎です。

4

1 に答える 1