Latest 1.1.0
License MIT
Platforms ios 8.0


Direction for Google Map for iOS SDK

How to use

tap the window

make marker

one more tap

make two marker

It appears a line connecting the two markers

Direction !!!

You can change the the search method press the WALKINGH button

install this code

ssh :: git clone [email protected]:keisukeYamagishi/SHIDirection.git

https :: git clone

if click download button !!! right now!!!

Easy start

default map line width 0.6f
default map color #4682b4

get route!!!!

    GMSDirection* direction = [[GMSDirection alloc]initWithStart:latlng destinationLoc:desLang];

    direction.directionType = GMSDirectionTypeWalking;

    [direction directionsCompletionHandler:^(GMSRouteDto* routeData){

        [GMSDirection addOverLay:routeData map:_mapview];

    }failureHandler:^(GMSError* error){


There is also this kind of use

    GMSDirection* direction = [[GMSDirection alloc]initWithStart:_latLngArray[0] goal:_latLngArray[1]];

    direction.directionType = GMSDirectionTypeWalking;

    [direction directionsCompletionHandler:^(GMSRouteDto* routeData){

        [THisClass addOverLay:routeData map:_mapview withLineColor:SHIDodgerBlueColor];

    }failureHandler:^(GMSError* error){
        NSLog(@"Error : %@" ,error.userInfo[GMSErrorDescriptionKey]);

+ (GMSPolyline*)convertPolyLine:(NSString*)route{
    GMSPath *path = [GMSPath pathFromEncodedPath:route];
    return [GMSPolyline polylineWithPath:path];

+(void)addOverLay:(GMSRouteDto*)route map:(GMSMapView *)map withLineColor:(NSString *)color{
    for( NSString* line in route.routePattern ){
            [THisClass addRouteToMap:[THisClass convertPolyLine:line] withMap:map withColor:color];

+(void)addOverLay:(GMSRouteDto*)route map:(GMSMapView *)map{
    for( NSString* polyline in route.routePattern ){
            [THisClass addRouteToMap:[ViewController convertPolyLine:polyline] withMap:map withColor:SHICyanColor];

+(void)addRouteToMap:(GMSPolyline *)line withMap:(GMSMapView *)map withColor:(NSString *)color{
       || color.length <= 0){
        color = SHIDodgerBlueColor;
    line.strokeColor=[SHColorSixteen colorCovertSixteen:color alpha:0.9];

too easy!!

Please pass the first position and the goal of the position as parameter

get route


SHIDirection is licensed under the MIT license.

Latest podspec

    "name": "GMSDirection",
    "version": "1.1.0",
    "summary": "You can easily search the route..",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "keisuke": "[email protected]"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "source": {
        "git": "",
        "tag": "1.1.0"
    "source_files": [

Pin It on Pinterest

Share This