Page 1 of 2

GMap3 Controls don't show

PostPosted: 12 Dec 2017 16:24
by Omega8
Hello,

I have the following code. The controls in the maps are not showing but the map shows along with marker.

with IWCGJQGMap3EX1.JQGMap3EXOptions do
begin
Map.Options.Zoom:= 14;
Map.Options.Center.Latitude:= ALat;
Map.Options.Center.Longitude:= ALon;
Map.Options.Draggable:= TRUE;
Map.Options.ClickableIcons:=TRUE;
Map.Options.FullscreenControl:=TRUE;
Map.Options.FullscreenControlOptions.Position:='TOP_RIGHT';
Map.Options.MapTypeControl:=TRUE;
Map.Options.MapTypeId:='ROADMAP';
Map.Options.MapTypeControlOptions.Position:='TOP_LEFT';
Map.Options.ScrollWheel:=TRUE;
Map.Options.StreetViewControl:=TRUE;
Map.Options.ZoomControl:=TRUE;
end;
with IWCGJQGMap3EX1.JQGMap3EXOptions do
begin
Markers.Items.Clear;
with Markers.Items.Add do
begin
Position.Latitude:= ALat;
Position.Longitude:= ALon;
MarkerLabel.Text:=ATitle;
end;
end;
end;

procedure TGoogleMapsDialog.IWFrameRegionJQDialogOptionsOpen(Sender: TObject; AParams:TStringList);

begin
inherited;
IWCGJQGMap3EX1.AjaxReRender(TRUE,FALSE);
end;

What am I doing wrong?

Thanks

Re: GMap3 Controls don't show

PostPosted: 12 Dec 2017 16:41
by Jorge Sousa
Hi

Please put that code in a test case demo, and ill let you know

Re: GMap3 Controls don't show

PostPosted: 12 Dec 2017 18:09
by Omega8
Ok I have put in rar. You need to put an api key.

Eventhough Googleloader is assigned, I still get 'google not defined error'

Thanks

Re: GMap3 Controls don't show

PostPosted: 12 Dec 2017 18:22
by Jorge Sousa
Hi

Thanks

First of all, about

Eventhough Googleloader is assigned, I still get 'google not defined error'


and without even checking in detail your test case

You have to put GoogleLoader in a TIWAppForm, see our demo

Re: GMap3 Controls don't show

PostPosted: 12 Dec 2017 18:40
by Omega8
ok. thanks. That fixed everything.

Re: GMap3 Controls don't show

PostPosted: 12 Dec 2017 19:35
by Omega8
I have the libloader in IWForm and pass it to a dialog with Gmaps3ex. The controls still dont show. If I put the gmaps3x on a form than it works.

For multiple gmaps, should I use multiple loaders or one loader for all?

Thx

Re: GMap3 Controls don't show

PostPosted: 13 Dec 2017 11:18
by Jorge Sousa
Hi

Your demo works fine for me

about

for multiple gmaps, should I use multiple loaders or one loader for all?


you only need one.

there is an optimization in your demo that i cannot avoid referring, which is the following:

Code: Select all
uses
  IWCGJQCommon;

procedure TIWForm1.IWCGJQButton1JQEventsClick(Sender: TObject;AParams: TStringList);
begin
  // Disabling unnecessary javascript generation since we are using AjaxReRender
  CGCallBackDisableAjaxResponse;
  try
    FGoogleMapsDialog:=TFlexiFlyGoogleMapsDialog.Create(Self);
    FGoogleMapsDialog.IWCGJQGMap3Ex1.GoogleLibLoader:=IWCGGoogleLibLoader1;
    FGoogleMapsDialog.Parent:= IWCGJQRegion1;
    FGoogleMapsDialog.InitilizeGoogleMapsEx(46.794544, 11.930016,'Bruneck');
    FGoogleMapsDialog.Visible:=TRUE;
  finally
     CGCallBackEnableAjaxResponse;
  end;

  IWCGJQRegion1.AjaxReRender;
 // IWCGGoogleLibLoader1.AjaxReRender;  Nothing has changed on Loader to justify this }
end;

Re: GMap3 Controls don't show

PostPosted: 13 Dec 2017 16:45
by Omega8
Hello Jorge

I've done the changes and the controls still dont show. You can see here http://www.wingover-automation.ch:1234
The map shows but not the controls in it like zoom in, zoom out etc. I set all relevent options to true.

Thank you
Can

Re: GMap3 Controls don't show

PostPosted: 13 Dec 2017 17:32
by Jorge Sousa
Hi

I wouldn't never guessed what you meant by controls, now i know that are the zoom in and zoom out elements

Ok ill continue checking

Re: GMap3 Controls don't show

PostPosted: 14 Dec 2017 12:54
by Jorge Sousa
Hi

Yes, in fact there is an error when ServerController.JavaScriptOptions.Debug = False (default value)

Can you please and set Debug = True to see how it goes? tia