0

私はGoogle Maps数日間対処してきましたが、今ではこの奇妙な「バグ」が発生しています。
マップを押すたびに青いマーカーが表示されるリスナーを取得しました...

ただし、ハード ディスクから HTML ファイルを実行した場合にのみ発生します。サーバーを介して実行すると、青いマーカーは表示されません。理由がわかりません。

それを行うコードの部分は次のようになります。

//the listener that activates the function if I click on the map
google.maps.event.addListener(map, 'click', function(event) 
{
    setAddress(event.latLng);
});  

//a global marker - because I want a different one if I press another time on the screen  
var marker2= new google.maps.Marker(
{
    map:map,
    title:"title",
    icon:'blue_markerA.png'
});  

//set the marker to the exact location...  
function setAddress(location) 
{
    var point = new google.maps.LatLng(
    parseFloat(location.lat()),parseFloat(location.lng()));

    marker2.setPosition(point);
}
4

0 に答える 0