programmatically click marker
See original GitHub issue
I have a scrollable/horizontal list of locations on the bottom of the map, the idea is that the user can click on a location in this list, and I want to programmatically click or show the corresponding markers InfoWindow.
I have this method for when a user clicks on a marker which works fine:
onMarkerClick(props, marker, e) {
this.setState({
selectedPlace: props,
activeMarker: marker,
showingInfoWindow: true
});
}
While i can reproduce the “props” parameter, I haven’t been able to reproduce the “marker” parameter.
Is there anyway to do what I describe?
In the attached file I want to be able to click on the banner on the bottom, Strathcona Park, when I do that, I want to open up the markers InfoWindow inside the map.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:12
Top Results From Across the Web
Programmatically click on marker and map - Stack Overflow
The right way to trigger a marker click/event programmatically is by using google.maps.event : google.maps.event.trigger(marker, 'click').
Read more >Google Maps Marker click event programmatically?
Good morning, I use Google Maps Native and I created a marker's click event : marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => { .
Read more >Markers | Maps JavaScript API - Google Developers
Markers are designed to be interactive. For example, by default they receive 'click' events, so you can add an event listener to bring...
Read more >Maps API v3 Trigger a marker click from an external link
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
Read more >Xamarin.Forms.Maps - Pin.SendMarkerClick Method
Xamarin.Forms.Maps - How to fire pin click event programmatically - Pin.SendMarkerClick Method. I have a list of map locations when I click ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can reference the marker you want to click by ref id.
<Marker ref={“marker1”} />
retrieve the marker you want to with var ref= this.refs.marker1;
Thanks @abedsh 👍 You can then call
onMarkerClick
using: