Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Can't get MGLFeature from "visibleFeaturesInRect: inStyleLayersWithIdentifiers:" #16637

Open
codevond opened this issue Mar 16, 2022 · 0 comments

Comments

@codevond
Copy link

codevond commented Mar 16, 2022

This is my code

` if (tap.state == UIGestureRecognizerStateEnded) {

    CGPoint touchpoint = [tap locationInView:self];
    
    CGRect fishRect = CGRectMake(Tp.x-1, Tp.y-1, 2, 2);
    NSSet *fishSet = [NSSet setWithObject:self.fishLay.identifier];
    NSArray<id<MGLFeature>> * fishFeatures = [self visibleFeaturesInRect:fishRect inStyleLayersWithIdentifiers:fishSet];
    if (fishFeatures.count > 0) {
       /// do something
        }
    }`

But the MGLFeature alway is empty, even if I click exactly.
And there is also a issue of offset, the direction is random.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant