私はMeteorでhtml5ジオロケーションAPIを使用しようとしています。 私は使用しています: navigator.geolocation.getCurrentPosition(handle_geolocation_query);
私のjsでも動作していないようです - 私はそれがタイマー(http://docs.meteor.com/#timers)制限に関連していると思う流星があります。何かご意見は?HTML5 getCurrentPosition with Meteor
3
A
答えて
2
それはここでロード問題
だった(私は地理的な位置を検出するためのModernizr.jsを使用しています)私のために働いていたコードがある@lashleighおかげ
if (Meteor.is_client) {
Session.set('loc','?');
//alert(Modernizr.geolocation);
function foundLocation(location) {
console.log(location);
Session.set('loc','lat: '+location.coords.latitude+', lan: '+ location.coords.longitude);
}
function noLocation() {
alert('no location');
}
Template.hello.greeting = function() {
var output;
if (Modernizr.geolocation) {
navigator.geolocation.getCurrentPosition(foundLocation, noLocation);
outpout = Session.get('loc');
}
return Session.get('loc');
};
}
+0
甘い!私はあなたがそれを整理することができてうれしいです。 – lashleigh
関連する問題
- 1. Meteor package.js with includes
- 2. Meteor-angular2 with Socket.io
- 3. angular2-meteor with PrimeNG
- 4. Meteor with QUnit
- 5. Ionic2 with Meteor
- 6. this.props(Meteor with Reactチュートリアル)
- 7. html5 Websocket with SSL
- 8. getCurrentPositionは
- 9. cordova admob with meteor 1.4 not working
- 10. HTML5 Canvas with Predefined Image
- 11. Azure AD with HTML5 video
- 12. HTML5 - Amazon S3 with Cloudfront
- 13. PhoneGap getCurrentPositionとwatchPosition
- 14. Googleマップgeolocation getcurrentposition()
- 15. なぜGeolocation HTML5 getCurrentPosition()がGoogleマップで機能していないのですか?
- 16. HTML5と@ font-face with IE
- 17. HTML5 Swiff Fallback with Swf Fallback
- 18. HTML5 with Microsoft Visual Studio 2010
- 19. HTML5 Canvas lines with increase margin
- 20. html5 audio element return src with jquery
- 21. HTML5 TAG ADDRESS mailto with links
- 22. React with Meteorの設定方法は?
- 23. Meteor email with Gsuite、不明なプロトコルのエラー
- 24. Meteor with JSのボタンのテキストを変更
- 25. Meteor 1.4.1.1〜Meteor 1.4.1.2
- 26. getCurrentPosition()は表示されません - javascript
- 27. クロムのgetCurrentPositionがJavaScriptを破る
- 28. CordovaのgetCurrentPositionからの戻り値
- 29. PhoneGap Build 6.3.0 geolocation getCurrentPosition IOSで遅い
- 30. VideoView getCurrentPosition()Acerの不規則性アイコンA200
私は考えることができませんこれらが衝突する理由。私は今流星のアプリで地理位置をテストして、確かにすべてがうまくいきました。ハンドラーで何をしていますか?ハンドラがロード完了していないデータにアクセスしようとしている可能性があります。 – lashleigh