_layout_shops.tpl
4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
{include file="include/head.tpl"}
<script src="http://maps.google.com/maps?file=api&v=2&hl=ru&key=AIzaSyAWmuiRg7hXwlz103RrhF6qDapx0l42dEM"
type="text/javascript" charset="utf-8"></script>
{literal}
<script type="text/javascript">
$(document).ready(function(){
var geocoder;
var map;
var addresses = new Array();
var names = new Array("<img src='/img/map_t.png' />");
var counter=0;
var maker_view=0;
{/literal}
{section name=i loop=$shops}
addresses[{$smarty.section.i.index}] = "{$shops[i].adress|escape:'html'}";
{/section}
{literal}
function load()
{
// Create new map object
map = new GMap2(document.getElementById("map"));
// Create new geocoding object
geocoder = new GClientGeocoder();
// Retrieve location information, pass it to addToMap()
for (i=0; i < addresses.length; i++)
geocoder.getLocations(addresses[i], addToMap);
}
function createMarker(point,html)
{
var blueIcon = new GIcon(G_DEFAULT_ICON);
blueIcon.image = "/img/map_t.png";
blueIcon.iconSize = new GSize(35, 51);
markerOptions = { icon:blueIcon };
var marker = new GMarker(point,markerOptions);
GEvent.addListener(marker, "mouseover", function() {marker.openInfoWindowHtml(html);});
// $(document).ready(function(){
// $(".map_link").click(function() {alert($(".map_link").attr("title"););marker.openInfoWindowHtml(html);});
// });
//$("#map_link"+counter).click(function() {
// marker.openInfoWindowHtml(html);
// return false;
//});
return marker;
}
// This function adds the point to the map
function addToMap(response)
{
// Retrieve the object
place = response.Placemark[0];
point = new GLatLng(place.Point.coordinates[1], place.Point.coordinates[0]);
htmlText=addresses[counter];
// Create a marker
marker=createMarker(point, htmlText);
map.addOverlay(marker);
//marker.openInfoWindowHtml(htmlText);
map.setCenter(point, 12);
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
counter++;
}
load();
});
</script>
{/literal}
{include file="include/header.tpl"}
<div class="container">
<h1 class="h1_3">Äèëåðû è äèñòðèáüþòîðû</h1>
<div class="map_box">
<div id="map" class="map" style="width: 920px; height: 500px;margin-top:5px;"></div>
<div class="menu_brend">
<ul>
{section name=i loop=$brends}
<li {if $smarty.section.i.index eq count($brends)-1}class="n"{/if}><a href="{$url_lang}/shops/index/{$brends[i].translit}/" title="{$brends[i].name}" id="map_link{$smarty.section.i.index}"><img src="{$config->url}/pics/brends/{$brends[i].pic}" alt="{$brends[i].name}" /></a></li>
{/section}
</ul><div class="both"></div>
</div>
</div>
</div>
<div class="layout2">
<div class="container">
{section name=i loop=$shops}
<div class="item_adress">
<img src="{$config->url}/pics/shops/{$shops[i].pic}" class="fl" />
<div class="fr">{section name=j loop=$shops[i].stars}<img src="{$config->url}/img/stars/star{$shops[i].stars[j].brend_id}.png" width="18" height="18" hspace="3" />{/section}</div>
<div class="adress">
{$shops[i].name}<br />{$shops[i].contacts}<br />{$shops[i].adress} <a href="http://{$shops[i].url}">{$shops[i].url}</a>
</div><div class="both"></div>
</div>
{/section}
</div>
</div>
<div class="container">
{include file="include/fotter.tpl"}
</div>
{include file="include/head_end.tpl"}