【发布时间】:2016-01-19 02:09:04
【问题描述】:
我的一个离子页面上有一个谷歌地图。这张地图显示了一个人的住所,我正在使用地理编码器在我的谷歌地图上查看这个地址。
在 Android 上这工作正常,但在 iOS 上我的地图是空白的(白页)。
我认为问题在于由于某种原因没有为地图设置位置,因此地图没有正确呈现。
这段代码用于地址:
geocoder.geocode({'address': $stateParams.location}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
console.log(results);
start = results[0].geometry.location;
map.setCenter(start);
var marker = maps.createMarker(map, results[0].geometry.location, redMarker);
} else {
console.log("Geocode was not successful for the following reason: " + status);
}
});
结果在 iOS 上为空 ([]),但在 Android 上填充了正确的信息。
有人可以帮我解决这个问题吗?
【问题讨论】:
-
尝试在您的设备上使用 gapDebug 进行调试,并向我们显示错误:)
标签: android ios google-maps ionic google-geocoding-api