4
我正在使用谷歌地图地理位置api。我首先在本地测试了它,它在firefox和chrome上的工作文件。当它移动到现场(这不是https),它的工作正常的Firefox,但不工作在铬。收到此错误:谷歌地图地理位置是否需要安全的SSL连接?
Geocoder failed
这里是我的代码:
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
var geocoder;
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(successFunction, errorFunction);
}
//Get the latitude and the longitude;
function successFunction(position) {
var lat = position.coords.latitude;
var lng = position.coords.longitude;
}
function errorFunction() {
alert("Geocoder failed");
}
</script>
Chrome是否需要安全的地理位置SSL连接?
好。为什么它在Firefox上工作?它不需要安全连接? –
@MahaDev目前认为此地理位置功能强大的Chrome浏览器。因此,他们使其不推荐使用。 **其他将遵循**,关于*地理定位,通知,全屏,指针锁定和媒体流API *等功能的讨论将来需要安全的来源。所以是的,还没有用于Firefox。 – choz
太好了,谢谢:) –