Nativescript-vue: Unable to get nativescript-google-maps-sdk to work

Created on 1 Apr 2018  路  3Comments  路  Source: nativescript-vue/nativescript-vue

I have been unable to this to work in Vue on Android. I'm using "vue-cli-template" (with Vuex and VueRouter) without any modifications. Ran npm install nativescript-google-maps-sdk, copied the Android 'nativescript_google_maps_api.xml' to the appropriate directory under "template" (and it shows under the dist directory), but when I attempt to use the Maps in Vue it does not load anything.

I added Vue.registerElement ("MapView", () => require ("nativescript-google-maps-sdk").MapView); to main.js and attempt to use "MapView" in HelloWorld.vue. I do not get any compile errors, but when I attempt to view "Hello World" it does not load up (no error, just says: _{NSVue (Vue: 2.5.13 | NSVue: 1.3.1)} -> CreateElement(MapView)_ - nothing follows it).

If I try to put it in "Home.vue", I get the error "A Frame must be used to navigate to a page".

I have also tried doing an import:

import { MapView } from 'nativescript-google-maps-sdk';

export default {
   components: {
      MapView
   },

and that results in the error "Cannot read property 'extend' of undefined. File: "/data/data/org.nativescript.application/files/internal/ts_helpers.js, line: 50, column: 12"

Any ideas?

Most helpful comment

I solved
import MapViewBase every time before import sdk

import { MapViewBase } from 'nativescript-google-maps-sdk/map-view-common';

All 3 comments

I solved
import MapViewBase every time before import sdk

import { MapViewBase } from 'nativescript-google-maps-sdk/map-view-common';

Hi. Did you have it working in iOS also?

We are locking this issue because it has been closed for more than 14 days.

If the issue comes up again please open a new issue with additional details.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Tronix117 picture Tronix117  路  3Comments

vhristov5555 picture vhristov5555  路  4Comments

mpaccione picture mpaccione  路  3Comments

tralves picture tralves  路  4Comments

Sjoerd picture Sjoerd  路  3Comments