[Vuejs]-How use API Google map SDK Nativeproject

0👍

Follow the steps in the plugin docs here

Which, in summary amount to:

  1. in app/App_Resources/Android/src/main/res/values create a file named nativescript-google-maps-sdk.xml and put the following text in it:
<?xml version="1.0" encoding="utf-8"?>
<resources>
     <string name="nativescript_google_maps_api_key">YOUR_API_KEY_HERE</string>
</resources>

obviously, replace YOUR_API_KEY_HERE with the actual API key you’ve received from Google.

  1. Edit the AndroidManifest.xml file at app/App_Resources/Android/src/main/AndroidManifest.xml and add the following lines just under the closing tag for the block:
        <meta-data
           android:name="com.google.android.geo.API_KEY"
           android:value="@string/nativescript_google_maps_api_key" />
  1. for iOS there is another method that consists of adding code into the app.js startup file. see the docs for details on that.

That should do it for you.

Leave a comment