PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → GPS - Get Latitude and Longitude
GPS - Get Latitude and Longitude
Débuté par adrianoboller, 24 nov. 2014 13:07 - 1 réponse
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 24 novembre 2014 - 13:07
Procedure GPS_Latitude_Longitude()

//Posicao Atual - Latitude Longitude

ok = False
Latitude, Longitude is string = ""

IF GPSStatus() = gpsEnabled OR GPSStatus() = gpsAvailable THEN

pos is geoPosition = GPSGetPosition()

Latitude = pos..Latitude
Longitude = pos..Longitude

gsLatitude = Latitude
gsLongitude = Longitude

//ok = MapDisplayPosition(ControleMapa, pos)

IF ok = False THEN
Latitude = 0
Longitude = 0
END

ELSE IF GPSStatus() = gpsDisabled THEN

Info("GPS Desabilitado!")

ELSE IFGPSStatus() = gpsOffService OR GPSStatus() = gpsUnavailable OR GPSStatus() = gpsError THEN

Info("Região sem serviço de GPS",ErrorInfo())

END
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 24 novembre 2014 - 13:07
Procedure GPS_LatitudeLongitudeAtual(LOCAL DebugSN)

//GPS
Latitude, Longitude, Retorno is string = ""

IF GPSStatus() = gpsEnabled OR GPSStatus() = gpsAvailable THEN

pos is geoPosition = GPSGetPosition()

Latitude = pos..Latitude
Longitude = pos..Longitude


gsLatitude = Latitude
gsLongitude = Longitude

IF ok = False THEN
Latitude = 0
Longitude = 0
END

ELSE IF GPSStatus() = gpsDisabled THEN

IF DebugSN = "S"
Info("GPS Desabilitado!")
END

Latitude = 0
Longitude = 0

ELSE IFGPSStatus() = gpsOffService OR GPSStatus() = gpsUnavailable OR GPSStatus() = gpsError THEN

IF DebugSN = "S"
Info("Região sem serviço de GPS",ErrorInfo())
END

Latitude = 0
Longitude = 0

END

Retorno = Latitude +";"+ Longitude

RESULT(Retorno)