Identify graphics from MultiPointBuilder

800
4
Jump to solution
05-18-2021 10:23 PM
Kanzakiryu
New Contributor

Hello.

I would like to identify the graphics for a specific point from MultiPointBuilder.

I tried using identifyGraphicsOverlay, but I couldn't figure out how to know the number of the point I clicked on.

So I thought of a way to find and identify the latitude and longitude of the closest point to the clicked point from MultiPointBuilder.

However, I don't like to use this method because it might cause some unexpected glitches.

Is there anything else I can do?

I use ArcGISRuntime version is 100.9.

0 Kudos
1 Solution

Accepted Solutions
Nicholas-Furness
Esri Regular Contributor

Sounds like you really want to use multiple Graphics, where each graphic's geometry is a single point rather than a single graphic with a multipoint geometry.

However,  you could use GeometryEngine.nearestVertex(), passing in the identified multipoint geometry and the identify map location. This returns a ProximityResult which includes a partIndex and pointIndex.

View solution in original post

0 Kudos
4 Replies
JamesBallard1
Esri Regular Contributor

Hi @Kanzakiryu,

   Unfortunately I don't believe there is any way to do what you're wanting. A Multipoint geometry is a single geometry containing multiple points, so if you identify any point of that Multipoint, you will get back the entire Multipoint from the identify operation.

If it is possible, using individual point geometries would alleviate this situation for you. You'd be able to identify every point uniquely.

https://developers.arcgis.com/qt/qml/api-reference/qml-esri-arcgisruntime-multipoint.html#details

I hope this helps.

0 Kudos
Kanzakiryu
New Contributor

OK, I know.

I'm going to try to do it the way I figured it out.

0 Kudos
Nicholas-Furness
Esri Regular Contributor

Sounds like you really want to use multiple Graphics, where each graphic's geometry is a single point rather than a single graphic with a multipoint geometry.

However,  you could use GeometryEngine.nearestVertex(), passing in the identified multipoint geometry and the identify map location. This returns a ProximityResult which includes a partIndex and pointIndex.

0 Kudos
Kanzakiryu
New Contributor

Oh, great!

This is exactly what I wanted to do!

Thanks you for answer!!!

0 Kudos