Created
December 28, 2012 16:52
-
-
Save mhluongo/4399621 to your computer and use it in GitHub Desktop.
A pymaps extension that exposes maps globally in Javascript.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pymaps import PyMap | |
class MyPyMap(PyMap): | |
#old-style classes, unfortunately | |
def _mapjs(self, map): | |
super_js = PyMap._mapjs(self, map) | |
return super_js + 'PyMaps.push(%s);\n' % map.id | |
def _buildmaps(self): | |
super_js = PyMap._buildmaps(self) | |
return "PyMaps = [];" + super_js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment