Progress will discontinue Telerik Platform on May 10th, 2018. Learn more
  • How to Use Google Maps Plugin in Telerik Platform

How to Use Google Maps Plugin in Telerik Platform

Environment

Service Code (AppBuilder)
Feature Import Custom Plugin
Mobile development type Hybrid (Apache Cordova app)
Mobile OS iOS, Android

Description

The Google Maps plugin offers a wrapper around the Google Maps Android API and Google Maps SDK for iOS. These APIs require API keys to work correctly and you need to set these keys in your project before building your app. This article provides instructions for importing the Google Maps custom plugin in a Telerik Platform app and setting the required API keys.

Solution

Follow the steps below to add the Google Maps plugin to your app.

  1. Import the latest version of the plugin, following the instructions in the documentation.
  2. Update the Cordova version of your project to 5.2.0. The APIs needed for the iOS version of the plugin are available only in the Cordova 5.2.0 version. If you need to keep using an older Cordova version, you can download an older plugin version:
  3. Open Plugins/cordova-plugin-googlemaps-master/plugin.xml. Find and delete the following lines:

    <preference name="API_KEY_FOR_ANDROID" />

    <preference name="API_KEY_FOR_IOS" />

  4. Go to Google Maps APIs and get your API keys for Android and iOS.
  5. Find these tags in plugin.xml and replace $API_KEY_FOR_ANDROID and $API_KEY_FOR_IOS with your API keys:
    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="$API_KEY_FOR_ANDROID" />
    <config-file target="*-Info.plist" parent="Google Maps API Key">
        <string>$API_KEY_FOR_IOS</string>
    </config-file>

Now, you are ready to build your app with the Google Maps API enabled.

Notes

You can find a sample AppBuilder app using the Google Maps custom plugin here: Google Maps Sample. Note that you will need to copy your API keys to lines 76 and 194 in the Google Maps plugin.xml in order for the sample to work.

Start a free trial Request a demo
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.