dirs (owner)

Revisions

gist: 146532 Download_button fork
public
Public Clone URL: git://gist.github.com/146532.git
Embed All Files: show embed
index.erb #
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
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Casa para locação em Londrina</title>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
 
$(function() {
var geocoder;
var map;
 
var latlng = new google.maps.LatLng(-23.327754771531193, -51.17114067077637);
var myOptions = {
zoom: 13,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
 
$(['imobiliariainglaterra', 'imobiliariaatual', 'imobiliariadelta', 'imobiliariaavenida', 'ihimoveis', 'imobiliariasenador', 'imobiliariaperez']).each(function() {
$.getJSON(['http://localhost:4567/', this, '?callback=?'].join(''), function(data) {
for (add in data) {
 
setTimeout(function(data) {
var myLatlng = new google.maps.LatLng(data['geo'][0],data['geo'][1]);
 
var infowindow = new google.maps.InfoWindow({
content: ['<a href="', data['link'], '">Mais detalhes</a>'].join('')
});
 
var marker = new google.maps.Marker({
position: myLatlng,
map: map
});
 
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
}, 100*add, data[add]);
}
 
});
});
});
</script>
</head>
<body style="margin:0px; padding:0px;">
<div id="map_canvas" style="width:100%; height:100%"></div>
</body>
</html>