Reputation: 81
i have to variables xx = 38.929787 yy = 22.675781
how can i pass them from python to GLatLng(lat,long) inside the javascript an have lat = xx and long =yy
def pymapjs(self):
""" Returns complete javacript for rendering map """
self.js = """\n<script src=\"http://maps.google.com/maps?file=api&v=2&key=%s\" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
function Point(lat,long,html,icon) {
this.gpoint = new GMarker(new GLatLng(lat,long),icon);
this.html = html;
}
Upvotes: 0
Views: 198
Reputation: 421
Do this:
self.js = """\n<script src=\"http://maps.google.com/maps?file=api&v=2&key=%s\" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
function Point(lat,long,html,icon) {
this.gpoint = new GMarker(new GLatLng(%f,%f),icon);
this.html = html;
}""" % (xx, yy)
Upvotes: 1