Missing features in maps add-on related to Charts add-on

Hello,

We are migrating an existing Cuba project (version 7.2.23) into a JMIX project (version 3.1.0).

We were using the Charts add-on in Cuba to display some Polygons.While checking the Maps add-on in JMIX, we have noticed that some features were not available in JMIX anymore and we were wondering if it was planned to implement them :

  • we were using the addPolygonRightClickListener in MapViewer
  • we were also using the createInfoWindow in MapViewer.

If it is not planned to implement these features, could you advise on the appropriate way to replace them ?

Thanks in advance for your help.

Regards,

Séverine GERGAUD

Hello!

Unfortunately, these features are not available in the Maps add-on yet.

  • we were using the addPolygonRightClickListener in MapViewer

The add-on listens to OpenLayers click events, which fire only for the left mouse button, so right clicks never reach the server. I’ve created an issue: Support right click on GeoMap and its features · Issue #5973 · jmix-framework/jmix · GitHub

  • we were also using the createInfoWindow in MapViewer.

There is already an issue for this: Support Popup in GeoMap component · Issue #3069 · jmix-framework/jmix · GitHub. However, we don’t have specific plans for it yet.

I’ve prepared a demo project that shows how to implement both features as a workaround in a Jmix 3.1 project:
demo-maps.zip (129.9 KB)

Take a look at PolygonWorkaroundView and at GeoMapRightClick and MapInfoWindow in the demo project. Note that after GeoMapRightClick.enable(map) right clicks come through the same click events as left clicks, so check getMouseEventDetails().getButton() in your click listeners.

Both helpers rely on internal parts of the map’s client-side component, so they may need adjustments after an add-on upgrade.

Regards,
Roman

Hello Roman,

Thanks for creating the issue and for providing a fast workaround for these use cases :slight_smile:

Regards,

Séverine GERGAUD