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

OnMarkerClick Error with Modal Dialog

 Post Reply Post Reply
Author
Moorhouse David View Drop Down
New Member
New Member
Avatar

Joined: 16 Mar 2017
Posts: 9
Post Options Post Options   Quote Moorhouse David Quote  Post ReplyReply Direct Link To This Post Topic: OnMarkerClick Error with Modal Dialog
    Posted: 10 Jun 2017 at 2:18am
Hi

I am trying to create a windows FMX app with the trial version of TTMSFMXWebGMaps. I can successfully programmatically add markers to the map. I have added an OnMarkerClick event handler to the map in which I want to display a modal child window.  All fairly standard Delphi stuff :)

The problem is when the modal child form displays the content of the map display on the main form is replaced by the text "blank{5C5E4C6F-855F-4744-8D33-42AFE5A06F98}"  Note that the GUID part changes depending on which marker I click.

What do I need to do to avoid this ?

BTW, loving the component, not sure whether to buy the full suite or just the GMaps one.

Relevant code snippet is

procedure TMainForm.TMSFMXWebGMaps1MarkerClick(Sender: TObject; MarkerTitle: string; IdMarker: Integer;  Latitude, Longitude: Double);
var
  Details: TfrmDetails;
begin
  Details := TfrmDetails.Create(nil);
  try
    Details.ShowModal;
  finally
    Details.Free;
  end;
end;


Back to Top
Moorhouse David View Drop Down
New Member
New Member
Avatar

Joined: 16 Mar 2017
Posts: 9
Post Options Post Options   Quote Moorhouse David Quote  Post ReplyReply Direct Link To This Post Posted: 10 Jun 2017 at 7:33am
I've tried a work around which is to use a minimised TPanel component and adjust its size when a map marker is clicked so the panel can show the extended details for the marker. These details are retrieved from my database.  This work ok.

However when I use a TComboBox control on the panel - if I click on the combobox I get the same error showing on the map.

Here is the details panel and map before selecting the combobox.



Here is the same part of the screen after clicking the combobox - the map has dssappeared and been replaced by the error message.



I need the user to be able to select from a list of values. Is there another work around ?

Thanks

David

Back to Top
Moorhouse David View Drop Down
New Member
New Member
Avatar

Joined: 16 Mar 2017
Posts: 9
Post Options Post Options   Quote Moorhouse David Quote  Post ReplyReply Direct Link To This Post Posted: 10 Jun 2017 at 7:34am
Pasted images seem to have been removed from my second post.The problem is very real though.
Back to Top
Moorhouse David View Drop Down
New Member
New Member
Avatar

Joined: 16 Mar 2017
Posts: 9
Post Options Post Options   Quote Moorhouse David Quote  Post ReplyReply Direct Link To This Post Posted: 10 Jun 2017 at 8:32am
OK, I attached the debug console and have inspected the DOM.  It looks like what is dispayed is the path for the browser window's Location property i.e. the full URL before and after clicking on the combobox is "about:blank{5C5E4C6F-855F-4744-8D33-42AFE5A06F98}"

Hence it appears the google map display is sitting on top of a blank page.

So if I add a button and in its handler add the following code snippet

TMSFMXWebGMaps1.Navigate('https://maps.google.com/maps?ll=-43.477285,172.63791&z=12&t=m&hl=en-NZ&gl=US&mapclient=apiv3');

to get the embedded browser to naviagte then the map display comes back. However this time I get the full web version of the google map including all of the map controls, and a warning about IE compatibility mode.

This has not fixed my problem but may cast some light on what is causing it and how it can be fixed.
Back to Top
Moorhouse David View Drop Down
New Member
New Member
Avatar

Joined: 16 Mar 2017
Posts: 9
Post Options Post Options   Quote Moorhouse David Quote  Post ReplyReply Direct Link To This Post Posted: 12 Jun 2017 at 5:12am
I've done a bit more investigation. 

I can easily replicate the combobox problem by dropping a TComboBox control onto the grey panel in the FMX routing demo, then adding a couple of items in via the Object Inspector.  Click F9 to run and when the combobox is clicked the "blank{GUID}" error occurs.

This happens in the FMX routing demo running under 10.1 and 10.2. 
It does NOT occur in the FMX demo running under XE8, nor the VCL version running under 10.2.

Hope this info helps to isolate the root cause of the problem.
Back to Top
Moorhouse David View Drop Down
New Member
New Member
Avatar

