Opened 17 years ago

Closed 17 years ago

#6289 closed (fixed)

Allow passing extra context to google-map.js

Reported by: omat at gezgin.com 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

Description

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 gmap.py by adding 2 lines to allow passing an extra_context dictionary.

Attachments (2)

gmap.py (3.8 KB ) - added by omat at gezgin.com 17 years ago.
modified version of gmap.py to allow passing extra context to the js template
6289.diff (977 bytes ) - added by arien 17 years ago.
patch proposed by reporter

Download all attachments as: .zip

Change History (8)

by omat at gezgin.com, 17 years ago

Attachment: gmap.py added

modified version of gmap.py to allow passing extra context to the js template

comment:1 by omat@…, 17 years ago

Version: SVNgis

by arien, 17 years ago

Attachment: 6289.diff added

patch proposed by reporter

comment:2 by Simon Greenhill <dev@…>, 17 years ago

Triage Stage: UnreviewedReady for checkin

comment:3 by jbronn, 17 years ago

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 by jbronn, 17 years ago

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 by jbronn, 17 years ago

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 by jbronn, 17 years ago

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