Consulta sobre NeoMap - Forum

Forum Navigation
You need to log in to create posts and topics.

Consulta sobre NeoMap

Page 1 of 2Next

@luishp

Tengo ganas de experimentar este plugin un poco, no encontre ninguna app de muestra

Me pregunto se podria hacer un seguimiento tipo rastreador del recorrido desde un punto a otro , poniendo marcas que se vayan guardando?, saber la distancia? y luego poder ver esos puntos guardados en el mapa?

Tipo las aplicaciones que se usan para running o seguimiento vehicular, que se puede ver el recorrido hecho en el mapa

@gustavo1973 aquí hay información de interés y ejemplos:
https://visualneo.com/forum/topic/neomap-plugin-coming-soon

@luishp

estoy mirando los ejemplos, lo que intento hacer es correr la aplicacion en el movil, para tomar el gps del mismo,  tomar las coordenadas de latitud y longitud mediante "neoGetPosition" cada tantos segundos y agregando marcadores en el mapa con estas coordenadas recibidas.

El problema es que las agrega no en lugares exactos, si voy caminando de a ratos agrega marcadores en otros lugares y no donde deberia hacerlo, hay que convertir estos valores antes de mostrarlos?

Detalle, al agregar los marcadores dejo los datos recibidos con todos sus valores despues de la coma, supongo que esto le da mas exactitud?

@gustavo1973 es importante entender que al dispositivo puede tomarle algún tiempo detectar una posición correcta desde que se le concede permiso al GPS. Esto es crucial para conseguir mejor precisión.

Seguramente, para lo que tu quieres hacer, sería interesante explorar watchPosition() de JavaScript en lugar de neoGetPosition, ya que la primera toma coordenadas de posición constantemente y la precisión después de unos segundos proporciona estimaciones de unos pocos metros.

Más información aquí:
https://dev.to/m3h0w/how-to-get-an-accurate-position-estimate-from-the-geolocation-api-in-javascript-1njf

Saludos.

@luishp

Mis conocimientos de Java son nulos por desgracia, Deberia usar esos codigos mediante "BeginJS" aqui en Visual Neo?

Hi @gustavo1973

use this code in a button for example (output in consolelog):

beginjs
if (navigator.geolocation) {
//navigator.geolocation.getCurrentPosition(mostraPosizione);
navigator.geolocation.watchPosition(mostraPosizione);
}

function mostraPosizione(posizione) {
console.log("Latitudine: " + posizione.coords.latitude);
console.log("Longitudine: " + posizione.coords.longitude);
}
endjs

luishp has reacted to this post.
luishp

@gustavo1973 try this sample app in attach

 

"watchPosition() method is used to register a handler function that will be called automatically each time the position of the device changes. You can also, optionally, specify an error handling callback function."

from https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/watchPosition

Uploaded files:
  • You need to login to have access to uploads.
luishp and Vadim have reacted to this post.
luishpVadim

Thanks @roccocogliano, I will add this command to the next version.
Best regards.

Vadim, CDY@44 and roccocogliano have reacted to this post.
VadimCDY@44roccocogliano

@roccocogliano @luishp

Gracias por la ayuda, hize un demo ahi con tu codigo y funciona, pero no de la manera esperada

en teoria al ir moviendote con el mocil se va creando la linea de movimiento

fijate aqui:

https://aplicacionesuy.com/gps

Uploaded files:
  • You need to login to have access to uploads.

@gustavo1973 esto es lo que veo en la consola:

Error: Invalid LatLng object: (undefined, undefined)

Hi @gustavo1973  you don't need a timer. "watchPosition" updates the position itself when it changes.
Look at this simple example.
New markers are added each time the position changes.

 

Uploaded files:
  • You need to login to have access to uploads.
luishp and Vadim have reacted to this post.
luishpVadim

@roccocogliano

Gracias por tu ayuda, funciona muy bien asi

roccocogliano has reacted to this post.
roccocogliano

@gustavo1973

Well. I'm glad

luishp has reacted to this post.
luishp

@luishp @roccocogliano

Sigo haciendo pruebas y me encuentro con lo siguiente que no se si tiene solucion

el rastreo si bien lo hace relativamente bien, de a ratos pega como saltos raros a coordenadas que no son, en las imagenes que adjunto se puede ver ese problema

Tambien pasa que si dejo la app en segundo plano corriendo mientras hago otra cosa, ya no marca las coordenadas, al ingresar a ella nuevamente me hace una linea recta entre la ultima posicion y la nueva, puede tener solucion eso?

Vi en el ejemplo que se subio al principio del post en el link donde se mostraba el codigo java para poder tomar la posicion que tenia en cuenta la exactitud al momento de mostrar el dato o no, algo asi como que mide la intensidad de la señal

I keep doing tests and I find the following that I do not know if it has a solution

The tracking although it does it relatively well, from time to time it hits like strange 
jumps to coordinates that are not, in the images that I attach you can see that problem

It also happens that if I leave the app in the background running while I do something else, 
it no longer marks the coordinates, when entering it again it makes me a straight line between 
the last position and the new one, can that have a solution?

I saw in the example that was uploaded at the beginning of the post in the link where 
the java code was shown to be able to take the position that took into account the accuracy 
at the time of displaying the data or not, something like that measures the intensity of the signal

 

 

Uploaded files:
  • You need to login to have access to uploads.

@gustavo1973 @luishp

The fact that the app registers incorrect coordinates I think depends on the device. Probably the localization takes place via agps and therefore uses both gps and internet and therefore, perhaps, when it does not retrieve the coordinates from the gps it does so through the cell to which it is connected. The fact that when the app is in the background it does not record the coordinates is perhaps due to the fact that the apps are not normally active in the background. For example, it happens to me that if I use google maps in the background it does not update automatically but only when I reopen it.
But these are just my assumptions and I have no solution about it,

I'm sorry.

 

@gustavo1973 creo que es posible obtener junto con las coordenadas una estimación del error de posicionamiento, pero tengo que investigarlo. Me lo apunto para cuando tenga tiempo y ver así si se puede mejorar la funcionalidad de geoposicionamiento.

Dejo este artículo como referencia de lo que es posible hacer:
https://www.atyantik.com/geolocation-using-javascript/

Saludos!

Vadim and roccocogliano have reacted to this post.
Vadimroccocogliano

Hello @gustavo1973 ,
for better accuracy you can use "highaccurancy"
in the watchposition options (take a look at https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition) but for the problem of not detecting when the app is in the background I have no idea how to solve.

luishp has reacted to this post.
luishp

@gustavo1973 @roccocogliano I have updated the geolocation plugin to include additional commands and options.
Please, if you have time, take a moment to test it (attached) and let me know if it works for you.
I have included high accuracy and watch for position change options.
Theorically it's possible to get altitude and speed too. Do you think those options are interesting enough to include them?

Thank you!

Uploaded files:
  • You need to login to have access to uploads.
roccocogliano has reacted to this post.
roccocogliano

I have just published a very simple testing app here:
https://visualneo.com/tutorials/geolocation

Source code attached.

Regards.

Uploaded files:
  • You need to login to have access to uploads.
Vadim and roccocogliano have reacted to this post.
Vadimroccocogliano

Hi luis, thank you very much.

I will try it as soon as possible for sure.

luishp has reacted to this post.
luishp
Page 1 of 2Next