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?
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.
Most helpful comment
I solved
import MapViewBase every time before import sdk