mousebird-consulting-inc / WhirlyGlobe

WhirlyGlobe Development
Other
828 stars 255 forks source link

Get all objects in selected location #801

Closed amirfl closed 7 years ago

amirfl commented 7 years ago

Is there a way to get all objects (instead of just a single object) that are tapped over by the user. I have a few overlapping regions, shown as vector objects on the globe. When the user taps them I'd like to show a menu where he can select the object interested in.

mousebird commented 7 years ago

Use the allSelect: delegate instead.

amirfl commented 7 years ago

Thanks. I've implemented - (void)globeViewController:(WhirlyGlobeViewController *)viewC allSelect:(NSArray *)selectedObjs atLoc:(MaplyCoordinate)coord onScreen:(CGPoint)screenPt

However, allSelect contains only a single MaplyVectorObject when the user taps on an area with overlapping vectors. I know this method works fine with other objects, because multiple markers are returned when a user taps an area with a close markers.

mousebird commented 7 years ago

Make sure you're on a recent version. I believe we just fixed that a few weeks ago.

amirfl commented 7 years ago

Just updated to daily build 108 (latest) for iOS, but unfortunately still getting the same problem.

mousebird commented 7 years ago

I'm seeing multiple object selection working in a test case. I did have to set MaplyVectorObject.selectable = true.

amirfl commented 7 years ago

still having the problem, but worked around it by searching through all my vector objects and testing which ones had the tap location inside their borders.

mousebird commented 7 years ago

The test case I built for this appears to work, so I'm not sure what to suggest.