TmsFncMaps HERE service error right mouse click

Hello
How can I handle displaying my own popup menu (TMenu) in TmsFncMaps for HERE? I would like to be able to use the right mouse button to invoke the menu both when clicking on the marker and when clicking on the map.

1 Like

Hi,

You can use the OnMapRightClick or OnMarkerRightClick events of TTMSFNCLeaflet to show a TPopupMenu.

procedure TForm1.TMSFNCLeaflet1MapRightClick(Sender: TObject;
  AEventData: TTMSFNCMapsEventData);
var
  pt: TPoint;
begin
  pt.X := Round(AEventData.X);
  pt.Y := Round(AEventData.Y);
  pt := TMSFNCLeaflet1.ClientToScreen(pt);
  PopupMenu1.Popup(pt.X, pt.y);
end;

I asked about the TMSFNCLeaflet component, not the TMSFNCLeaflet.

The new version added the OnMapRightClick OnMarkerRightClick OnPolyElementRightClick events to TMSFNCLeaflet - why weren't they added to TMSFNCLeaflet?

The right mouse button is very important to me. Please make this change to TMSFNCLeaflet as soon as possible.

The OnMapRightClick and OnPolyElementRightClick events are not yet available for all mapping services. For some services, this feature is not provided in the API, or there are technical limitations that prevent us from adding it.

We strive to only expose properties, events, etc., in TTMSFNCMaps for functionalities that are available across all supported mapping services. Currently, these events are only available in descendant components like TTMSFNCLeaflet.

We are investigating solutions to also expose these events in TTMSFNCMaps in a future version.

1 Like

With the TMSFncMaps component, which allows you to freely switch map services in situations where there are various limitations. Each time you will receive the information.

Unfortunately, it does not contribute much and I have to look for very risky solutions to patch the deficiencies in the component. This is not how you can work. Please provide a critically urgent fix!

We and mutual customers expect TTMSFNCMaps features that are exposed to work for all supported services. Note that we cannot expose / publish functionality for all mapping services on TTMSFNCMaps level because users will expect features to work, therefore we decided to create decendants classes to expose service specific functionality. From time to time, we expose common functionality on TTMSFNCMaps level as soon as all services support that functionality.

Specifically for your application, a possible workaround would be to define a class wrapper to access common functionality if you intend to only use it for the services supporting that functionality.

type
  TTMSFNCMapsOpen = class(TTMSFNCMaps);

procedure TForm1.FormCreate(Sender: TObject);
begin
  TTMSFNCMapsOpen(TMSFNCMaps1).OnMapRightClick := DoMapRightClick;
end;

Please provide a detailed list of common functionality that you need, and we'll investigate what we can move to TTMSFNCMaps, considering you'll have to use the class wrapper method. Please note that not all functionality will and can be moved, it depends on the complexity and the way the services implements it.