Skip to content

How to control the initial zoom rect #31

@fraserscottmorrison

Description

@fraserscottmorrison

Hi, this is a question

I have a dataset of up to 1000 items but I want the map to initially zoom into the 10 that are closest to the users location.

So currently I populate the quad tree with the 100 items, and I also populate a second quad tree with the closest 10, then call

let zoomRect = self.mapView.mapRectThatFits(closest10QuadTree.bentoBox.root, edgePadding: type(of: self).mapInsets)

self.mapView.setVisibleMapRect(zoomRect, edgePadding: type(of: self).mapInsets, animated: true)

Which is working, but slow (3 seconds). Is there a better way to do this?
Cheers
Fraser

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