-
Notifications
You must be signed in to change notification settings - Fork 4
/
bevaddressftssearch.html
211 lines (195 loc) · 7.26 KB
/
bevaddressftssearch.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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<!DOCTYPE HTML>
<html>
<head>
<title>Offene-Adressen.at - Volltextsuche in Adressdaten des BEV</title>
<meta charset="utf-8"/>
<link rel="shortcut icon" href="https://www.offene-adressen.at/assets/img/favicon.ico" type="image/x-icon">
<link href="https://www.offene-adressen.at/assets/css/bootstrap.min.css" rel="stylesheet"/>
<link rel="stylesheet" type="text/css" href="https://www.offene-adressen.at/assets/css/datatables.min.css"/>
<link rel="stylesheet" type="text/css" href="https://www.offene-adressen.at/assets/css/styles.css"/>
<script
src="https://www.offene-adressen.at/assets/js/jquery-2.2.4.min.js">
</script>
<script
src="https://www.offene-adressen.at/assets/js/bootstrap.min.js">
</script>
<script type="text/javascript"
src="https://www.offene-adressen.at/assets/js/datatables.min.js">
</script>
<script type="text/javascript">
// DataTable initialization
$(document).ready( function () {
$('#addressftsresult').DataTable(
{
columns: [
{ data: "PLZ", width: "100" },
{ data: "Gemeindename", width: "100" },
{ data: "Ortsname", width: "280" },
{ data: "Strassenname", width: "280" },
{ data: "Hausnr.", width: "50" },
{ data: "LatlongX", width: "100" },
{ data: "LatlongY", width: "100" }
],
"language": {
"url": "https://www.offene-adressen.at/assets/German.json"
}
});
});
function StartWebSocket()
{
if ("WebSocket" in window)
{
//var ws = new WebSocket("ws://185.38.252.139:6002/ws/address/fts?q=" +
var ws = new WebSocket("wss://api.bevaddress.allowed.org/ws/address/fts?q=" +
document.getElementById('addressfts').value + '"');
ws.onopen = function()
{
document.getElementById('loading-image').style.display='block';
// Web Socket is connected, send data using send()
// ws.send("Message to send");
};
ws.onmessage = function (evt)
{
var received_msg = evt.data;
document.getElementById('loading-image').style.display='none';
var datatable = $('#addressftsresult').DataTable();
datatable.clear();
datatable.rows.add(JSON.parse(received_msg));
datatable.draw();
};
ws.onclose = function()
{ // websocket is closed.
};
}
else
{
alert("WebSocket NOT supported by your Browser!");
}
}
</script>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Offene-Adressen.at</a>
</div>
<div id="navbar" class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<!--
<li class="active"><a href="#">Volltextsuche</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
-->
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row">
<h1>Volltextsuche</h1>
<form id="searchbox">
<div class="form-group">
<label for="addressfts">Bitte Adresse eingeben:</label>
<input type="text"
class="form-control"
name="addressfts"
id="addressfts"
placeholder="Wien, erster bezirk, Akademiestrasse"
autofocus
/>
<script type="text/javascript">
//info: start search with enter too
$("#searchbox").submit(function(e){
e.preventDefault();
StartWebSocket();
});
//info: select address on focus
$("#searchbox input[type=text]").focus(function() {
$(this).select();
});
</script>
</div>
<div id="sse">
<table>
<tr>
<td>
<a href="javascript:StartWebSocket()" class="btn btn-success">Adressen abfragen</a>
</td>
<td>
<div id="loading-image" style="padding-left:15px;display:none;">
<img src="assets/img/loading.gif" width="35" height="35" alt="loading" />
</div>
</td>
</tr>
</table>
</div>
</form>
</div>
<hr/>
<div class="row table-responsive">
<table id="addressftsresult" class="table table-striped table-bordered table-hover">
<thead>
<tr class="primary">
<th>PLZ</th>
<th>Gemeindename</th>
<th>Ortsname</th>
<th>Strassenname</th>
<th>Hausnr.</th>
<th>LatlongX</th>
<th>LatlongY</th>
</tr>
</thead>
</table>
</div>
<hr/>
<div class="row">
Diese Seite testet die Volltextsuche in <a href="http://www.bev.gv.at/portal/page?_pageid=713,2601271&_dad=portal&_schema=PORTAL" target="_blank">Adressdaten des BEV</a>.<br>
Der Quellcode für dieses Service ist verfügbar unter
<ul>
<li><a href='https://github.com/the42/bevdockerdb'>https://github.com/the42/bevdockerdb</a></li>
<li><a href='https://github.com/the42/bevaddress-dataload'>https://github.com/the42/bevaddress-dataload</a></li>
<li><a href='https://github.com/the42/bevaddressapi'>https://github.com/the42/bevaddressapi</a></li>
</ul>
Die API ist beschrieben unter <a href='https://github.com/the42/bevaddressapi/blob/master/README.md'>README</a>.
<br/><br/>
Team:
<ul>
<li><a href="https://github.com/the42/" target="_blank">Johann Höchtl</a></li>
<li><a href="https://github.com/haslinger" target="_blank">Stefan Haslinger</a></li>
<li><a href="https://www.harm.co.at" target="_blank">Robert Harm</a></li>
<li><a href="https://www.sonjafischbauer.com" target="_blank">Sonja Fischbauer</a></li>
</ul>
Interesse an Mitarbeit? Dann bitte entweder Code gleich auf Github forken oder Email an <a href="mailto:[email protected]?subject=Mitarbeit">[email protected]</a>
</div>
<hr noshade size="1">
<p>
<div style="float:left;margin-top:5px;"><a href="https://www.open3.at" target="_blank" title="Webseite open3.at aufrufen"><img src="https://www.datamaps.eu/wp-content/uploads/open3logo.png" width="177" height="33"></a></div>
<div style="float:right;text-align:right;"><a href="http://opendefinition.org/od/2.0/de/" target="_blank" ><img src="https://www.datamaps.eu/wp-content/uploads/badge-od.png" width="80" height="15"> <img src="https://www.datamaps.eu/wp-content/uploads/badge-ok.png" width="80" height="15"> <img src="https://www.datamaps.eu/wp-content/uploads/badge-oc.png" width="80" height="15"></a><br/>
Ein Projekt von open3.at, dem Netzwerk zur Förderung von openSociety, openGovernment und OpenData in Österreich
</p></div>
</div><!-- /.container -->
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(["setDomains", ["*.www.offene-adressen.at"]]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//www.mapsmarker.com/piwik/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', 20]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="//www.mapsmarker.com/piwik/piwik.php?idsite=20" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->
</body>
</html>