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

Source Code for Module pyjamas.gmaps.Map

 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  from pyjamas.gmaps.Utils import dictToJs, createListenerMethods 
18   
19  ### GOOGLE MAPS WRAPPERS ### 
20  MapTypeId = JS("$wnd['google']['maps']['MapTypeId']") 
21  MapTypeControlStyle = JS("$wnd['google']['maps']['MapTypeControlStyle']") 
22  NavigationControlStyle = JS("$wnd['google']['maps']['NavigationControlStyle']") 
23  ScaleControlStyle = JS("$wnd['google']['maps']['ScaleControlStyle']") 
24   
25   
26 -def MapOptions(**params):
27 return dictToJs(params)
28 29
30 -def MapTypeControlOptions(**params):
31 return dictToJs(params)
32 33 36 37
38 -def ScaleControlOptions(**params):
39 return dictToJs(params)
40 41
42 -def Map(el, options):
43 if options: 44 map = JS("""new $wnd['google']['maps']['Map'](@{{el}}, @{{options}})""") 45 else: 46 map = JS("""new $wnd['google']['maps']['Map'](@{{el}})""") 47 48 createListenerMethods(map) 49 return map
50 51
52 -def MapPanes(el):
53 JS("""return new $wnd['google']['maps']['MapPanes'](@{{el}})""")
54 55
56 -def MapCanvasProjection(el):
57 JS("""return new $wnd['google']['maps']['MapCanvasProjection'](@{{el}})""")
58