0

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&amp;v=2&amp;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;

               }  

1 Answer 1

1

Do this:

self.js = """\n<script src=\"http://maps.google.com/maps?file=api&amp;v=2&amp;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)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.