2014-05-12 2 views
0

я должен переменных хх = 38,929787 уу = 22,675781Pass переменной от Python к JavaScript

как я могу передать их от питона до GLatLng (лат, длинный) внутри Java-ап имеют лат = хх и длиной = уу

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

ли это:

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) 
Смежные вопросы