Page 1 of 1

Infowindow

PostPosted: 18 Oct 2016 20:40
by assapan
Hi,
When i start my application i always have an empty infowindow on top left of the screen
Image

So far i was calling the following code to hide it
Code: Select all
GoogleMap.JQGMapV3Options.InfoWindow.ResetProps;


but now i use some script in the onDomReady event of the infowindow in order to customize it
Image

unfortunatly when i call resetprops it also clears the script !!!

Image

can anyone help ?

Re: Infowindow

PostPosted: 19 Oct 2016 07:40
by assapan
Hi,
I discover the parameter AEvents for the resetprops procedure :oops: :mrgreen:
but....
if i do in onCreate event the infowindow is still displayed.
Code: Select all
 
  GoogleMap.JQGMapV3Options.InfoWindow.Close;
  GoogleMap.JQGMapV3Options.InfoWindow.ResetProps(False)


but if i do the infowindow disappear but my event script is cleared
Code: Select all
 
  GoogleMap.JQGMapV3Options.InfoWindow.Close;
  GoogleMap.JQGMapV3Options.InfoWindow.ResetProps(True)

Re: Infowindow

PostPosted: 19 Oct 2016 07:52
by assapan
So , it tried to init script by code , it seems that as soon as some data are set in infowindow it is displayed

Re: Infowindow

PostPosted: 19 Oct 2016 16:57
by Alexander Bulei
Hi assapan,

Due to the complexity of your project, I suggest you, to use the premium support ticket, otherwise you can create the simple testcase of that problem, but I checked here and works as expected:

Code: Select all
procedure TFORMTEST.IWAppFormCreate(Sender: TObject);
begin
  IWCGJQGMap31.JQGMapV3Options.Map.Address:= 'Paris, France';
  IWCGJQGMap31.JQGMapV3Options.Map.Options.Zoom:= 10;
  IWCGJQGMap31.JQGMapV3Options.InfoWindow.Address:= 'Paris, France';
  IWCGJQGMap31.JQGMapV3Options.InfoWindow.Options.Content:= 'Works fine...';
end;

procedure TFORMTEST.IWCGJQButton1JQButtonOptionsClick(Sender: TObject; AParams: TStringList);
begin
  IWCGJQGMap31.JQGMapV3Options.InfoWindow.ResetProps(False);
  IWCGJQGMap31.AjaxReRender(True,False);
end;



Best Regards.

Re: Infowindow

PostPosted: 20 Oct 2016 09:34
by assapan
Hi,
here is a test software , to check , in Infowindow.OnDomReady.script i have just set
Code: Select all
function (){
  // just comment
}


If i remove it , infowindow disappear

Re: Infowindow

PostPosted: 21 Oct 2016 08:13
by assapan
Ok so with Alexander's help we found a solution , do not fill event script in design mode , fill it when infowindow is required like this

Code: Select all
  GoogleMap.JQGMapV3Options.InfoWindow.Options.Position.Latitude := Lat;
  GoogleMap.JQGMapV3Options.InfoWindow.Options.Position.Longitude := Lng;
  GoogleMap.JQGMapV3Options.InfoWindow.Options.Content := DonneesMeteo;
  GoogleMap.JQGMapV3Options.InfoWindow.Events.OnDomReady.Script := Infowindowjs;
  GoogleMap.JQGMapV3Options.InfoWindow.ApplyProps;


Thanks Alexander Image