Карта отображается правильно в моем браузере, но когда я пробую ее с помощью iOS Simulator (iPhone 6 / iOS 8.3) он просто никогда не загружается: он запускается автоматически и систематически возвращает false в GoogleMaps.loaded() ...
С другой стороны, Геолокация правильно возвращает позицию.
Вот репозиторий, который я настроил, чтобы увидеть всю проблему: https://github.com/Loschcode/meteor-iron -google-maps-issue
Важными строками могут быть настройки пакета GoogleMaps:
Код: Выделить всё
#
# Helpers
#
Template.GeoMap.helpers {
geolocationError: =>
error = Geolocation.error()
return error and error.message
mapOptions: =>
latLng = Geolocation.latLng()
if (Meteor.isCordova)
alert(GoogleMaps.loaded())
# Initialize the map once we have the latLng.
if GoogleMaps.loaded() and latLng
if (Meteor.isCordova)
alert('GoogleMaps.loaded')
return {
center: new google.maps.LatLng(latLng.lat, latLng.lng)
zoom: @MAP_ZOOM
}
}
Код: Выделить всё
#
# onCreated
#
Template.GeoMap.onCreated =>
GoogleMaps.load()
if (Meteor.isCordova)
alert('GoogleMaps.load')
# When it's ready, we process the position
GoogleMaps.ready 'geoMap', (map) =>
# THIS IS NEVER FIRED
ПРИМЕЧАНИЕ. В своем тестовом репозитории я разрешил вызов функции some alert() на iOS, чтобы четко увидеть проблему.
Есть идеи по поводу проблемы? Извините за CoffeeScript и структуру Iron.
Подробнее здесь: https://stackoverflow.com/questions/333 ... -with-iron
Мобильная версия