osx - How to enable MKMapView 3D view? -
i have mkmapview in window, , pitchenabled
true (and i've confirmed in debugger). "3d" thingy in middle of compass grayed out, , clicking or dragging nothing. option-dragging map (like in maps.app) doesn't anything, either.
from interpretation of docs, setting pitchenabled
should let me use 3d view, maps.app does. mistaken? there else need allow users 3d map view?
you can close experience of 3d mode adjusting camera angle view map , making buildings visible. example below allows view eiffel tower in 3d:
viewdidload() { super.viewdidload() mapview.maptype = mkmaptype.standard mapview.showsbuildings = true // displays buildings let eiffeltowercoordinates = cllocationcoordinate2dmake(48.85815, 2.29452) mapview.region = mkcoordinateregionmakewithdistance(eiffeltowercoordinates, 1000, 100) // sets visible region of map // create 3d camera let mapcamera = mkmapcamera() mapcamera.centercoordinate = eiffeltowercoordinates mapcamera.pitch = 45 mapcamera.altitude = 500 // example altitude mapcamera.heading = 45 // set camera property mapview.camera = mapcamera }
example from: this question
Comments
Post a Comment