Page 1 of 2

Script error

PostPosted: 24 Mar 2014 09:01
by assapan
Hi,
I use a GMap3 to show the meteo for pilots , the name of the airfields are displayed using the data field of markers .
Code: Select all
 
  GoogleMap.JQGMapV3Options.InfoWindow.Close;
  GoogleMap.JQGMapV3Options.InfoWindow.Options.ContentFunc.Script := GoogleMap.CurrEventParamsJs[2] + '.data';
  GoogleMap.JQGMapV3Options.InfoWindow.Anchor.Script := GoogleMap.CurrEventParamsJs[0];
  GoogleMap.JQGMapV3Options.InfoWindow.ApplyProps;
  AfficheTafMetar(True);

This works fine , but i have a button to force the refresh ( reload of database data and re-creation of the markers ) , when i click it i got this message Script Error "$(...)[0].currEventParams is undefined" in Render Async! Processing Full Submit...

can you help please ?

you can see the problem on : http://meteoaero.assapan.fr

Re: Script error

PostPosted: 24 Mar 2014 16:34
by Jorge Sousa
Hi

It would help us a lot if you could set ServerController.JavaScriptOptions (true,true), just for tests, to help tracking the javascript error.

Re: Script error

PostPosted: 24 Mar 2014 16:58
by assapan
Hi,
When i do ServerController.JavaScriptOptions (true,true) i don't error anymore but the map desappear !
I have in the onclick
Code: Select all
procedure TFrm_Meteo.MarkerClick(Sender: TObject; AParams: TStringList);
begin
  AfficheTafMetar(True);
  GoogleMap.JQGMapV3Options.InfoWindow.Close;
  GoogleMap.JQGMapV3Options.InfoWindow.Options.ContentFunc.Script := GoogleMap.CurrEventParamsJs[2] + '.data';
  GoogleMap.JQGMapV3Options.InfoWindow.Anchor.Script := GoogleMap.CurrEventParamsJs[0];
  GoogleMap.JQGMapV3Options.InfoWindow.ApplyProps;

end;

If I suppress the Infowindow lines ( set in comment ) everything works fine ( but i don't have an indicator for the selected airfield )

I have uploaded the modified version so you can try http://meteoaero.assapan.fr

Re: Script error

PostPosted: 24 Mar 2014 18:27
by Jorge Sousa
Hi

What's AfficheTafMetar(True); does ajaxrerender?

For the script you better edit in design-time to see how it looks, because it's missing the 'function (arguments) { } part...

Re: Script error

PostPosted: 24 Mar 2014 19:01
by assapan
Hi,
Please see attached file

Re: Script error

PostPosted: 24 Mar 2014 19:38
by Alexander Bulei
Hi assapan,

I think, i found the problem, will try fix it asap.

Best Regards.

Re: Script error

PostPosted: 24 Mar 2014 19:41
by assapan
Ok Thank you very much let me know when ready

Re: Script error

PostPosted: 25 Mar 2014 18:21
by Jorge Sousa
2.0.0.3443

JQMapV3
- Fixed: javascript error after refreshing/rerender the google maps.
- Changed: The method CurrEventParamsJs.

Tomorrow should be avaialable for download.

Re: Script error

PostPosted: 25 Mar 2014 20:07
by assapan
Thank you very much , i am very impressed by your reactivity :o :o

Re: Script error

PostPosted: 25 Mar 2014 20:39
by Jorge Sousa
Hi

Thank you very much , i am very impressed by your reactivity


Thank you for the feedback, about the reactivity, it's just a matter of not lefting anything behind, the work is the same :)