Follow me on Google+ , Feel free to COMMENT BELOW / SHARE the post Anything new or any Suggestions or having any Question...! So that i come to know this blog is useful ...!!! Let me come to know any new topic/Having Errors while your coding then i will try to Post/Clear Errors in your code...! If you want Online classes just mail me ravindarnalla@gmail.com
Showing posts with label Google Maps. Show all posts
Showing posts with label Google Maps. Show all posts
10 Mar 2017
Google Maps Locate a Place with Marker(Annotation) Code...
Google Maps Locate a Place with Marker(Annotation) Code...
Link:
Install these two pods into your Project first...
pod 'GoogleMaps'
pod 'GooglePlaces'
In AppDelegate.m
#import "AppDelegate.h"
@import GoogleMaps;
@import GooglePlaces;
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
[GMSServices provideAPIKey:@"AIzaSyCRmtna9ECtebYugcRCNmJHbIo-Rj4lWs4"];
[GMSPlacesClient provideAPIKey:@"AIzaSyCRmtna9ECtebYugcRCNmJHbIo-Rj4lWs4"];
return YES;
}
After installation of above pods... Add below code to info.plist Source code..
<array>
<string>googlechromes</string>
<string>comgooglemaps</string>
</array>
Now...The longitude and latitude of pace we have to give...
Add this code in ViewController.m
#import "ViewController.h"
#import <GoogleMaps/GoogleMaps.h>
#import <GooglePlaces/GooglePlaces.h>
@interface ViewController ()
@end
@implementation ViewController
// You don't need to modify the default initWithNibName:bundle: method.
- (void)loadView {
// Create a GMSCameraPosition that tells the map to display the
// coordinate -33.86,151.20 at zoom level 6.
GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:17.421979
longitude:78.338892
zoom:6];
GMSMapView *mapView = [GMSMapView mapWithFrame:CGRectZero camera:camera];
mapView.myLocationEnabled = YES;
self.view = mapView;
// Creates a marker in the center of the map.
GMSMarker *marker = [[GMSMarker alloc] init];
marker.position = CLLocationCoordinate2DMake(17.421979, 78.338892);
marker.title = @"Kapil Towers";
marker.snippet = @"Hyderabad";
marker.map = mapView;
}
@end
2 Jan 2017
Google maps integration Annotation steps ios
Google maps Annotation ios...
- Create the New Xcode in specific folder.
- Open Terminal by pressing Command+Space Button
- Type the cd ~/Desktop/NaniMaps
- Type the Pod init
- Type this pico Podfile (This was created in your Xcode folder).
- Goto Browser and search for googlemaps SDK for iOS
- Then Open the Getting Started in the filtered results which was showen bellow.
- In Getting started webpage look for = source 'https://github.com/CocoaPods/Specs.git' and copy it.
- 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.
- Again goto browser and copy the (pod ‘GoogleMaps' pod ‘GooglePlaces’).
- Goto Terminal and paste the copied content below the #Pods for NaniMap For Example # Pods for NaniMaps
- pod ‘GoogleMaps’
- pod ‘GooglePlaces'
- Press Ctrl+O to Save.
- Press Ctrl+X to Exit and Press Enter.
- Type the pod install command to install pods to our project.
- Goto your project folder then you will find one workspace file open it and check pods are correctly installed are not…
- Goto browser and press the GET KEY then give your project name then you get one window in that press the goto console.
- In that window open credentials and select the edit option… and the give your Xcode bundler identifier. and copy the Key Like as AIzaSyA0VTc9RJ2LcJRoysRq3WtnSDp1q7wMLdY.
- Again goto Getting Started Page and copy the bellow code:
- [GMSServices provideAPIKey:@"YOUR_API_KEY”];
- [GMSPlacesClient provideAPIKey:@"YOUR_API_KEY”];
- Open the Xcode and in that open the AppDelegate.h and import the
- #import <GoogleMaps/GoogleMaps.h>
- #import <GooglePlaces/GooglePlaces.h>
- Open the Xcode and in that open the AppDelegate.m and paste the content in did finishlaunch:
- [GMSServices provideAPIKey:@"YOUR_API_KEY”];
- [GMSPlacesClient provideAPIKey:@"YOUR_API_KEY”];
- Import the same files in viewController.h also.
- Goto AppDelegate.m file and type the following-
- -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
- [GMSServices provideAPIKey:@"AIzaSyA0VTc9RJ2LcJRoysRq3WtnSDp1q7wMLdY”];
- [GMSPlacesClien provideAPIKey:@"AIzaSyA0VTc9RJ2LcJRoysRq3WtnSDp1q7wMLdY”];return YES;}
- Goto Getting Started page and copy the following code in browser:
- (void)loadView { - // Create a GMSCameraPosition that tells the map to display the
- // coordinate -33.86,151.20 at zoom level 6.
- GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:-33.86
- longitude:151.20
- zoom:6];
- GMSMapView *mapView = [GMSMapView mapWithFrame:CGRectZero camera:camera];
- mapView.myLocationEnabled = YES;
- self.view = mapView;
- // Creates a marker in the center of the map.
- GMSMarker *marker = [[GMSMarker alloc] init];
- marker.position = CLLocationCoordinate2DMake(-33.86, 151.20);
//marker.position = camera.target;(Optional for the market.position)
marker.title = @"Sydney"; - marker.snippet = @"Australia";
- marker.map = mapView;
- }
Subscribe to:
Comments (Atom)
Recent Posts
Codable demo
Link: https://www.dropbox.com/s/kw7c1kgv1628bh7/codableDemo.zip?dl=0