Has anyone successfully implemented clickable polygons in Leafy Maps? If so, how?

Have been working on geographical groups that users can select or de-select. I would like selecting that polygon to add the user to that group, and also show the polygon in a different colour. If they unselect it, they are removed from the group and the polygon’s colour returns to default.

I have successfully loaded hundreds of polygons onto a leafy map. Along with their central markers and display text.

My set up is:

I load my polygons like this:

  1. Draw list of polygons
    • Data source = Data Type of Groups
    • Latitude field = Map Latitudes
    • Longitude field = Map Longitudes
    • Unique name = Polygon unique id
  2. Load polygons list
    • Polygons list = This Leafymap’s Polygons list
    • List of zones = Search for Data Type of Groups:each item’s unique id
    • Polygon name = “XXX -local-groups”

The polygons display perfectly.

My workflow

When the map is clicked I run:

  1. Check if point is contained in polygon area (geofence)

using:

  • Clicked map latitude
  • Clicked map longitude

The results

Interestingly:

  • Is point contained in polygon? Returns Yes
  • Which zone is the point contained in? Always returns blank
  • Draw geometry clicked name Always returns blank

I’ve even reduced it to a single polygon with a single zone and get exactly the same behaviour.

Another oddity is that Map clicked only seems to fire on right-click, not left-click. This will mean it’s unable to work on the mobile version.

Has anyone successfully used Which zone is the point contained in? or Draw geometry clicked name with polygons?

If so, am I missing a step, or is this a limitation in the current version of the plugin?

If it’s not possible with Leafy, can anyone point me in the direction of other plug-ins I can use to successfully create this feature?

Cheers