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

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

Open

Description

@codevond

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions