Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot put a google maps GMSMapView in a subview of main main view?
    primarykey
    data
    text
    <p>I'm struggling with this problem! I want to add a google maps <code>GMSMapView</code> into a <code>UIView</code> that is only a portion of the main <code>UIView</code> of my <code>ViewController</code>.</p> <p>It should be simple... I created with the storyboard a <code>UIView</code> of the size I want and put it in the main <code>UIView</code>.</p> <p>Snippet from Interface file:</p> <pre><code>@interface MapViewController : UIViewController &lt;CLLocationManagerDelegate&gt; @property(nonatomic) IBOutlet GMSMapView *mapView; </code></pre> <p>With the mapView linked with this <code>UIView</code> inside the main <code>UIView</code>.</p> <p>What I do in the implementation:</p> <pre><code>@synthesize mapView = _mapView; - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.8683 longitude:151.2086 zoom:10]; _mapView = [GMSMapView mapWithFrame:_mapView.bounds camera:camera]; _mapView.myLocationEnabled = YES; } </code></pre> <p>This should work, shouldn't it? What I get is that my internal UIView is empty.</p> <p>If I instantiate a map following google's starting guide <a href="https://developers.google.com/maps/documentation/ios/start" rel="noreferrer">Google Map Integration Document</a>, it works but it assigns the map to the MAIN UIView and thats a different thing.</p> <p>I tried even changing the class of my mapView in the storyboard from <code>UIView</code> to <code>GMSMapView</code>. The map is showed in the inner view but it is initialized in a strange way making</p> <ol> <li>The system throwing an error saying </li> </ol> <blockquote> <p>"Failed to make complete frame buffer"</p> </blockquote> <p>and slowing down a lot the loading of the view (it takes 2-3 seconds on the simulator)</p> <ol start="2"> <li>The map not responding in any camera change done in the <code>viewDidLoad</code> method.</li> </ol> <p>Any suggestions?</p> <p>I read some posts here on StackOverflow but couldn't find a valid solution :(</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload