OnMarkerDragEnd

Hi,

I'm working with TTMSFMXWebGMaps and the event OnMarkerDragEnd does not work on IOS, This is a bug or is not implemented?

same for:
OnMarkerDragStart
OnMarkerDrag
OnMapClick

I need the user to fine tune the location address, so is very important for us to get this event.

any ideas?

Thanks
Mauricio Herrera

Hi,


Can you please try adding markers as indicated in the example below?
With this technique the mentioned events are working as expected.

procedure TForm1.TMSFMXWebGMaps1MapClick(Sender: TObject; Latitude,
  Longitude: Double; X, Y: Integer);
var
  m: TMarker;
begin
  m := TMSFMXWebGMaps1.Markers.Add;
  m.Latitude := Latitude;
  m.Longitude := Longitude;
  m.Draggable := true;
  TMSFMXWebGMaps1.CreateMapMarker(m);
end;

HI,

I have done what you recommenced, and it doesn't work either,
in fact i tested the demo project (WebGMapsDemo.dproj) and it does not
work on IOS and MAC, the event only works on Window.

The On MapClick, OnMarkerDragEnd, OnMarkerDrag,OnMarkerDragStart.

I just updated the compos to 2.6 Version.

Hope we get a fix

Thanks

Hi,


- I have not been able to reproduce an issue with the OnMapClick event.
Can you please specify exactly how this can be reproduced?
Does the issue also occur in the WebGMapsDemo application?

- The OnMarkerDragEnd, OnMarkerDrag and OnMarkerDragStart are working as expected when using the technique specified above.
There was an issue with the events when using the Add call parameters to add a Marker which has now been fixed.
The update will be available with the next release.

If the problem persists, please provide the version of Delphi, iOS and MacOS you are using so I can further investigate this.

I can verify this issue with Delphi 10.1 Seattle, iOS 10.1.1., WebOSMaps 2.0.0.1


My Code looks like:
[Spoiler]
unit UMain;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes,
  System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
  FMX.TMSWebOSMapsWebBrowser, FMX.TMSWebOSMaps, FMX.StdCtrls,
  FMX.Controls.Presentation;

type
  TfrmMain = class(TForm)
    tbMain: TToolBar;
    lblTitle: TLabel;
    procedure FormCreate(Sender: TObject);
  private
    { Private-Deklarationen }
    FMap: TTMSFMXWebOSMaps;
    procedure DoMapClick(Sender: TObject; Latitude, Longitude: Double;
      X, Y: Integer);
  public
    { Public-Deklarationen }
  end;

var
  frmMain: TfrmMain;

implementation

{$R *.fmx}

procedure TfrmMain.FormCreate(Sender: TObject);
begin
  FMap := TTMSFMXWebOSMaps.Create(self);
  FMap.Parent := self;
  FMap.Align := TAlignlayout.Client;
  FMap.OnMapClick := DoMapClick;
end;

procedure TfrmMain.DoMapClick(Sender: TObject; Latitude, Longitude: Double;
  X, Y: Integer);
begin
  lblTitle.Text := format('Lat: %0.2f Lon: %0.2f', [Latitude, Longitude]);
end;

end.
[/Spoiler]

It works fine on Android, MacOS, Windows, but on on iOS. It seem to be that every event is ignored. WebGMapsDemo also does not work on iOS. 


I suppose the issues are caused if you compile with iOS 10 SDK and newer. 


Replacing the click event with touchend in the coasts:
 'map.events.register("click", map, function(e){' + #13 +

seem to work, but maybe somebody has a better idea?

Christian
              

Hi,


I have been able to reproduce the issue in TMS FMX WebOSMaps and I'm now investigating how this can be fixed.
I will report back as soon as possible.

Thanks, i suppose because of the fact that:

           "'<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />' + #13 +"

no longer works and double tap is not deactivated. I found several message concerning this behavior on stackoverflow.

Christian

Também estou com este problema no Delphi Rio 10.3.3
No Windows funciona, mas ao rodar no Android o evento OnMarkerClick não funciona.

Alguma solução?

Please refer to this thread