Opened 7 years ago

Last modified 5 years ago

#11072 assigned New feature

Add Info Window Html to GMarker

Reported by: Ubercore Owned by: jbronn
Component: GIS Version: master
Severity: Normal Keywords: googlemaps marker gis
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no


I did a quick search for this and didn't find any previous work.

It allows you to set HTML for a GInfoWindow on an instance of a GMarker. No support for options on the info window yet, this is just the simplest case.

I did see that it's possible to accomplish this using the GEvent class in, but I think there's value in being able to set it directly on the marker.

google-map.js uses bindInfoWindowHtml() to add the info window when the marker is added.

A more complete solution might involve implementing GInfoWindow and GInfoWindowOptions, but I didn't want to implement them since they have no public constructor in the Google Maps API. Maybe represent the info window as a tuple of (html, { options})?

Anyway, this tackles the simplest case.

Example usage:

marker = GMarker(object.location, title=object.address)
marker.infowindowhtml = "<p>Info Window!</p>";

Attachments (1)

add_info_window_html.diff (2.4 KB) - added by Ubercore 7 years ago.

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by Ubercore

comment:1 Changed 7 years ago by Ubercore

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Sorry, my example has a typo. It should have been

marker = GMarker(object.location, title=object.address)
marker.info_window_html = "<p>Info Window!</p>";

comment:2 Changed 7 years ago by jbronn

  • milestone set to 1.2
  • Owner changed from nobody to jbronn
  • Status changed from new to assigned

comment:3 Changed 7 years ago by Alex

  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 7 years ago by ubernostrum

  • milestone 1.2 deleted

1.2 is feature-frozen, moving this feature request off the milestone.

comment:5 Changed 5 years ago by julien

  • Needs documentation set
  • Needs tests set
  • Severity set to Normal
  • Type set to New feature

comment:6 Changed 5 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:7 Changed 5 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

Note: See TracTickets for help on using tickets.
Back to Top