Google マップの動作が前日とは異なる理由を整理しようとしています。
最近、顧客のウェブサイトをオンラインにしました。地理位置情報にエラーがあり、修正しました。テストサイトで修正しませんでした。
今日、両方の側 (固定側とテスト側) で、私の地理位置情報がアフリカの中心で検索された場所を表示し始めました。私は何が起こっているのか本当に無知です。それは機能しますが、次の日は機能しません。
YellowPin の表示も停止したとは言いませんが、なぜですか?
var map;
var mapOptions;
var markerOwn = null;
function searchLocations()
{
var address = document.getElementById('addressInput').value;
var geocoder = new google.maps.Geocoder();
geocoder.geocode({address: address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK){
if(markerOwn === null){
markerOwn = new google.maps.Marker({
map: map,
position: new google.maps.LatLng(50, 20),
customInfo: "<br><center><b>Jesteś Tutaj!</b></center>",
flat: false,
icon: 'https://maps.gstatic.com/mapfiles/ms2/micons/ylw-pushpin.png', // user :)
title: "Twoja lokacja",
});
addInfoWindow(markerOwn);
}
markerOwn.setPosition( new google.maps.LatLng(results[0].geometry.location.ob, results[0].geometry.location.pb ) );
google.maps.event.trigger(markerOwn,'click');
map.panTo(results[0].geometry.location);
}
});
}
ここでコードの動作を確認できます: http://spafoodbistro.pl/index.php?page=gdzie-jestesmy
編集:以前に変更したのは
markerOwn.setPosition( new google.maps.LatLng(results[0].geometry.location.ob, results[0].geometry.location.pb ) );
以前は別の値を使用して座標を取得していましたが、現在は次を使用しています。
results[0].geometry.location.ob to get it.
なぜそれが変わるのですか?前回変更して以来、それが間違っているのでしょうか?