LocationLabel Lat / Lon

Hi !

 
Is there a way to set the Lat / Lon on the LocationLabel in Runtime ?
 
I can't get it to work, this is what i done sofar :
 
- I set the LAT / LON is Designtime
 
- Run the App
 
- OnAsyncItemClick (From PhoneList) i set a DIFFERENT LAT / LON to the LocationLabel
 
- At clicking on the LocationLabel , it goes to Google Maps, BUT.....
with the LAT / LON set in DesignTime, not the LAT / LON i set on a
AsyncClick in Runtime.
 
This is what i used :
 
 TIWIPhoneLocationLabel1.Latitude  := StrToFloat(Trim(xlat));
 TIWIPhoneLocationLabel1.Longitude := StrToFloat(Trim(xlon));
 
Then, at the OnAsyncClick of the Locationlabel, i set this code :
 
procedure TIWForm1.TIWIPhoneLocationLabel1AsyncClick(Sender: TObject;
  EventParams: TStringList);
begin
    IWMemo1.Lines.Add(FloatToStr(TIWIPhoneLocationLabel1.Latitude));
    IWMemo1.Lines.Add(FloatToStr(TIWIPhoneLocationLabel1.Longitude));
end;
 
The values showed in the IWMemo are the ones i set in RunTime,
but it shows the location in Google Maps i set in DesignTime ?!
 
Am i using it wrong, or is this a bug ?
 
Thanks !
 
Paul
 

Hi,


Can you try calling Invalidate after updating the IWiPhoneLocationLabel properties?

Example:

  TIWIPhoneLocationLabel1.Latitude  := StrToFloat(Trim(xlat)); 
  TIWIPhoneLocationLabel1.Longitude := StrToFloat(Trim(xlon));
  TIWIPhoneLocationLabel1.Invalidate;

Hi Bart,

 
That's it !  Nice.
 
Was there a way to have known this myself by manual orso ?
 
Thanks !
 
Paul
Hi Paul,

The invalidate call is not specifically for the IWiPhoneLocationLabel control.
It's available in most IntraWeb controls to force the control to update it's property values.

I've also done an update in the IWiPhoneLocationLabel control to call Invalidate internally so you won't need to call it manually anymore.
The update will be available with the next release of the TMS IW iPhone controls pack.
Bart Holvoet2011-06-20 08:28:58

Hi Bart !

 
Oke great !
 
Thanks for the info.
 
Cheers