みなさん、GeolocationAPIを使用してエンドユーザーを見つけるWebアプリケーションを作成しています。Internet Explorer 9を除いて、私が考えることができるほとんどすべてのプラットフォームでうまく機能します。GoogleツールバーをInternetExplorerのブラウザウィンドウにロードすると、すべてがスムーズに進みます。これが私が扱ってきた問題のあるコードのチャンクです:
if (navigator.geolocation) {
var locationMarker = null;
navigator.geolocation.watchPosition(
function( position ){
var point = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
if (!locationMarker) {
locationMarker = addMarker(
position.coords.latitude,
position.coords.longitude,
"Initial Position"
);
}
else{
updateMarker(
locationMarker,
position.coords.latitude,
position.coords.longitude,
"Updated / Accurate Position"
);
};
map.setCenter(point);
if (map.zoom < 17){
map.setZoom(17);
};
},
function( error ){
console.log( "Something went wrong: ", error );
},
{
timeout: (5 * 1000),
maximumAge: (1000 * 60 * 15),
enableHighAccuracy: true
}
);
}
else {
alert("Geolocation is not supported by this browser");
}
Internet Explorer 9を使用してアプリケーションにアクセスするたびに、「ジオロケーションはこのブラウザーではサポートされていません」というアラートが表示されます。それは、Googleツールバーをアクティブにしていない限りです。ただし、Googleツールバーがアクティブな場合は、Googleツールバーが権限を処理します。
IE9でジオロケーションを機能させるにはどうすればよいですか?私のアプリケーションは、Safari、Firefox、Chrome、iOS、Androidで問題なく動作します。私は完全に困惑しています。
ありがとう、タイラー・ワーリング