source: extensions/rv_gmaps/trunk/template/picture_map_content.tpl @ 6651

Last change on this file since 6651 was 6651, checked in by rvelices, 14 years ago

rv_gmaps - start using google.maps JS namespace + upgrade prototype.js

  • Property svn:eol-style set to LF
File size: 2.9 KB
Line 
1{html_head}
2<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key={$GMAPS_API_KEY}&amp;hl={$lang_info.code}" type="text/javascript"></script>
3{* <script src="{$PLUGIN_ROOT_URL}/template/windows_13/javascripts/prototype.js" type="text/javascript"></script> *}
4<script src="http://ajax.googleapis.com/ajax/libs/prototype/1.6.1.0/prototype.js" type="text/javascript"></script>
5<script src="{$PLUGIN_ROOT_URL}/template/windows_13/javascripts/window.js" type="text/javascript" defer="defer"></script>
6<link href="{$PLUGIN_ROOT_URL}/template/windows_13/themes/default.css" rel="stylesheet" type="text/css">
7<link href="{$PLUGIN_ROOT_URL}/template/windows_13/themes/alphacube.css" rel="stylesheet" type="text/css">
8
9<style type="text/css">{literal}
10#mapPicture {
11        position:absolute;
12        width: 310px;
13}
14
15#map {
16        position:relative;
17        left: 320px;
18        margin-right: 320px;
19        height: 512px;
20        min-height: 512px;
21}
22
23#thumbPrev, #thumbNext {display:none;}
24{/literal}</style>
25{/html_head}
26
27<div id="mapPicture">
28<a href="{$U_NO_MAP}" title="{'return to normal view mode'|@translate}" rel="nofollow"><img src="{$TN_SRC}" alt="thumb"/></a>
29<br/>
30<a href="{$U_BLOWUP}" onclick="return blowupUrl(this.href);">{'More pictures near this location'|@translate}</a>
31<br/>
32{$COMMENT_IMG}
33<br/>
34</div>
35
36<div id="map"></div>
37
38<div style="clear:both"></div>
39<script type="text/javascript">{literal}
40//<![CDATA[
41function onLoad()
42{
43        if (!GBrowserIsCompatible())
44                return;
45
46        var mapElement = document.getElementById("map");
47        var map = new GMap2( mapElement );
48
49        map.addControl(new GLargeMapControl());
50        map.addControl(new GMapTypeControl());
51        map.addControl(new GScaleControl());
52        {/literal}{if isset($coordinates)}
53        var coord = new google.maps.LatLng( {$coordinates.LAT}, {$coordinates.LON} );
54        map.setCenter( coord, 12 );
55        var marker = new google.maps.Marker(coord);
56        map.addOverlay(marker);
57        {/if}{literal}
58        if ( !map.isLoaded() )
59                map.setCenter( new google.maps.LatLng(0,0), 2);
60        try {
61                // the overview must be added after setting map center
62                var ovcontrol = new GOverviewMapControl(new GSize(165,165));
63                map.addControl(ovcontrol);
64                var ov_map = ovcontrol.getOverviewMap();
65                google.maps.Event.addListener(map, 'maptypechanged', function(){
66                        ov_map.setMapType(G_NORMAL_MAP);
67                });
68  }
69        catch(e){ alert( e.message ); }
70
71        map.enableDoubleClickZoom();
72}
73
74function blowupUrl(theUrl)
75{
76        var win = new Window({
77                title: document.title,
78                url: theUrl,
79                classname: "alphacube",
80                left: 0, top: 0,
81                width:"640", height:"480",
82                minimizable: false,
83                maximizable: false,
84                draggable: false,
85                resizable: false,
86                destroyOnClose: true,
87                hideEffect: Element.hide,
88                showEffectOptions: {duration:1.5}
89        });
90
91        win.setConstraint(true, {top:20, left:20, bottom:30, right:20} );
92        win.maximize();
93        win.showCenter(true, 20, 20);
94        return false;
95}
96
97Event.observe(window, 'load', onLoad );
98Event.observe(window, 'unload', GUnload );
99//]]>
100{/literal}</script>
Note: See TracBrowser for help on using the repository browser.