Software Archive
Read-only legacy content
17061 Discussions

geolocalizacion en xdk

michell_j_
Beginner
1,129 Views

Hola este ejemplo no me funciona: https://software.intel.com/es-es/html5/articles/intel-xdk-geolocation-sample 

Tengo instalado en windows 7, intel xdk 1536, no lo he actualizado porque la versión que sigue solo trae errores... he perdido el trabajo que desarrollaba, se borran los links de conección entre paginas, se cambian algunos datos etc. 

Me cambié a mac y la version de mac funciona mucho mejor pero estos fallos me siguen saliendo en la version de windows. 

Todavía no logro hacer una simple geolocalización de ubicación (necesito que en forma automática geolocalice mi posición actual), utilicé los ejemplos mas simples de googlemaps html5+javascript y en web funcionan perfectamente, pero al instalarlos en xdk, no arroja datos , el problema radica en que en web hace la consulta que si usted permite ser geolocalizado, y en mobile no lo hace, entonces simplemente no muestra nada... Hice muchas pruebas de diversas formas mezclando codigos y llego a la conclusion de que siempre funciona en web pero en xdk no lo hace, que me falta agregar o cambiar en xdk para que funcione?, puse todo asociado a un boton y tampoco.... ayuda por favor! 

/* button btn_prueba */ 

$(document).on("click", "#btn_prueba", function(evt) 

/* your code goes here */ 
alert("hola2"); 
//geolocalizacion simple// 


if (intel.xdk.geolocation) { 
intel.xdk.geolocation.getCurrentPosition(mostrarUbicacion); 
} else {alert("¡Error! Este navegador no soporta la Geolocalización.");} 



function mostrarUbicacion(position) { 

var latitud = position.coords.latitude; 
var longitud = position.coords.longitude; 


var div = document.getElementById("ubicacion"); 
div.innerHTML = "Latitud: " + latitud + "<br>Longitud: " + longitud; 




function refrescarUbicacion() { 
intel.xdk.geolocation.watchPosition(mostrarUbicacion); 


//fin geolocalizacion simple// 

});

0 Kudos
5 Replies
PaulF_IntelCorp
Employee
1,129 Views
Hello this example does not work me https://software.intel.com/es-es/html5/articles/intel-xdk-geolocation-sample

I installed windows 7 , intel XDK 1536 , I have not updated because the version that still only brings mistakes ... I lost the work progressed, the connection links between pages are deleted , some data changes etc.

I switched to mac and mac version works much better but I keep getting these errors in the version of windows .

I still do not do a simple geo- location ( I need you automatically geolocalice my current position) , I used the simplest examples of googlemaps html5 + javascript and web work perfectly , but when installed on XDK , does not yield data, the problem is that makes web query if you can be geolocated , and mobile does not, then just shows nothing ... I did many tests in various ways by mixing codes and came to the conclusion that always works in web but XDK do not, I'm missing XDK add or change to make it work ?, put everything associated with a button and there .... help please!

Please try using this example to learn how to use the Cordova geolocation functions. Do not use the XDK geolocation functions, they have been deprecated. > https://github.com/xmnboy/hello-cordova

0 Kudos
Seba_N_1
Beginner
1,129 Views

Me pasa lo mismo, econtraste una solucion?

0 Kudos
PaulF_IntelCorp
Employee
1,129 Views

@Seba -- did you try the example at https://github.com/xmnboy/hello-cordova??

0 Kudos
michell_j_
Beginner
1,129 Views

Hola, lamentablemente intel no me dió respuestas adecuadas a mi problema. Tomé una decisión drástica, dejé de trabajar en intel xdk, reestructuré el codigo y lo trabajé con sublime text 2.0, instalé phonegap cordova + ionic y por medio de la consola hago la compilación y luego de un largo etc todo funciona perfecto!, lo mejor es trabajar directo con el codigo, te recomiendo instalar phonegap cordova por consola + node + ionic etc. (busca la documentación) y tus problemas terminarán.

0 Kudos
PaulF_IntelCorp
Employee
1,129 Views

@Michell -- sorry to hear that. Glad to hear you've got things working with the CLI.

0 Kudos
Reply