Map Zoom Unpredictable

My map zooms in as many times as i click on the link, but as soon as I add an annotation the zoom is unpredictable. Any help appreciated. Once this code has a value to execute that’s when the zoom messes up.

var myCount = myLocations.count
for myLocation in myLocations {
if (myLocation.date! >= WeeklySpan(increment: myValue) && myCount >= 1 ){
let annotations = MKPointAnnotation()
annotations.coordinate = CLLocationCoordinate2D(latitude: myLocation.latitude, longitude: myLocation.longitude)
annotations.title = myLocation.detail
mapView.addAnnotations([annotations])
myCount -= 1
// print(myValue)
// print(myCount)
// print(myLocation.date! as Any)
// print(WeeklySpan(increment: myValue))
} else { return mapView}

    }
    return mapView
}

@flmcl Do you still have issues with this?

This topic was automatically closed after 166 days. New replies are no longer allowed.