ionic-team / ionic-native-google-maps

Google maps plugin for Ionic Native
Other
221 stars 125 forks source link

How can i send data from InfoWindow to another page #204

Closed Serranosoft closed 5 years ago

Serranosoft commented 5 years ago

I'm submitting a ... (check one with "x")

How can i send data from infoWindow when i click and get that data on another page? I tried to do a forEach for every marker that i have then addEventListener(GoogleMapsEvent.INFO_CLICK) on every marker on that loop where i call a method where i get the data and send to another page but it doesnt work, i did something wrong? sorry for my bad english im using Ionic 4

wf9a5m75 commented 5 years ago

How did you write your code?

Serranosoft commented 5 years ago

Im using Event listeners for every marker where im calling a method which uses events to publish the data and the another page subscribe the data im getting the right data which is an array in console but cant display it i get some help on stackoverflow but nothing works and i suppose that maybe using events to pass data from googlemaps to another page is not correct

you can see some code that i post on stackoverflow https://stackoverflow.com/questions/55607741/ionic-angular-html-doesnt-display-information-from-ts-file

wf9a5m75 commented 5 years ago

Unfortunately, I'm not an expert of ionic. Please create a simple project , then share it on Github repository.

Serranosoft commented 5 years ago

Oh ok i dont know if its right to do another question but im having troubles with using custom icons on markers if (marker.ic_ruta == null) { icon = 'assets/imgs/icono_bebir_mapa_bares.png'; } else { icon = 'http://52.210.18.168/bebir/php/archivos_subidos/' + marker.ic_ruta; } marker.ic_ruta in this case is _1555935240.png and if you open that url you can see an image why it display like the default icon?(red marker) im using that icon variable here

map.addMarker({ 'position': coordenadas, 'title': marker.b_nombre, 'snippet': marker.b_direccion, 'icon': icon

wf9a5m75 commented 5 years ago

It's various reasons, such as can not access to the image url.

Serranosoft commented 5 years ago

http://52.210.18.168/bebir/php/archivos_subidos/_1555935240.png you cant access here?

Serranosoft commented 5 years ago

I dont know why but if i use an public image hosting like http://imagizer.imageshack.com/img921/4412/cSxaZ5.png it works but if i use http://52.210.18.168/bebir/php/archivos_subidos/_1555935240.png it doesn't work how can i make it work with my own server

Serranosoft commented 5 years ago

Maybe it was very stupid but it worked using my own domain instead ip thanks