Formda sadece adres belirlemek için Location Sensor kullanıyorum, LG G3 de test için program çalıştırdıktan çok kısa bir süre sonra kapanıyor, bunun sebebi neden olabilir...
Kod: Tümünü seç
procedure TForm1.KonumSensorLocationChanged(Sender: TObject;
const OldLocation, NewLocation: TLocationCoord2D);
var
LDecSeparator: String;
begin
try
LDecSeparator := FormatSettings.DecimalSeparator;
FormatSettings.DecimalSeparator := '.';
Label1.Text := Format('%2.6f', [NewLocation.Latitude]);
Label2.Text := Format('%2.6f', [NewLocation.Longitude]);
if Not Assigned(FGeocoder) then
begin
if Assigned(TGeocoder.Current) then
FGeocoder := TGeocoder.Current.Create;
if Assigned(FGeocoder) then
FGeocoder.OnGeocodeReverse := AdresBilgisi;
end;
if Assigned(FGeocoder) And Not FGeocoder.Geocoding then
FGeocoder.GeocodeReverse(NewLocation);
finally
end;
end;
Kod: Tümünü seç
procedure TForm1.AdresBilgisi(Const Address: TCivicAddress);
begin
Label4.Text := Format('Şehir :%s', [Address.AdminArea]);
Label5.Text := Format('Ülke kodu: %s', [Address.CountryCode]);
Label6.Text := Format('Ülke :%s', [Address.CountryName]);
Label7.Text := Format('No :%s', [Address.FeatureName]);
Label8.Text := Format('Yöre :%s', [Address.Locality]);
Label9.Text := Format('Posta kodu :%s', [Address.PostalCode]);
Label10.Text := Format('Şehir :%s', [Address.SubAdminArea]);
Label11.Text := Format('Mahele veya cadde :%s', [Address.SubLocality]);
Label12.Text := Format('No :%s', [Address.SubThoroughfare]);
Label13.Text := Format('Sokak :%s', [Address.Thoroughfare]);
end;