This repository has been archived by the owner on Nov 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfs.html
160 lines (135 loc) · 3.61 KB
/
fs.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>openstreetmap.cz</TITLE>
<style type="text/css">
#map {
width: 100%;
height: 100%;
border: 0px;
padding: 0px;
position: absolute;
}
body {
border: 0px;
margin: 0px;
padding: 0px;
height: 100%;
}
#tags {
display: none;
}
#text {
position: absolute;
bottom: 3em;
left: 6em;
width: 750px;
z-index: 20000;
background-color: white;
padding: 0 0.5em 0.5em 0.5em;
}
</style>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
<script src='jquery-1.11.3.min.js'></script>
<link rel="stylesheet" href="../dist/MarkerCluster.css" />
<link rel="stylesheet" href="../dist/MarkerCluster.Default.css" />
<script src="../dist/leaflet.markercluster-src.js"></script>
<script>
var map;
var xhr;
var plotlist;
var plotlayers=[];
var gj_guidepost = new L.GeoJSON();
var markers = L.markerClusterGroup();
function retrieve_geojson(data)
{
// alert("ok" + data);
gj_guidepost.clearLayers();
markers.clearLayers();
map.removeLayer(gj_guidepost);
map.removeLayer(markers);
gj_guidepost.addData(JSON.parse(data));
markers.addLayer(gj_guidepost);
map.addLayer(markers);
};
function error_gj(data)
{
console.log(data);
// alert("error" + data);
};
function load_data()
{
if (typeof xhr !== 'undefined') {
xhr.abort();
}
if(map.getZoom() > 1) {
var geoJsonUrl ='http://map.openstreetmap.cz/table/all';
var defaultParameters = {
outputFormat: 'application/json'
};
var customParams = {
output: 'geojson',
bbox: map.getBounds().toBBoxString(),
};
var parameters = L.Util.extend(defaultParameters, customParams);
// alert(geoJsonUrl + L.Util.getParamString(parameters));
xhr = $.ajax({
url: geoJsonUrl + L.Util.getParamString(parameters),
success: retrieve_geojson,
error: error_gj
});
} else {
map.removeLayer(gj_guidepost);
}
}
function initmap() {
// set up the map
map = new L.Map('map');
// create the tile layer with correct attribution
var osmUrl='http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmAttrib='Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors';
var osm = new L.TileLayer(osmUrl, {minZoom: 1, maxZoom: 19, attribution: osmAttrib});
map.setView(new L.LatLng(49.5, 17), 7);
map.addLayer(osm);
map.on('moveend', load_data);
map.on('drag', function (e) {
if (typeof xhr !== 'undefined') {
xhr.abort();
}
});
map.on('movestart', function (e) {
if (typeof xhr !== 'undefined') {
xhr.abort();
}
});
}
</script>
</HEAD>
<BODY onload="initmap()">
<div id="map"></div>
<div id="text">
<div id="docs">
<script type="text/javascript">
google_ad_client = "pub-7270111774772584";
/* 728x90, created 5/21/08 */
google_ad_slot = "7568601500";
google_ad_width = 728;
google_ad_height = 90;
</script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-308728-3");
pageTracker._initData();
pageTracker._trackPageview();
</script>
</div>
</div>
</BODY>
</HTML>