Skip to content

Commit

Permalink
Update WhirlyGlobeViewController.mm
Browse files Browse the repository at this point in the history
  • Loading branch information
segecey authored Jun 1, 2021
1 parent c3562de commit 21a8838
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,31 @@ - (void)handleSelection:(WhirlyGlobeTapMessage *)msg didSelect:(NSArray *)select
// The user selected something, so let the delegate know
if ([_delegate respondsToSelector:@selector(globeViewController:allSelect:atLoc:onScreen:)])
[_delegate globeViewController:self allSelect:selectedObjs atLoc:coord onScreen:msg.touchLoc];

MaplySelectedObject *selectVecObj = nil;
MaplySelectedObject *selObj = nil;
// If the selected objects are vectors, use the draw priority
for (MaplySelectedObject *whichObj in selectedObjs)
{
if ([whichObj.selectedObj isKindOfClass:[MaplyVectorObject class]])
{
MaplyVectorObject *vecObj0 = selectVecObj.selectedObj;
MaplyVectorObject *vecObj1 = whichObj.selectedObj;
if (!vecObj0 || ([vecObj1.attributes[kMaplyDrawPriority] intValue] > [vecObj0.attributes[kMaplyDrawPriority] intValue]))
selectVecObj = whichObj;
} else {
// If there's a non-vector object just pick it
selectVecObj = nil;
selObj = whichObj;
break;
}
}

if (selectVecObj)
selObj = selectVecObj;

if (_delegate && [_delegate respondsToSelector:@selector(globeViewController:didSelect:)])
[_delegate globeViewController:self didSelect:selObj.selectedObj];
else {
MaplySelectedObject *selectVecObj = nil;
MaplySelectedObject *selObj = nil;
Expand Down

0 comments on commit 21a8838

Please sign in to comment.