Package library :: Package pyjamas :: Package gmaps :: Module Base
[hide private]
[frames] | no frames]

Source Code for Module library.pyjamas.gmaps.Base

 1  # Copyright (C) 2009 Daniel Carvalho <idnael@gmail.com> 
 2  # 
 3  # Licensed under the Apache License, Version 2.0 (the "License"); 
 4  # you may not use this file except in compliance with the License. 
 5  # You may obtain a copy of the License at 
 6  # 
 7  #     http://www.apache.org/licenses/LICENSE-2.0 
 8  # 
 9  # Unless required by applicable law or agreed to in writing, software 
10  # distributed under the License is distributed on an "AS IS" BASIS, 
11  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
12  # See the License for the specific language governing permissions and 
13  # limitations under the License. 
14   
15  from __pyjamas__ import JS 
16   
17   
18 -def LatLng(lat, lng, nowrap=True):
19 if nowrap: 20 JS("return new $wnd['google']['maps']['LatLng'](@{{lat}}, @{{lng}}, @{{nowrap}})") 21 else: 22 JS("return new $wnd['google']['maps']['LatLng'](@{{lat}}, @{{lng}})")
23 24
25 -def LatLngBounds(sw, ne):
26 if sw and ne: 27 JS("return new $wnd['google']['maps']['LatLngBounds'](@{{sw}}, @{{ne}})") 28 else: 29 JS("return new $wnd['google']['maps']['LatLngBounds']()")
30 31
32 -def MVCArray(array):
33 JS("return new $wnd['google']['maps']['MVCArray'](@{{array}})")
34 35
36 -def Point(x, y):
37 JS("return new $wnd['google']['maps']['Point'](@{{x}}, @{{y}})")
38 39
40 -def Size(width, height, widthUnit, heightUnit):
41 if widthUnit and heightUnit: 42 JS(""" 43 return new $wnd['google']['maps']['Size'] 44 (@{{width}}, @{{height}}, @{{widthUnit}}, @{{heightUnit}}) 45 """) 46 else: 47 JS("return new $wnd['google']['maps']['Size'](@{{width}}, @{{height}})")
48 49
50 -def Array():
51 JS("return new Array()")
52