Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 27 13:55
    weblaunch commented #2632
  • Nov 26 16:34
    panteleevnikita commented #2781
  • Nov 17 21:04
    Evanzsnr closed #2840
  • Nov 17 21:02
    Evanzsnr closed #2842
  • Nov 16 13:49
    Evanzsnr commented #2842
  • Nov 16 13:40
    Evanzsnr commented #2842
  • Nov 16 13:34
    Evanzsnr commented #2842
  • Nov 15 15:52
    wf9a5m75 commented #2842
  • Nov 15 15:50
    wf9a5m75 commented #2842
  • Nov 15 03:22
    Evanzsnr commented #2842
  • Nov 15 03:21
    Evanzsnr commented #2842
  • Nov 15 01:49
    wf9a5m75 commented #2842
  • Nov 15 01:48
    wf9a5m75 commented #2842
  • Nov 15 01:05
    Evanzsnr opened #2842
  • Nov 14 00:58
    Evanzsnr closed #2841
  • Nov 14 00:58
    Evanzsnr commented #2841
  • Nov 14 00:47
    Evanzsnr commented #2840
  • Nov 13 10:17
    Evanzsnr commented #2840
  • Nov 13 09:00
    wf9a5m75 commented #2841
  • Nov 13 08:04
    Evanzsnr opened #2841
Yuri Reis
@yurireeis
@delfimvenceslau beleza
delfimvenceslau
@delfimvenceslau
@yurireeis tentei com um release antigo e build funciona só que quando abro o App ele dá a informação de Class not found, e o mapa não abre infelizmente
Yuri Reis
@yurireeis
entendi
tenta remover a pasta node_modules pra depois instalar, pra não ficar nenhum resquício da versão que estava dando problema
delfimvenceslau
@delfimvenceslau
certo vou remover
Yuri Reis
@yurireeis
e como são várias versões, tenta pelo menos umas 5 minor versions abaixo seguindo este passo
o recomendável (obviamente) é entender e corrigir o problema, mas pelo menos pra você não ficar impedido
delfimvenceslau
@delfimvenceslau
@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
delfimvenceslau
@delfimvenceslau
@yurireeis o erro que estou tendo é este: error: package za.co.twyst.tbxml does not exist
import za.co.twyst.tbxml.TBXML;
delfimvenceslau
@delfimvenceslau
da-me a entender que o packge não existe
Yuri Reis
@yurireeis
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
delfimvenceslau
@delfimvenceslau
Certo, vou tentar isso agora mesmo.
Yuri Reis
@yurireeis
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
@feenin
@fjckls I'm having the same issue.
Álex Meseguer
@alexmeseguer
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
@jakabm001
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!
g4bri3l123
@g4bri3l123
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
@syam38
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
@Monalis62621980_twitter
Hi, I am new in cordova googlemap plugin. I want to addKmlOverlay from xml string, not via url. Is that possible??
Masashi Katsumata
@wf9a5m75
@Monalis62621980_twitter addKmlOverlay supports local file.
Monalisa Saha
@Monalis62621980_twitter
@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
@wf9a5m75
Parsing from string is not available at this time
anchitd
@anchitd
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
@wf9a5m75
@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
@dhruvshah1093
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
@CrackerakiUA
Hey, is there a contributing docs anywhere? how do you build it for development of plugin it self
PakMan6
@PakMan6

Hi,
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() {
DirectionsService.route({
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;

console.log(this.bounds);

if (!this.renderer) {
this.renderer = this.map.addDirectionsRendererSync({
directions: result,
panel: 'guide',
draggable: true
});
console.log(this.renderer);
this.renderer.on(GoogleMapsEvent.DIRECTIONS_CHANGED).subscribe(this.onDirectionChanged.bind(this));
console.log(this.renderer.on(GoogleMapsEvent.DIRECTIONS_CHANGED).subscribe(this.onDirectionChanged.bind(this)));
} else {
this.renderer.setDirections(result);
console.log(this.renderer.setDirections(result));
}
});
}

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() {
this.map.animateCamera({
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
@mateuswetah

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
        this.loading.dismiss();

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

        // Center the map on the location, possibly including gasstation markers
        this.map.animateCamera({
          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.loading.dismiss();
        this.userLocation = null;

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

      });
  }

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

Mateus Machado Luna
@mateuswetah
So no one is facing a similar issue?
PakMan6
@PakMan6
@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
@mateuswetah
@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
PakMan6
@PakMan6

@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(){
this.map.clear();

// Get the user's current location
this.map.getMyLocation().then((location: MyLocation) => {
  // Move the map camera to the location with animation
  this.map.animateCamera({
    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
  marker.showInfoWindow();

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

  this.map.on(GoogleMapsEvent.MAP_READY).subscribe(
    (data) => {
        console.log('Click MAP', data);
    }
  );
})
.catch(err => {
  this.showToast(err.error_message);
});

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

Mateus Machado Luna
@mateuswetah
Thanks @PakMan6 I'll be able to test it by the weekend. Then I came back with feedback
4 replies
SnowBases
@SnowBases
sce.png
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
SnowBases
@SnowBases
7cec5de9-f322-44df-a8e1-5de46b65f3ff.jpg
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
@anandtripathi5
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
@anandtripathi5
Configuration of zoom is done, only new location on camera movement is remaining
hatimox
@hatimox
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
delfimvenceslau
@delfimvenceslau
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?