user3388273
user3388273

Reputation: 399

Google map sdk to show direction in iPhone

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

Answers (3)

Chitra Khatri
Chitra Khatri

Reputation: 1258

After reviewing your code I can say following: Might help others

  1. Drag and drop your GoogleMaps.framework in such a way that it should be at root folder and also show in Build Phases -> Link Binary with Libraries

enter image description here

  1. Add GoogleMaps.bundle from GoogleMaps.framework->Resources -> GoogleMaps.bundle

  2. Add all frameworks like:

enter image description here

Upvotes: 1

Sefi
Sefi

Reputation: 216

check whether all the frameworks are added. Go throught this link https://developers.google.com/maps/documentation/ios/start

Upvotes: 1

Jogendra.Com
Jogendra.Com

Reputation: 6454

Please add this line also

_markerStart.map = _mapView;

and try again .. may be helpfull ....

Upvotes: 0

Related Questions