Opened 13 years ago

Closed 13 years ago

#6289 closed (fixed)

Allow passing extra context to google-map.js

Reported by: omat at Owned by: jbronn
Component: GIS Version: gis
Severity: Keywords: gis, google maps, javascript
Cc: jbronn@…, omat@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The javascript template for displaying a Google Map is rendered inside the GoogleMap object with predefined parameters. Sometimes it may be useful to pass extra variables to the javascript temlaplates context.

For that, I patched the by adding 2 lines to allow passing an extra_context dictionary.

Attachments (2) (3.8 KB) - added by omat at 13 years ago.
modified version of to allow passing extra context to the js template
6289.diff (977 bytes) - added by arien 13 years ago.
patch proposed by reporter

Download all attachments as: .zip

Change History (8)

Changed 13 years ago by omat at

Attachment: added

modified version of to allow passing extra context to the js template

comment:1 Changed 13 years ago by omat@…

Version: SVNgis

Changed 13 years ago by arien

Attachment: 6289.diff added

patch proposed by reporter

comment:2 Changed 13 years ago by Simon Greenhill <dev@…>

Triage Stage: UnreviewedReady for checkin

comment:3 Changed 13 years ago by jbronn

Cc: jbronn@… added
Owner: changed from nobody to jbronn
Status: newassigned
Triage Stage: Ready for checkinUnreviewed

Sounds like a good idea, and I'm all for it -- but I just found out about the ticket so I need to review it first before I'll check it in. Thanks for contributing.

comment:4 Changed 13 years ago by jbronn

Cc: omat@… added
Triage Stage: UnreviewedDesign decision needed

If we are to go the keyword argument route I'd prefer to call it extra instead of extra_content (similar to IDL syntax). Or we could take it one step further -- add **kwargs, and have whatever additional keywords be sent to the template. A concern would be wanting to add a keyword argument in the future and messing up someone's template.

So I'm open to suggestions -- your thoughts?

comment:5 Changed 13 years ago by jbronn

Triage Stage: Design decision neededReady for checkin

On second thought extra_context is consistent with the Django API (specifically for generic views). No design design required.

comment:6 Changed 13 years ago by jbronn

Resolution: fixed
Status: assignedclosed

(In [7027]) gis: Fixed #6289 (added extra_context keyword to GoogleMap). Thanks omat & arien.

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