mihaeu / warmshowers-ios

This project aims to provide a feature rich iOS client for warmshowers.org
0 stars 2 forks source link

Map moves (and reloads) when callout near border #9

Closed mihaeu closed 9 years ago

mihaeu commented 9 years ago

Whenever a pin near the map border is clicked, the callout pushes the map, forcing it to reload and closing the callout.

mihaeu commented 9 years ago

This is probably due to the way the removal and adding of the pins is handled.

See

func loadUserAnnotations(users: [Int:User])
    {
        // todo
        mapView.removeAnnotations(userAnnotations)
        userAnnotations.removeAll()

        for (id, user) in users {
            if user.longitude != 0.0 {
                userAnnotations.append(UserAnnotation(user: user))
            }
        }

        mapView.addAnnotations(userAnnotations)
    }
mihaeu commented 9 years ago

Fixed in 684f82b

Only partial reload works, but I still need to refactor the solution.