Joined: 16 Mar 2017
Posts: 9
Post Options Post Options   Quote Moorhouse David Quote  Post ReplyReply Direct Link To This Post Posted: 14 Jun 2017 at 8:25am
I've put together a simple FMX Win32 app to demonstrate the problem. 
The app works fine in XE8 and 10 Seattle. 
It breaks in 10.1 Berlin and 10.2 Tokyo, so something got changed either in the code base of the Maps component, or the FMX framework.  Without access to the Maps source I cannot tell.

How do I log this as a bug at TMS ?

The code is as follows

program HeaderFooterApplication;

uses
  System.StartUpCopy,
  FMX.Forms,
  HeaderFooterTemplate in 'HeaderFooterTemplate.pas' {HeaderFooterForm};

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(THeaderFooterForm, HeaderFooterForm);
  Application.Run;
end.

The main unit

unit HeaderFooterTemplate;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls,
  FMX.ListBox, FMX.TMSWebGMapsWebBrowser, FMX.TMSWebGMaps,
  FMX.Controls.Presentation;

type
  THeaderFooterForm = class(TForm)
    Header: TToolBar;
    Footer: TToolBar;
    HeaderLabel: TLabel;
    TMSFMXWebGMaps1: TTMSFMXWebGMaps;
    ComboBox1: TComboBox;
  private
  public
  end;

var
  HeaderFooterForm: THeaderFooterForm;

implementation
{$R *.fmx}
end.


And the dfm file

object HeaderFooterForm: THeaderFooterForm
  Left = 0
  Top = 0
  Caption = 'Header Footer Form'
  ClientHeight = 567
  ClientWidth = 384
  FormFactor.Width = 1440
  FormFactor.Height = 900
  FormFactor.Devices = [Desktop]
  DesignerMasterStyle = 0
  object Header: TToolBar
    Size.Width = 384.000000000000000000
    Size.Height = 48.000000000000000000
    Size.PlatformDefault = False
    TabOrder = 0
    object HeaderLabel: TLabel
      Align = Contents
      Size.Width = 384.000000000000000000
      Size.Height = 48.000000000000000000
      Size.PlatformDefault = False
      StyleLookup = 'toollabel'
      TextSettings.HorzAlign = Center
      Text = 'Title'
    end
  end
  object Footer: TToolBar
    Align = Bottom
    Position.Y = 519.000000000000000000
    Size.Width = 384.000000000000000000
    Size.Height = 48.000000000000000000
    Size.PlatformDefault = False
    StyleLookup = 'bottomtoolbar'
    TabOrder = 1
    object TMSFMXWebGMaps1: TTMSFMXWebGMaps
      Position.X = 8.000000000000000000
      Position.Y = -464.000000000000000000
      Version = '2.8.0.2'
      Size.Width = 361.000000000000000000
      Size.Height = 441.000000000000000000
      Size.PlatformDefault = False
      Clusters = <>
      Markers = <>
      Polylines = <>
      Polygons = <>
      Directions = <>
      MapOptions.DefaultLatitude = 48.859040000000000000
      MapOptions.DefaultLongitude = 2.294297000000000000
      Routing.PolylineOptions.Icons = <>
      StreetViewOptions.DefaultLatitude = 48.859040000000000000
      StreetViewOptions.DefaultLongitude = 2.294297000000000000
      PolygonLabel.Font.Family = 'Arial'
      TabOrder = 0
    end
    object ComboBox1: TComboBox
      Items.Strings = (
        'ABC'
        'DEF')
      Position.X = 64.000000000000000000
      Position.Y = 8.000000000000000000
      Size.Width = 217.000000000000000000
      Size.Height = 22.000000000000000000
      Size.PlatformDefault = False
      TabOrder = 1
    end
  end
end

Back to Top
Moorhouse David View Drop Down
New Member
New Member
Avatar

Joined: 16 Mar 2017
Posts: 9
Post Options Post Options   Quote Moorhouse David Quote  Post ReplyReply Direct Link To This Post Posted: 14 Jun 2017 at 8:26am
I forgot to say, to trigger the bug - run the app and then click on the combobox.
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3331
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 14 Jun 2017 at 8:50am
Hi, 

We have further investigated this here, but the issue with the combobox dropdown resetting the map is an FMX issue. The browser is internally mapped on TWebBrowser, which re-initializes each time a child form, frame or popup is created. There is currently no workaround for this issue. More information can be found at the following QC report:

Back to Top
Moorhouse David View Drop Down
New Member
New Member
Avatar

Joined: 16 Mar 2017
Posts: 9
Post Options Post Options   Quote Moorhouse David Quote  Post ReplyReply Direct Link To This Post Posted: 14 Jun 2017 at 11:31am
Thx for the verification. I have added a comment to the EMBO bug tracker.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down