PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 24 → GPS - Address of a monument - Endereço de um monumento
GPS - Address of a monument - Endereço de um monumento
Débuté par adrianoboller, 24 nov. 2014 13:14 - Aucune réponse
Membre enregistré
2 958 messages
Popularité : +89 (91 votes)
Posté le 24 novembre 2014 - 13:14
Procedure GPS_LocalizaEnderecoMonumento(LOCAL ControleMapa, LOCAL EnderecoMonumento, LOCAL TipoRetorno, LOCAL WindowSN)

ok = False

Retorno is string = ""
MyAddress is Address
MyAddress = geoGetAddress(EnderecoMonumento)

Pos is geoPosition
Pos.Latitude = MyAddress..Position.Latitude
Pos.Longitude = MyAddress..Position.Longitude

IF ControleMapa = "" THEN
ControleMapa = gloControleMapa
END

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

IF ErrorOccurred = True THEN

IF TipoRetorno = 1 THEN
IF WindowSN = "S"
Info(MyAddress..AdminArea)
END
Retorno = MyAddress..AdminArea
ELSE IF TipoRetorno = 2 THEN
IF WindowSN = "S"
Info(MyAddress..City)
END
Retorno = MyAddress..City
ELSE IF TipoRetorno = 3 THEN
IF WindowSN = "S"
Info(MyAddress..Country)
END
Retorno = MyAddress..Country
ELSE IF TipoRetorno = 4 THEN
IF WindowSN = "S"
Info(MyAddress..Label)
END
Retorno = MyAddress..Label
ELSE IF TipoRetorno = 5 THEN
IF WindowSN = "S"
Info(MyAddress..Position)
END
Retorno = MyAddress..Position
ELSE IF TipoRetorno = 6 THEN
IF WindowSN = "S"
Info(MyAddress.Position..Altitude)
END
Retorno = MyAddress.Position..Altitude
ELSE IF TipoRetorno = 7 THEN
IF WindowSN = "S"
Info(MyAddress.Position..AltitudeValid)
END
Retorno = MyAddress.Position..AltitudeValid
ELSE IF TipoRetorno = 8 THEN
IF WindowSN = "S"
Info(MyAddress.Position..Direction)
END
Retorno = MyAddress.Position..Direction
ELSE IF TipoRetorno = 9 THEN
IF WindowSN = "S"
Info(MyAddress.Position..DirectionValid)
END
Retorno = MyAddress.Position..DirectionValid
ELSE IF TipoRetorno = 10 THEN
IF WindowSN = "S"
Info(MyAddress.Position..Latitude)
END
Retorno = MyAddress.Position..Latitude
ELSE IF TipoRetorno = 11 THEN
IF WindowSN = "S"
Info(MyAddress.Position..Longitude)
END
Retorno = MyAddress.Position..Longitude
ELSE IF TipoRetorno = 12 THEN
IF WindowSN = "S"
Info(MyAddress.Position..MeasurementDate)
END
Retorno = MyAddress.Position..MeasurementDate
ELSE IF TipoRetorno = 13 THEN
IF WindowSN = "S"
Info(MyAddress.Position..PositionValid)
END
Retorno = MyAddress.Position..PositionValid
ELSE IF TipoRetorno = 14 THEN
IF WindowSN = "S"
Info(MyAddress.Position..Precision)
END
Retorno = MyAddress.Position..Precision
ELSE IF TipoRetorno = 15 THEN
IF WindowSN = "S"
Info(MyAddress.Position..PrecisionValid)
END
Retorno = MyAddress.Position..PrecisionValid
ELSE IF TipoRetorno = 16 THEN
IF WindowSN = "S"
Info(MyAddress.Position..Speed)
END
Retorno = MyAddress.Position..Speed
ELSE IF TipoRetorno = 17 THEN
IF WindowSN = "S"
Info(MyAddress.Position..SpeedValid)
END
Retorno = MyAddress.Position..SpeedValid
ELSE IF TipoRetorno = 18 THEN
IF WindowSN = "S"
Info(MyAddress..Street)
END
Retorno = MyAddress..Street
ELSE IF TipoRetorno = 19 THEN
IF WindowSN = "S"
Info(MyAddress..Type)
END
Retorno = MyAddress..Type
ELSE IF TipoRetorno = 20 THEN
IF WindowSN = "S"
Info(MyAddress..ZipCode)
END
Retorno = MyAddress..ZipCode
ELSE IF TipoRetorno = 21 THEN
Retorno = MyAddress..AdminArea +";"+ MyAddress..City+";"+ MyAddress..Country+";"+ MyAddress..Label +";"+...
MyAddress..Position +";"+ MyAddress.Position..Altitude +";"+ MyAddress.Position..AltitudeValid +";"+...
MyAddress.Position..Direction +";"+ MyAddress.Position..DirectionValid +";"+ MyAddress.Position..Latitude +";"+...
MyAddress.Position..Longitude +";"+ MyAddress.Position..MeasurementDate +";"+ MyAddress.Position..PositionValid +";"+...
MyAddress.Position..Precision +";"+ MyAddress.Position..PrecisionValid +";"+ MyAddress.Position..Speed +";"+...
MyAddress.Position..SpeedValid +";"+ MyAddress..Street +";"+ MyAddress..Type +";"+ MyAddress..ZipCode
ELSE IF TipoRetorno = 22 THEN
IF WindowSN = "S"
Info(MyAddress.Position..Latitude +"; "+ MyAddress.Position..Longitude)
END
Retorno = MyAddress.Position..Latitude +"; "+ MyAddress.Position..Longitude
ELSE IF TipoRetorno = 23 THEN
IF WindowSN = "S"
Info("Latitude: "+MyAddress.Position..Latitude +"; Longitude: "+ MyAddress.Position..Longitude)
END
Retorno = "Latitude: "+MyAddress.Position..Latitude +"; Longitude: "+ MyAddress.Position..Longitude
ELSE IF TipoRetorno = 24 THEN //Endereço Completo
IF WindowSN = "S"
Info(MyAddress..Label + "; " + MyAddress..Street + ";" + MyAddress..City + ";" + MyAddress..Country + ";" + MyAddress..ZipCode + ";"+MyAddress.Position..Latitude +";"+ MyAddress.Position..Longitude)
END
Retorno = MyAddress..Label + "; " + MyAddress..Street + ";" + MyAddress..City + ";" + MyAddress..Country + ";" + MyAddress..ZipCode + ";"+MyAddress.Position..Latitude +";"+ MyAddress.Position..Longitude
ELSE IF TipoRetorno = 25 THEN //Endereço Completo
IF WindowSN = "S"
Info("Local: " + MyAddress..Label + "; Endereço: " + MyAddress..Street + "; Cidade: " + MyAddress..City + "; País: " + MyAddress..Country + "; CEP: " + MyAddress..ZipCode + "; Latitude: "+MyAddress.Position..Latitude +"; Longitude: "+ MyAddress.Position..Longitude)
END
Retorno = "Local: " + MyAddress..Label + "; Endereço: " + MyAddress..Street + "; Cidade: " + MyAddress..City + "; País: " + MyAddress..Country + "; CEP: " + MyAddress..ZipCode + "; Latitude: "+MyAddress.Position..Latitude +"; Longitude: "+ MyAddress.Position..Longitude
END

ELSE
IF WindowSN = "S"
Info("Endereço não encontrado")
END
Retorno = "Endereço não encontrado"
END

ok = MapDisplayPosition(ControleMapa, Pos)

IF ok = True THEN
IF WindowSN = "S" THEN
Info("Posição detectada")
END
Retorno = "Posição detectada"
ELSE
IF WindowSN = "S" THEN
Info("Posição não foi detectada")
END
Retorno = "Posição não foi detectada"
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

RESULT(Retorno)