2 Jan 2017

Google maps integration Annotation steps ios

 

Google maps Annotation ios...

  1. Create the New Xcode in specific folder. 
  2. Open Terminal by pressing Command+Space Button
  3. Type the cd ~/Desktop/NaniMaps
  4. Type the Pod init
  5. Type this pico Podfile (This was created in your Xcode folder).
  6. Goto Browser and search for googlemaps SDK for iOS
  7. Then Open the Getting Started in the filtered results which was showen bellow.
  8. In Getting started webpage look for = source 'https://github.com/CocoaPods/Specs.git' and copy it.
  9. Goto Terminal and plate the copied content above the target ‘NaniMaps’ do just like bellow…  Example:-source 'https://github.com/CocoaPods/Specs.git' target 'NaniMaps’ do.
  10. Again goto browser and copy the (pod ‘GoogleMaps' pod ‘GooglePlaces’).
  11. Goto Terminal and paste the copied content below the #Pods for NaniMap For Example # Pods for NaniMaps 
  12. pod ‘GoogleMaps’
  13.  pod ‘GooglePlaces'
  14. Press Ctrl+O to Save.
  15. Press Ctrl+X to Exit and Press Enter.
  16. Type the pod install command to install pods to our project.
  17. Goto your project folder then you will find one workspace file open it and check pods are correctly installed are not…
  18. Goto browser and press the GET KEY then give your project name then you get one window in that press the goto console.
  19. In that window open credentials and select the edit option… and the give your Xcode bundler identifier. and copy the Key Like as  AIzaSyA0VTc9RJ2LcJRoysRq3WtnSDp1q7wMLdY.
  20. Again goto Getting Started Page and copy the bellow code: 
  21. [GMSServices provideAPIKey:@"YOUR_API_KEY”];
  22. [GMSPlacesClient provideAPIKey:@"YOUR_API_KEY”];
  23. Open the Xcode and in that open the AppDelegate.h and import the 
  24. #import <GoogleMaps/GoogleMaps.h>
  25. #import <GooglePlaces/GooglePlaces.h>
  26. Open the Xcode and in that open the AppDelegate.m and paste the content in did finishlaunch:
  27.  [GMSServices provideAPIKey:@"YOUR_API_KEY”];
  28. [GMSPlacesClient provideAPIKey:@"YOUR_API_KEY”];
  29. Import the same files in viewController.h also.
  30. Goto AppDelegate.m file and type the following- 
  31. -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  32. [GMSServices provideAPIKey:@"AIzaSyA0VTc9RJ2LcJRoysRq3WtnSDp1q7wMLdY”];
  33. [GMSPlacesClien provideAPIKey:@"AIzaSyA0VTc9RJ2LcJRoysRq3WtnSDp1q7wMLdY”];return YES;}
  34. Goto Getting Started page and copy the following code in browser:
    - (void)loadView {
  35.   // Create a GMSCameraPosition that tells the map to display the
  36.   // coordinate -33.86,151.20 at zoom level 6.
  37.   GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86
  38.                                                           longitude:151.20
  39.                                                                zoom:6];
  40.   GMSMapView *mapView = [GMSMapView mapWithFrame:CGRectZero camera:camera];
  41.   mapView.myLocationEnabled = YES;
  42.   self.view = mapView;
  43.   // Creates a marker in the center of the map.
  44.   GMSMarker *marker = [[GMSMarker alloc] init];
  45.   marker.position = CLLocationCoordinate2DMake(-33.86, 151.20);
    //marker.position = camera.target;(Optional for the market.position)
      marker.title = @"Sydney";
  46.   marker.snippet = @"Australia";
  47.   marker.map = mapView;



No comments:

Post a Comment

Recent Posts

Codable demo

Link: https://www.dropbox.com/s/kw7c1kgv1628bh7/codableDemo.zip?dl=0