Latest 1.0
Homepage https://github.com/anumshk27/TPLMaps
License MIT
MIT License

Copyright (c) 2017 TPLMaps

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Platforms ios 8.0, requires ARC
Authors

TPLMaps

Getting Started

Before you can begin working with TPL Maps on iOS, you need to download the TPL Maps SDK for iOS.

Step 1: Get the latest version of Xcode

To build a project using the Google Maps SDK for iOS, you need version 7.3 or later of Xcode.

Step 2: Install the SDK

The TPLMap SDK for iOS is available as a CocoaPods pod. CocoaPods is an open source dependency manager for Swift and Objective-C Cocoa projects.

If you don’t already have the CocoaPods tool, install it on macOS by running the following command from the terminal. For details, see the CocoaPods Getting Started guide.

sudo gem install cocoapods

Create a Podfile for the TPLMaps SDK for iOS and use it to install the API and its dependencies:

  1. If you don’t have an Xcode project yet, create one now and save it to your local machine. (If you’re new to iOS development, create a Single View Application.)

  2. Create a file named Podfile in your project directory. This file defines your project’s dependencies.

  3. Edit the Podfile and add your dependencies. Here is an example which includes the dependencies you need for the TPLMaps SDK for iOS:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'

target 'YOUR_APPLICATION_TARGET_NAME_HERE' do
pod 'TPLMaps'
end
  1. Save the Podfile

  2. Open a terminal and go to the directory containing the Podfile:

    cd <path-to-project>
  3. Run the pod install command. This will install the APIs specified in the Podfile, along with any dependencies they may have.

  4. Close Xcode, and then open (double-click) your project’s .xcworkspace file to launch Xcode. From this time onwards, you must use the .xcworkspace file to open the project.

Step 3: Add a map

The code below demonstrates how to add a simple map to an existing ViewController. If you’re creating a new app, first follow the installation instructions above, and create a new Single View Application; disabling Use Storyboards but enabling Use Automatic Reference Counting (ARC).

Now, add or update a few methods inside your app’s default ViewController to create and initialize an instance of TPLMapView.

- (void)viewDidLoad {

    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

    TPLMapView * mapView = [[TPLMapView alloc] initWithFrame:self.view.frame];
    mapView.showsUserLocation = YES;
    mapView.myLocationButtonEnabled = YES;
    [self.view addSubview:mapView];

    TPLMarker * marker = [TPLMarker markerWithPosition:CLLocationCoordinate2DMake(33.522484, 73.094552)];
    marker.title = @"TPL Trakker";
    marker.subTitle = @"Rawalpindi Office";
    [mapView addMarker:marker];

}

Add Circle On MapView

    // CLLocationCoordinate2D coordinates
    // CLLocationDistance radius
    TPLCircle * circle = [TPLCircle circleWithCenterCoordinate:coordinates radius:radius];
    circle.outlineWidth=5;
    circle.transparent = YES;
    circle.fillColor = [UIColor purpleColor];
    circle.outlineColor = [UIColor yellowColor];
    circle.zIndex = 1;
    [mapView drawCircle:circle];

Add Polyline On MapView


  //NSArray * coordinates; contains latitude and longitude values in array.
  int pointCount = (int)[coordinates count];
    CLLocationCoordinate2D *coordinateArray = (CLLocationCoordinate2D *)malloc(pointCount * sizeof(CLLocationCoordinate2D));

    for (int i = 0; i < pointCount; ++i) {

        double lat = [coordinates[i][@"lat"] doubleValue];
        double lon = [coordinates[i][@"lon"] doubleValue];
        CLLocation *location = [[CLLocation alloc] initWithLatitude:lat longitude:lon];
        coordinateArray[i] = [location coordinate];

    }

    TPLPolyLine * polyline = [TPLPolyLine polylineWithCoordinates:coordinateArray count:pointCount];
    polyline.outlineWidth=1;
    polyline.transparent = NO;
    polyline.lineWidth = 5;
    polyline.outlineColor = [UIColor purpleColor];
    polyline.fillColor = [UIColor colorWithRed:255.f/255.f green:111.f/255.f blue:105.f/255.f alpha:.1f];
    [mapView drawPolyLine:polyline];

Add Polygon On MapView


    TPLPolygon *polygon = [TPLPolygon polygonWithCoordinates:coordinateArray count:pointCount];
    polygon.outlineWidth=5;
    polygon.fillColor = [UIColor redColor];
    polygon.transparent = NO;
    polygon.outlineColor = [UIColor colorWithRed:244.0/255.0 green:66.0/255.0 blue:226.0/255.0 alpha:1.0];
    [mapView drawPolygon:polygon];

Latest podspec

{
    "name": "TPLMaps",
    "version": "1.0",
    "summary": "TPL Maps, a product of TPL Trakker Ltd. is Pakistanu2019s first indigenous digital mapping solution.",
    "description": "TPL Maps, a product of TPL Trakker Ltd. is Pakistanu2019s first indigenous digital mapping solution. TPL Maps has been created using state of the art technology that will not only provide real time intelligent routing but also give users access to live traffic updates, turn-by-turn navigation and smart search options. TPL Maps will help users reach their desired destination by utilizing the smart search option that has over 1.35 million Points of Interests (POIs) to choose from across Pakistan. TPL Maps has been created locally and covers over 500 cities and 800,000 distinct housing addresses spread over a road network of 280,000 km. In addition TPL Maps also includes 2D models of over 55,000 POIs which will further assist users identify and reach their desired location in the shortest time period possible. TPL Maps provides voice guided turn-by-turn navigation while taking into considerations the live traffic information in the system as well as road priority levels and other variables to provide the optimum route according to the requirements of each individual user.",
    "homepage": "https://github.com/anumshk27/TPLMaps",
    "screenshots": [
        "https://dl.dropboxusercontent.com/s/39nvaudsw5q063i/1.png",
        "https://dl.dropboxusercontent.com/s/jciheijrmo8ip3g/2.png",
        "https://dl.dropboxusercontent.com/s/ev7kkqh5npr6aga/3.png"
    ],
    "license": {
        "type": "MIT",
        "text": "                n                   MIT LicensennCopyright (c) 2017 TPLMapsnnPermission is hereby granted, free of charge, to any person obtaining a copynof this software and associated documentation files (the "Software"), to dealnin the Software without restriction, including without limitation the rightsnto use, copy, modify, merge, publish, distribute, sublicense, and/or sellncopies of the Software, and to permit persons to whom the Software isnfurnished to do so, subject to the following conditions:nnThe above copyright notice and this permission notice shall be included in allncopies or substantial portions of the Software.nnTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORnIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEnAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERnLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THEnSOFTWARE.n"
    },
    "authors": {
        "TPLMaps": "[email protected]"
    },
    "social_media_url": "https://www.facebook.com/TPLMaps/",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/anumshk27/TPLMaps.git",
        "tag": "1.0"
    },
    "ios": {
        "vendored_frameworks": "TPLMaps/TPLMaps.framework",
        "frameworks": [
            "UIKit",
            "CoreLocation",
            "SystemConfiguration",
            "CFNetwork",
            "CoreGraphics",
            "QuartzCore",
            "GLKit",
            "OpenGLES"
        ]
    },
    "resources": "TPLMaps/TPLMaps.bundle",
    "requires_arc": true
}

Pin It on Pinterest

Share This