How many polygons intersect in one coordinate?

This text was translated in Google Translate.

I have the coordinates that create the polygons of the different areas of my city, and there can be several polygons in the same area.

Here I have an example of what all my polygons look like.

As you can see in the image, there are several polygons that intersect. The DataInteger field of each polygon has a different value to be able to differentiate them.

TMSFNCGoogleMaps.Polygons.Items[i].Clickable := True;
TMSFNCGoogleMaps.Polygons.Items[i].DataInteger := X;

When I click on the map, it sends me to call the TMSFNCGoogleMapsPolyElementClick procedure, but it only brings me the value of the highest polygon. Is there a way to get the integer value of all the polygons that intersect according to the coordinates?

procedure Tfrm_mapa.TMSFNCGoogleMapsPolyElementClick(Sender: TObject;
  AEventData: TTMSFNCMapsEventData);
begin
    if Assigned(AEventData.PolyElement) then
    begin
        AEventData.PolyElement.DataInteger;
    end;
end;

Hi,

You can use the IsPointInArea or PolyElement.ContainsPoint calls to find out if a specific coordinate is inside a PolyElement area.

This feature was added in v3.0.3.0 so please make sure you are using the latest version of TMS FNC Maps.

Hi,

Thanks for replying, sorry, but where do I find which version of the component I'm using? and also the IsPointInArea and PolyElement.ContainsPoint functions where can I find them? Could you help me with an example, please?

This feature is explained in the following blog post:

For the version number, place a TTMSNFCMaps component on the form, right click and select about.
The version number should be v2.0.2.0.

Thank you very much, I already updated the version of the component and I already checked the recommended link and I already managed to get the information I required.

Happy To Help!