navigator

Saving variables outside of navigator.geolocation.getCurrentPosition? (javascript)

限于喜欢 提交于 2019-11-30 20:41:32
I'm trying to play with the scope of js to pull a variable out of navigator.geolocation.getCurrentPosition var lat; function callback (position) { lat = position.coords.latitude; } navigator.geolocation.getCurrentPosition(callback,fail,{timeout:10000}); // after getCurrentPosition succeeds alert(lat); // this alerts null The above code cannot store position.coords.latitude in the lat variable because of the scope. Is there a way to do this? You have to remember the async\ajax nature. this is the execution order of your code: var lat; alert(lat); // this alerts null navigator.geolocation

unknown type name in objective c

安稳与你 提交于 2019-11-30 17:14:49
I'm pretty new to objective c, and having some basic problems. I wrote a simple program using a navigator, and everything worked fine. then I added few lines of code (can't even remember what exactly, and it seems to have no connection to the problem) and the problem occurred. I tried ctrl+z, and the problem remained: I run the program and get these errors: 1. unknown type name "mainController" 2. property with 'retain (or strong)' attribute must be of object type while mainController is the first screen to be loaded. This is the appDelegate.h file: #import <UIKit/UIKit.h> #import

navigator.geolocation.getCurrentPosition do not work in Firefox 30.0

送分小仙女□ 提交于 2019-11-30 13:49:19
I am using Firefox 30.0(latest FF), navigator.geolocation.getCurrentPosition is working in Chrome but not in this version of FF. Here is my code if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(GEOprocess, GEOdeclined); }else{ alert('Your browser sucks. Upgrade it.'); } function GEOdeclined(error) { alert('Error: ' +error.message); } function GEOprocess(position) { alert('it works'); } I am getting this error Error: Unknown error acquiring position Note: It stoped working only when i upgrade my FF to 30.0 Vasyl Gutnyk Now I'm using 47 Mozilla. I have tried everything, but

Launching Google Maps and Navigator from Android App

北城余情 提交于 2019-11-30 07:44:13
I have an android application which allows the user to open up google maps or navigator to show a certain address. This functionality was working in the past, but now I get the following error and the app crashes: ERROR/AndroidRuntime(2165): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=google.navigation:q=MCNAMARA+TERMINAL+ROMULUS+MI+48174 } The two intents I'm using are- 1) For Map: String uri = "geo:0,0?q=MCNAMARA+TERMINAL+ROMULUS+MI+48174"; Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(uri)); startActivity(i); 2)

Saving variables outside of navigator.geolocation.getCurrentPosition? (javascript)

自作多情 提交于 2019-11-30 04:44:15
问题 I'm trying to play with the scope of js to pull a variable out of navigator.geolocation.getCurrentPosition var lat; function callback (position) { lat = position.coords.latitude; } navigator.geolocation.getCurrentPosition(callback,fail,{timeout:10000}); // after getCurrentPosition succeeds alert(lat); // this alerts null The above code cannot store position.coords.latitude in the lat variable because of the scope. Is there a way to do this? 回答1: You have to remember the async\ajax nature.

Generating Flutter route after action?

三世轮回 提交于 2019-11-29 18:09:34
I'm trying to automatically route back to my menu screen after a successful login and I'm having trouble generating a Widget build and/or context. I'm doing this in a Stateless Widget. Here is my code. I would like to call route after the last print statement... Future<Null> _handleSignIn() async { try { await _googleSignIn.disconnect(); GoogleSignInAccount googleUser = await _googleSignIn.signIn(); GoogleSignInAuthentication googleAuth = await googleUser.authentication; print(googleAuth.idToken); await FirebaseAuth.instance.signInWithGoogle(idToken: googleAuth.idToken, accessToken: googleAuth

js geolocation but without prompting - possible?

大兔子大兔子 提交于 2019-11-29 11:54:24
Is it possible to get the geolocation of a user without the browser prompt? Here's the code sample from W3 <script> var x = document.getElementById("demo") function getLocation(){ if(navigator.geolocation){ navigator.geolocation.getCurrentPosition(showPosition); } else { x.innerHTML="Geolocation is not supported by this browser.";} } function showPosition(position){ x.innerHTML="Latitude: " + position.coords.latitude + "<br>Longitude: " + position.coords.longitude; } </script> Is there any preventPrompt() -like function ? No you cant prevent the prompt, its a security feature cause not every

React Native, NavigatorIOS, undefined is not an object (evaluating 'this.props.navigator.push')

别等时光非礼了梦想. 提交于 2019-11-29 10:03:40
I'm trying to use NavigatorIOS so in my index.ios.js I got: 'use strict'; var React = require('react-native'); var Home = require('./App/Components/Home'); var { AppRegistry, StyleSheet, NavigatorIOS } = React; var styles = StyleSheet.create({ container:{ flex: 1, backgroundColor: '#111111' } }); class ExampleApp extends React.Component{ render() { return ( <NavigatorIOS style={styles.container} initialRoute={{ title: 'example', component: Home }} /> ); } }; AppRegistry.registerComponent('exampleapp', () => ExampleApp); module.exports = ExampleApp; And then in the Home.js : 'use strict'; var

Chrome navigator.geolocation.getCurrentPosition() error 403

此生再无相见时 提交于 2019-11-28 08:54:21
For some reason suddenly when calling navigator.geolocation.getCurrentPosition() I get this error: Network location provider at 'https://www.googleapis.com/' : Returned error code 403. It used to work perfectly yesterday! Could there be anything with their servers?? It appears it is back up now. But before I realized it was working, I used another way to get location data as recommended by another user on reddit.com var latLong; $.getJSON("http://ipinfo.io", function(ipinfo){ console.log("Found location ["+ipinfo.loc+"] by ipinfo.io"); latLong = ipinfo.loc.split(","); }); Source: https://www

jqGrid navigator - how to specyfy settings globally?

让人想犯罪 __ 提交于 2019-11-28 01:41:43
I'm using Navigator with jqGrid and I'm repeating over and over settings such as: savekey: [true, 13], closeOnEscape: true, closeAfterAdd: true How can I define these settings globally to all my grids on current page? I know how to specyfiy jqGrid settings globally, but I have problems with Navigator. My sample Navigator definition looks like this: $("#dictionaryElementsGrid").navGrid( "#dictionaryElementsPager", { search: false, edit: true, add: true, del: true }, { // Edit options: savekey: [true, 13], closeOnEscape: true, closeAfterEdit: true }, { // Create options: savekey: [true, 13],