i'm aware of post: how max zoomlevel on ios mkmapview
and seems need solve problem, however, technique not work me.
if set eyealtitude @ 50, or 100, same map zoom returned. however, once map displayed, can pinch zoom desired zoom level. there solution programmatically achieve pinched in zoom level @ initial load of map view?
edit: i've tried using setregion problem seems related using .satelliteflyover specifically. need use .satelliteflyover due difference in image quality. further edit: i've discovered simulator seems give different 'native zoom' when runs on device. hope reads can provide insight!!
the code i'm using is:
let greenlocation:cllocationcoordinate2d = cllocationcoordinate2dmake(cllocationdegrees(greenx),cllocationdegrees(greeny)) let altitude:cllocationdistance = 80 self.greenmap.maptype = .satelliteflyover let camera = mkmapcamera(lookingatcenter: greenlocation, fromeyecoordinate: greenlocation, eyealtitude: altitude) self.greenmap.setcamera(camera, animated: true)
you can set region make map view scale fit. use function.
open func setregion(_ region: mkcoordinateregion, animated: bool)
here sample code.
let map = mkmapview() let center = cllocationcoordinate2d(latitude: 115, longitude: 24) let span = mkcoordinatespan(latitudedelta: 0.003, longitudedelta: 0.003) let region = mkcoordinateregion(center: center, span: span) map.setregion(region, animated: false)
Comments
Post a Comment