Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Add showInfowindow method to Markers #306

excid3 opened this Issue · 3 comments

2 participants


I wanted to propose adding a method like this to the Marker classes:

  showInfowindow : () ->
    @controller._closeVisibleInfoWindow(), @serviceObject)
    @controller._setVisibleInfoWindow @infowindow

We've got this method:

  _openInfowindow : () ->
    that = @
    return ->
      # Close the latest selected marker before opening the current one.
      that.controller._closeVisibleInfoWindow(), that.serviceObject)
      that.controller._setVisibleInfoWindow that.infowindow

Which is very similar and wondered what your thoughts were on adding something like this. It makes it really easy for me to add a "View on Map" link that I can use a data attribute to quickly find the marker and show the infowindow like so:

  $('.marker-link').on 'click', ->
    id = $(this).data("marker-id")
    marker = $.grep, (e) -> is id

Figured this might be useful, but wanted to get some feedback before I submitted a pull request.


what about:

showInfowindow : () ->

Yes if that works! (I'm not great at javascript yet). Just mainly wanted a simpler way to find and show the infowindow from javascript.


I'm revisiting this pretty late, but I can confirm that your code does work for me. (and it's a lot simpler :smile:)

I can submit a pull request for this on just Google Maps, but I'm not familiar with how to do this on OpenLayers or Bing maps since I've never used them. I imagine it'd be useful to have on each, so do you know which docs to point me to and I'll see about adding this for the other providers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.