forked from benbalter/dc-wifi-social
-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
115 lines (85 loc) · 3.43 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<title>טיפה.לי - טיפת חלב ליד הבית</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.ie.css" />
<![endif]-->
<style type="text/css">
body {
padding: 0;
margin: 0;
background-color: #fff;
}
html, body, #map {
height: 100%;
}
</style>
</head>
<body>
<div id="map"></div>
<script src="data/clinics.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
<script type="text/javascript">
var milkIcon = L.icon({
iconUrl : 'img/TipatHalavIcon40x25.png',
iconSize : [25, 40],
iconAnchor : [13, 39],
popupAnchor : [0, -35]
});
var WEEKDAYS = ['א','ב','ג','ד','ה','ו','ש'];
String.prototype.trim = String.prototype.trim || function trim() { return this.replace(/^\s\s*/, '').replace(/\s\s*$/, ''); };
function onEachFeature(feature, layer) {
// console.log(layer);
p = feature.properties
phone = p.phones.split(',')[0].trim();
marker_html='<div style="text-align: right">'
+ '<b>' + p.city + '</b><br />'
+ p.address + '<br />'
+ '<a href="tel:' + phone + '">' + phone + '</a><br />';
for (i in WEEKDAYS) {
if (typeof p.days[i] != 'undefined' && p.days[i].trim() != "סגור") {
marker_html += 'יום ' + WEEKDAYS[i] + ' ' + p.days[i] + '<br />';
}
}
marker_html +='</div>';
layer.bindPopup(marker_html);
}
var MAP_CENTER = [31.87, 35.00];
var DEFAULT_ZOOM = 11;
var map = L.map('map', { scrollWheelZoom: true }).setView(MAP_CENTER, DEFAULT_ZOOM);
map.locate({setView : true, maxZoom: 13});
// tile_url = 'http://{s}.tiles.mapbox.com/v3/niryariv.map-n3zuwkkz/{z}/{x}/{y}.png';
tile_url = "http://niryariv.github.io/israel_tiles/{z}/{x}/{y}.png";
L.tileLayer(tile_url, {
attribution: '<a href="https://github.com/niryariv/tiptipa">קוד</a> | <a href="http://niryariv.wordpress.com/">ניר</a> - <a href="http://degeladom.wordpress.com/">אלון</a> - <a href="http://about.me/udioron">אודי</a> - <a href="http://www.linkedin.com/profile/view?id=163884606">ארז</a> - <a href="http://inkod-hypera.com/">אילן</a> - שרון - <a href="http://gizra.com/">גיזרה</a> - <a href="http://www.hasadna.org.il/">הסדנא</a>',
maxZoom: 16,
minZoom: 9
}).addTo(map);
L.geoJson(stations,
{
pointToLayer: function (feature, latlng) {
return L.marker(latlng, {icon: milkIcon});
},
filter: function(feature, layer) {
return !feature.properties.error;
},
onEachFeature: onEachFeature,
}
).addTo(map);
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-43602637-1', 'tipa.li');
ga('send', 'pageview');
</script>
</body>
</html>
<!- Jerusalem, summer 2013 -->