Reputation: 399
I am using Googlemap sdk to show direction in my app, i have downloaded a sample app.I have integrated all the features to my app.But map is not showing.Below is the code which i am using.
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:9.96 longitude:76.31 zoom:12];
_mapView = [GMSMapView mapWithFrame:self.view.bounds camera:camera];
_mapView.myLocationEnabled = YES;
_mapView.delegate = self;
[self.view addSubview:_mapView];
_markerStart = [GMSMarker new];
_markerStart.title = @"Raj";
_markerStart.snippet=@"2Km";
_markerStart.icon = [GMSMarker markerImageWithColor:[UIColor greenColor]];
In the above code _mapView is getting as nil, is this a problem regarding api key or google map sdk which i copied to my project any idea.
Upvotes: 0
Views: 109
Reputation: 1258
After reviewing your code I can say following: Might help others
GoogleMaps.framework
in such a way that it should be at root folder and also show in Build Phases
-> Link Binary with Libraries
Add GoogleMaps.bundle from GoogleMaps.framework
->Resources
-> GoogleMaps.bundle
Add all frameworks like:
Upvotes: 1
Reputation: 216
check whether all the frameworks are added. Go throught this link https://developers.google.com/maps/documentation/ios/start
Upvotes: 1
Reputation: 6454
Please add this line also
_markerStart.map = _mapView;
and try again .. may be helpfull ....
Upvotes: 0