WebGMaps tests


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!

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

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

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.

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

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. 


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.