source: products/qPloneGoogleMaps/tags/0.1.0/skins/qPloneGoogleMaps/getCenterZoom.py

Last change on this file was 1, checked in by myroslav, 18 years ago

Building directory structure

  • Property svn:eol-style set to native
File size: 1.0 KB
Line 
1## Script (Python) "getCenterZoom"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=
8##title=
9##
10
11return """
12<script type="text/javascript">
13//<![CDATA[
14
15var node = document.getElementById('autozoom');
16if ((globMap != null) && (globMap.autoCenter != null)) {
17  var lt = globMap.autoCenter[0],
18      lg = globMap.autoCenter[1];
19  if ((lt != null) && (lg != null)) {
20    function forLink() {
21      globMap.widgetMap.clearOverlays();
22      globMap.widgetMap.addOverlay(new GMarker(new GLatLng(parseFloat(lt),parseFloat(lg))));
23      globMap.widgetMap.panTo(new GLatLng(parseFloat(lt),parseFloat(lg)));
24      var lat = document.getElementById("maplatitude"),
25          lng = document.getElementById("maplongitude");
26      lat.value = parseFloat(lt);
27      lng.value = parseFloat(lg);
28      return false;
29    };
30    node.innerHTML  = "<a href='#' onclick='javascript:forLink();return false;'>Auto Center</a>";
31}};
32
33registerEventListener(window, 'unload', GUnload);
34
35//]]>
36</script>
37"""
Note: See TracBrowser for help on using the repository browser.