Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

WebGMaps tests

 Post Reply Post Reply
Author
Jung Michael View Drop Down
New Member
New Member
Avatar

Joined: 02 Jun 2015
Posts: 11
Post Options Post Options   Quote Jung Michael Quote  Post ReplyReply Direct Link To This Post Topic: WebGMaps tests
    Posted: 12 Aug 2015 at 2:19pm

I did a very simple app in Delphi XE8, just a TabControl and a WebGMap on a tab plus a Geocoding component.

1) WebGMap component stays always visible even if switched to other tab at runtime
2) On Windows default location is correct and marker added, but not on iOS:
Default location at wrong position and no marker (simulator and iPhone 5s iOS 8.4)
although geocoding gives correct values ofr latitude / longitude

Have not tested on Android tablet yet but coworker seems to have same problems.

Any hints ?
Thanks in advance!

Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3463
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 12 Aug 2015 at 2:59pm
Hi, 

1) The WebGMaps is based on a native webbrowser that doesn't respond to tab changes. You will need to manually toggle the visible property when the tab changes.

2) To change the location, you can use the MapPanTo method. The default location can only be set once at designtime.

Kind Regards, 
Pieter
Back to Top
Helge Lange View Drop Down
Member
Member
Avatar

Joined: 18 Jun 2015
Posts: 81
Post Options Post Options   Quote Helge Lange Quote  Post ReplyReply Direct Link To This Post Posted: 12 Aug 2015 at 5:00pm
Dear Pieter,

to point 1.) The webbrowser component, no matter if it's native or not, should respect their parent, in this case a TTabItem. If it's invisible, the browser should no be visible either. It seems to be a problem with the OnTop stuff, because we're not able to create overlay controls, the webbrowser puts himself over everything... Not cool :p
I even had the webbrowser as white rectangle visible in my main form when the hostform was without parent

Greetings,
Helge
Back to Top
Helge Lange View Drop Down
Member
Member
Avatar

Joined: 18 Jun 2015
Posts: 81
Post Options Post Options   Quote Helge Lange Quote  Post ReplyReply Direct Link To This Post Posted: 12 Aug 2015 at 5:09pm
for point 2.) The documentation on page 11 uses default location to change the current location in a code snippet which is clearly for run time. Also that snippet works with Win32, but not in iOS as Jung Michael stated.
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3463
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 13 Aug 2015 at 8:38am
This article explains the difference between native and FireMonkey controls: http://www.tmssoftware.com/site/iCLnativeControls.asp
This applies to iCL, but the TTMSFMXWebGMaps also relies on a native UIWebView for iOS.

The on-top "issue" is actually the difference between native and non-native. The native components are real components that are placed as a child of the root view (form). The non-native components such as TabControl is a control that is painted inside the root view, thus cannot hold a native component as it's child. The TWebBrowser uses the same principle yet it manages tab changes internally with the following code in FMX.WebBrowser.pas

procedure TWBFactoryService.RealignBrowsers;
var
  WebBrowser : ICustomBrowser;
begin
  for WebBrowser in FWebBrowsers do
    WebBrowser.UpdateContentFromControl;
end;

which is triggered from FMX.TabControl.pas:

procedure TTabControl.WebBrowserRealign(Sender: TObject);
var
  BrowserManager : IFMXWBService;
begin
  if TPlatformServices.Current.SupportsPlatformService(IFMXWBService, BrowserManager) then
    BrowserManager.RealignBrowsers;
end;

The above code is something that we cannot introduce in our own webbrowser implementation.

Kind Regards, 
Pieter

Back to Top
Helge Lange View Drop Down
Member
Member
Avatar

Joined: 18 Jun 2015
Posts: 81
Post Options Post Options   Quote Helge Lange Quote  Post ReplyReply Direct Link To This Post Posted: 13 Aug 2015 at 2:33pm
The funny thing is, that If I make a TForm (FMX) and put a TMS Webmap on it and that form does not have a parent, the map is shown in blank on the mainform.
If I put the parent then and make the map visible, it wont load anymore anything. Tried everything from Enabled, Visible to Initialize. 


Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3463
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 13 Aug 2015 at 3:24pm
The TTMSFMXWebGMaps needs to be placed directly on the mainform and needs to have an active parent. Only the visible property can hide the map afterwards.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down