question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to get more information than just coordinates from 'didTap' event

See original GitHub issue

I’m using the following code to capture events when a user taps on a marker which I’m setting with the “addMarker” method CapacitorGoogleMaps.addListener("didTap", (value) => { console.log('didTap fired', value.result); });

On ios, the resulting value in the function above has the following structure: { result: { coordinates: { latitude: number, longitude: number } } }

On android, I get an entirely different object in the value: { location:{ latitude: number, longitude: number }, name: string, snippet: string }

Is there any way to expose information other than just latitude and longitude on both ios and android? It would also be incredibly useful if we could expose information about the tapped marker beyond just what is visible in the settings as I’d like to act on a unique identifier other than the gps coordinates. Also curious if the plan is to return a consistent object structure across both ios and android.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
quaz579commented, Jan 28, 2021

I went ahead and approved this as I didn’t see any code smells and it seemed like a fairly lightweight change. That said, I do come from a .NET background primarily so take my approval with a grain of salt.

On Thu, Jan 28, 2021 at 10:37 AM Hemang Kumar notifications@github.com wrote:

@quaz579 https://github.com/quaz579, fyi the fix is up at #27 https://github.com/hemangsk/capacitor-googlemaps-native/pull/27, it’d be nice if you can give the PR a review 😃

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hemangsk/capacitor-googlemaps-native/issues/22#issuecomment-769170235, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADIMKHTZOO2TCUXCBTE2B2TS4GAETANCNFSM4VWOM5XQ .

0reactions
hemangskcommented, Feb 1, 2021

@quaz579 Sure, sounds good. What time zone are you in btw? feel free to shoot an email at hemangsk@gmail.com

Read more comments on GitHub >

github_iconTop Results From Across the Web

Polyline Tap in Google Maps - ios - Stack Overflow
I believe in Google Maps version 3 for web, you have the ability to add event listener for polylines like this: google.maps.event.addListener( ...
Read more >
Solved: Re: Get the coordinates of a click/touch event - Page 2
I found a work around for capturing a click event in the Map input. Using the Map tool I overlay a map at...
Read more >
Adding linear events by coordinate location—ArcGIS Pipeline ...
The Line Events tool provides an interface to add linear events by typing or selecting their x,y coordinates.
Read more >
javascript - How do you get the coordinates from a drag event ...
I did this, and it works! var directionsDisplay = new google.maps.DirectionsRenderer(rendererOptions); ... google.maps.event.
Read more >
Event Listeners on Android not firing? #86 - GitHub
Describe the bug On android, it seems any event listener (outside of map ... able to get 'didChange' to fire by putting cameraIdle...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found