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.

Show div dynamically using MARKER_CLICK method

See original GitHub issue

plugin version: 2.0.0-beta2-20170717-1045

Is it supposed to be possible to show/hide a div using the MARKER_CLICK method? When clicking on a marker, I want to display a div but it is not working.

You can see the code below. You can also check the repo: https://github.com/antoine92190/ionic-map

this.map.addMarker(options, (marker) => {

    marker.on(plugin.google.maps.event.MARKER_CLICK, () => {
        this.buttonVisible = !this.buttonVisible;
    })

})
<div #map id="map">

    <button ion-button *ngIf="buttonVisible">
        I'm a button
    </button>

</div>

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
wf9a5m75commented, Jul 17, 2017
map.on("buttonVisible_changed", function(prevValue, newValue) {
  button.style.display = newValue === true ? "block" : "none";
  cordova.fireDocumentEvent('plugin_touch', {});
});
1reaction
antoine92190commented, Jul 17, 2017

I just tested, it also works on ionic. Thanks! Actually, I encountered this issue when trying to reproduce another issue from my main project. I think both issues are linked, so I’ll try and see if your system fixes my other issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

removing dynamically created <div> triggered from Google ...
removing dynamically created <div> triggered from Google map marker click ... From the digging I've done it looks like I want to use...
Read more >
Make sidebar div active on Marker click (and vice versa)?
Changing list-item css class using ng-class when mousing over Leaflet Map Markers? 1 · Dynamic map sidebar with info from marker upon click...
Read more >
Google Maps Events - W3Schools
Run a function when the user clicks on the map. The placeMarker() function places a marker where the user has clicked, and shows...
Read more >
Change source of shape MapLayer on marker click - Telerik
Now, i need dynamically show lines initiated from these coordinates on m... ... In my understanding marker click is a client-side event.
Read more >
Lat/Lng Object Literal | Maps JavaScript API
LatLng object, to center the map and add a marker. LatLng object literals are a convenient way to add a LatLng coordinate and,...
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