Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • Sep 22 15:25
    diegofdospina closed #2881
  • Sep 22 15:25
    diegofdospina commented #2881
  • Sep 22 00:47
    wf9a5m75 commented #2881
  • Sep 22 00:43
    wf9a5m75 edited #2881
  • Sep 21 22:38
    diegofdospina opened #2881
  • Sep 15 06:32
    secretmoo35 commented #2877
  • Sep 15 06:16
    adnanmasd commented #2877
  • Sep 15 03:52
    secretmoo35 commented #2877
  • Sep 09 10:14
    piyushysoft commented #1704
  • Sep 08 11:34
    CodeWithOz opened #2880
  • Sep 07 13:15
    timsar2 commented #2855
  • Sep 06 12:55
    lucasgalli commented #2855
  • Sep 03 14:50
    ppetree commented #2855
  • Sep 02 13:24
    lucasgalli commented #2855
  • Sep 02 10:34
    keriroso commented #2857
  • Sep 01 16:27
    lucasgalli commented #2855
  • Sep 01 13:58
    lucasgalli commented #2855
  • Aug 31 21:42
    KimberleeDArmstrong commented #2869
  • Aug 31 16:34
    keriroso commented #2857
  • Aug 09 07:10
    EinfachHans commented #2872
Yuri Reis
o recomendável (obviamente) é entender e corrigir o problema, mas pelo menos pra você não ficar impedido
@wf9a5m75 tinha dito que se calhar é um problema com o meu gradle por ser antigo, estou a atualizar o Gradle e tentar com a nova versão 2.6.2
@yurireeis o erro que estou tendo é este: error: package za.co.twyst.tbxml does not exist
import za.co.twyst.tbxml.TBXML;
da-me a entender que o packge não existe
Yuri Reis
pra eliminar essa possibilidade eu faria o seguinte...
iniciaria um projeto do zero (hello-world) apenas com essa dependência
e tentaria inicializar o mapa
Certo, vou tentar isso agora mesmo.
Yuri Reis
caso o mapa não inicialize mesmo assim, podemos concluir que o problema está relacionado a versão ou a este pacote
Coupon rabais Quebec
@fjckls I'm having the same issue.
Álex Meseguer
Hi, is it possible to initially hide a map in a window and show it with a button later? When I try hide this map, it shows this error: "Error: DIV[#mapaIncidencia] is too small. Must be bigger than 100x100.
Error: DIV[#mapaIncidencia] is too small. Must be bigger than 100x100."
Marton Jakab
Hi, anyone experiencing changes in the map zooming/tapping in version 2.6.2 ? I have an issue that the default zooming on tap to screen shows less than before. It seems to me the scaling of the zoom has changed, is this a new feature or a bug? It causes some problems for me since I have clusters of elements on my map - the look is related to zooming - , which not properly working now. Thanks!
Hi, i'm facing a problem with the backgroundcolor. I saw about the Environment.setBackgroundColor, but the problem is that I use a image as background. How can I resolve this? Is there a way to back to my background image when I change to another page?
Syam Pradeep Reddy
Encountered this error while using cordova-plugin-google-maps
Error: Error while computing Geocode ReferenceError: google is not defined
Any idea on how to resolve it?
Monalisa Saha
Hi, I am new in cordova googlemap plugin. I want to addKmlOverlay from xml string, not via url. Is that possible??
Masashi Katsumata
@Monalis62621980_twitter addKmlOverlay supports local file.
Monalisa Saha
@wf9a5m75 Does it mean, we can't do that. If yes could you please share some code snippet. I am actually looking for something like geoxml3 kind of functionality.
Masashi Katsumata
Parsing from string is not available at this time
Hi , Due to security constraints, we want to remove the google_key from manifest file and move inside the java class .how is it possible ? Kindly revert back.
Masashi Katsumata
@anchitd not possible. Because Google Maps SDK for Android reads from the API key from android_manifest.xml
Howerver you can set the restrictions for the key at Google Cloud Console
Such as specifying package name, signature, which APIs are enabled for the key
Dhruv Shah
Hi, In my project sometimes I get the following error
TypeError Map.<anonymous>(plugins/cordova-plugin-googlemaps/www/Map)
Cannot read property '_privateInitialize' of undefined
Using cordova-plugin-googlemaps 2.6.2
Error seen on both android and ios apps.
Can anyone tell me why is this happening ? Thanks!!
Honchar Denys
Hey, is there a contributing docs anywhere? how do you build it for development of plugin it self

I'm fairly new to native google maps (I've used Maps JavascriptAPI successfuly in the past). I followed the quickdemo-v5 example and managed to get "current device location" and "geocoder" to work but I'm unable to get directions to work as it gives me an error as copied below when I call the requestDirection() method. Can anyone please help me solve this problem. I'm using ionic 6 framework.

ERROR Error: Uncaught (in promise): TypeError: Cannot redefine property: waypoints
TypeError: Cannot redefine property: waypoints
at Function.defineProperty ()
at new DirectionsRenderer (DirectionsRenderer.js:55)
at Map.addDirectionsRenderer (Map.js:1156)
at index.js:1762
at GoogleMap.push../node_modules/@ionic-native/google-maps/index.js.GoogleMap.addDirectionsRendererSync (index.js:1774)
at home.page.ts:208
at ZoneDelegate.invoke (zone-evergreen.js:364)
at Object.onInvoke (core.js:41667)
at ZoneDelegate.invoke (zone-evergreen.js:363)
at Zone.run (zone-evergreen.js:123)
at resolvePromise (zone-evergreen.js:798)
at zone-evergreen.js:864
at ZoneDelegate.invokeTask (zone-evergreen.js:399)
at Object.onInvokeTask (core.js:41645)
at ZoneDelegate.invokeTask (zone-evergreen.js:398)
at Zone.runTask (zone-evergreen.js:167)
at drainMicroTaskQueue (zone-evergreen.js:569)

I copied and used the code from the quickdemo-v5 example.. snippet below:

requestDirection() {
origin: this.origin,
destination: this.destination,
travelMode: TravelModeId.DRIVING
}).then((result: DirectionsResult) => {
console.log(JSON.stringify(result, null, 2));
this.bounds = result.routes[0].bounds;


if (!this.renderer) {
this.renderer = this.map.addDirectionsRendererSync({
directions: result,
panel: 'guide',
draggable: true
} else {

onDirectionChanged() {
const directions: DirectionsResult = this.renderer.getDirections();
this.origin = directions.routes[0].legs[0].start_location;
this.destination = directions.routes[0].legs[0].end_location;
this.bounds = directions.routes[0].bounds;

onSplitterDragEnd() {
target: this.bounds,
duration: 500


// Update server with user position
updateDBPosition() {
this.uID = this.authService.userData.uid;
this.updateValues = {
currentPosition: this.userPosition,
// status: 'online',
this.userPositionService.update_userPosition(this.uID, this.updateValues);

4 replies
Mateus Machado Luna

Hi guys, hope you can help. I've been enjoying the plugin a lot and it certainly attends to my needs. Unfortunately, the getMyLocation() function for me is not working. I dig into the repo issues and the closest suggestion that I can have is to use the LocationService instead of accessing from this.map. The problem is that it doesn't even emits an error, all I have is infinite loading state. I was able to grant permissions, GPS on, etc... to be honest, the first time I tried it seemed ok but lately it never works. I went back several of my own commits to make sure it wasn't something on my side...

Here is my function:

  // Find user location using GPS and center map on it
  async centerUserLocation() {

    // Shows loading controller while looking for gps
    this.loading = await this.loadingControler.create({
      message: 'Looking for you...'
    await this.loading.present();

    LocationService.getMyLocation({ enableHighAccuracy: true })
      .then((location: MyLocation) => {

        // Done loading

        // Saves for latter usage when moving camera after search
        this.userLocation = location.latLng;

        // Center the map on the location, possibly including gasstation markers
          target: (this.markers && this.markers.length) ? this.markers.map((aMarker) => aMarker.getPosition()).concat(this.userLocation) : this.userLocation,
          zoom: 17,
          tilt: 30

      .catch((error) => {

        // Done loading
        this.userLocation = null;

        switch(error.error_code) {
          case 'not_available':
            this.presentLocationErrorToast('Location not found.', true);
            this.presentLocationErrorToast('There is something wrong...', false);


Does anyone has any clue of something that I could try?

Mateus Machado Luna
So no one is facing a similar issue?
@mateuswetah I've run 3 seperate test projects and it seems fine.. getMyLocation() method works fine. You say there are no errors? meaning the map displays but no marker? Have you checked your marker icon. maybe you forgot to set a marker.
Mateus Machado Luna
@PakMan6 thanks for the help. Yeah, I'm sure there is no problem with the markers. Is the getMyLocation()function that never ends, neither reaching the then() or catch()
Everything else with the map seems to be ok. I tested on different devices, btw

@mateuswetah Try this:
''' CODE BELOW ---------------
// Add to your imports >> import {GoogleMap, MyLocation} from '@ionic-native/google-maps'; // Note: I use ionic framework
// Declare variable map: GoogleMap;
// Your method or function starts here
async centerUserLocation(){

// Get the user's current location
this.map.getMyLocation().then((location: MyLocation) => {
  // Move the map camera to the location with animation
    target: location.latLng,
    zoom: 17,
    tilt: 30,

  // add a marker
  const marker: Marker = this.map.addMarkerSync({
    title: 'My location',
    position: location.latLng,
    animation: GoogleMapsAnimation.BOUNCE

  // show the infoWindow

  // If clicked, display an alert .. can use infoWindow() instead?
  marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => {
    this.showToast('That is you');

    (data) => {
        console.log('Click MAP', data);
.catch(err => {

''' END OF CODE---------------

Mateus Machado Luna
Thanks @PakMan6 I'll be able to test it by the weekend. Then I came back with feedback
4 replies
Hi guys, newbie here, anyone know why this square edge happen?
this.map.addPolyline({ points: decodedPoints, color: 'white', width: 6, geodesic: true, clickable: false, zIndex: 3 });
this.map.addPolyline({ points: decodedPoints, color: 'green', width: 8, geodesic: true, clickable: false, zIndex: 2 });
This was my code
Nevermind! I fix it by putting rgba() values in color.. but the default value will make it transparent 80% by default (i'm not sure why 80%)...
Anand Tripathi
How can I get a new location on camera movement? Like if I move the camera(view) of the map, I want to get the new location. Also, how can I lock the zoom through some configuration!. Help would be much appreciated
Anand Tripathi
Configuration of zoom is done, only new location on camera movement is remaining
hello all , can any one please check this issue ionic-team/ionic-native-google-maps#342
i need to display multiple HtmlInfoWindow at the same time , but only the last one displayed
Pessoal estou tendo um problema com o plugin do Google maps, ao iniciar o app ele diz para atualizar o Google Play Services e depois fecha a aplicação alguém já passou por isso?
Good evening!
I'm working on ionic angular app using maps plugin: on iOS the map ios ok, but on android it's show as white...It seems the _gmapscdv class isn't added to html elements on android ... do you have some hint?
Hello everyone, I am doing Cordova app and when using this plugin I receive G map with all landmarks, property markers, compass .... anyone know how to get just clean map? thank you
Osman Raif Güneş
Test automation tool and device farm : https://appsumo.com/roboticmobi/