]> git.openstreetmap.org Git - nominatim-ui.git/blob - dist/search.html
detailsURL helper which replaces detailsLink and detailsPermaLink
[nominatim-ui.git] / dist / search.html
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4   <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
5   <title>OpenStreetMap Nominatim</title>
6   <meta name="viewport" content="width=device-width, initial-scale=1">
7
8   <link rel="icon" type="image/png" href="assets/images/favicon-194x194.png" sizes="194x194" />
9   <link rel="icon" type="image/png" href="assets/images/favicon-16x16.png" sizes="16x16" />
10
11   <link href="assets/css/leaflet.css" rel="stylesheet" />
12   <link href="assets/css/Control.MiniMap.min.css" rel="stylesheet" />
13   <link href="assets/css/bootstrap.min.css" rel="stylesheet" />
14   <link href="assets/css/common.css" rel="stylesheet" />
15   <link href="assets/css/search.css" rel="stylesheet" type="text/css" />
16   <link href="assets/css/details.css" rel="stylesheet" type="text/css" />
17 </head>
18 <body id="BODYID">
19
20   <div id="error-overlay"></div>
21
22   <header class="container-fluid">
23     <div class="row">
24       <div class="col-4">
25         <div class="brand">
26           <a href="search.html">
27             <img alt="logo" src="assets/images/osm_logo.120px.png" width="30" height="30"/>
28             <h1>Nominatim</h1>
29           </a>
30         </div>
31       </div>
32       <div class="col-4">
33         <div id="last-updated" class="text-center">
34           <div id="loading">loading...</div>
35           <div id="api-request">
36             Data from <a href="">API request</a>
37             <span id="api-request-debug">(<a href="">debug output</a>)</span>
38           </div>
39           Data last updated: <span id="data-date"></span>
40         </div>
41       </div>
42       <div class="col-4 text-right">
43         <div class="dropdown">
44           <button class="dropdown-toggle btn btn-sm btn-outline-secondary" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
45             About &amp; Help
46           </button>
47           <div class="dropdown-menu dropdown-menu-right">
48             <a class="dropdown-item" href="https://nominatim.org/release-docs/develop/api/Overview/" target="_blank">API Reference</a>
49             <a class="dropdown-item" href="https://nominatim.org/release-docs/develop/api/Faq/" target="_blank">FAQ</a>
50             <a class="dropdown-item" href="https://help.openstreetmap.org/tags/nominatim/">OpenStreetMap Help</a>
51             <a class="dropdown-item" href="https://github.com/osm-search/Nominatim">Nominatim on Github</a>
52             <a class="dropdown-item" href="https://github.com/osm-search/nominatim-ui">This frontend on Github</a>
53             <div class="dropdown-divider"></div>
54             <a class="dropdown-item" href="#" data-toggle="modal" data-target="#report-modal">Report problem with results</a>
55           </div>
56         </div>
57       </div>
58     </div>
59   </header>
60
61   <div class="modal fade" id="report-modal">
62     <div class="modal-dialog">
63       <div class="modal-content">
64         <div class="modal-header">
65           <h4 class="modal-title">Report a problem</h4>
66           <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
67         </div>
68         <div class="modal-body">
69           <p>
70             Before reporting problems please read the <a target="_blank" href="https://nominatim.org/release-docs/develop/api/Overview/">user documentation</a>
71             and
72             <a target="_blank" href="https://nominatim.org/release-docs/develop/api/Faq/">FAQ</a>.
73
74             If your problem relates to the address of a particular search result please use the 'details' link 
75             to check how the address was generated before reporting a problem.
76           </p>
77           <p>
78             Use <a target="_blank" href="https://github.com/osm-search/Nominatim/issues">Nominatim issues on github</a>
79             to report problems.
80           </p>
81           <p>
82             Please ensure that you include a full description of the problem, including the search
83             query that you used, the problem with the result and, if the problem relates to missing data,
84             the osm type (node, way, relation) and id of the item that is missing.
85           </p>
86           <p>
87             Problems that contain enough detail are likely to get looked at before ones that require
88             significant research.
89           </p>
90         </div>
91         <div class="modal-footer">
92           <button type="button" class="btn btn-outline-secondary" data-dismiss="modal">OK</button>
93         </div>
94       </div>
95     </div>
96   </div>
97
98   <main>
99   </main>
100
101   <footer>
102     <p class="disclaimer">
103       Addresses and postcodes are approximate
104     </p>
105     <p class="copyright">
106       &copy; <a href="https://osm.org/copyright">OpenStreetMap</a> contributors
107     </p>
108   </footer>
109
110   <script src="assets/js/jquery.min.js"></script>
111   <script src="assets/js/bootstrap.bundle.min.js"></script>
112   <script src="assets/js/leaflet.js"></script>
113   <script src="assets/js/Control.MiniMap.min.js"></script>
114   <script src="assets/js/handlebars.min.js"></script>
115   <script src="assets/js/url-search-params.js"></script>
116
117   <script src="config.js"></script>
118   <script src="handlebar_helpers.js"></script>
119
120   <script src="assets/js/nominatim-ui.js"></script>
121 <script id="searchpage-template" type="text/x-handlebars-template">
122 {{#*inline "partial_one_result"}}
123   <div class="result" data-position="{{iResNum}}">
124     {{formatMapIcon aResult}}
125
126     <span class="name">{{aResult.display_name}}</span>
127     <span class="type">({{formatLabel aResult}})</span>
128     <p class="coords">{{aResult.lat}},{{aResult.lon}}</p>  
129
130     <a class="details btn btn-outline-secondary btn-sm" href="{{detailsURL aResult}}">details</a>
131   </div>
132 {{/inline}}
133
134 <div class="top-bar">
135   <ul class="nav nav-tabs">
136     <li class="nav-item">
137       <a class="nav-link {{#unless hStructured}}active{{/unless}}" data-toggle="tab" href="#simple">simple</a>
138     </li>
139     <li class="nav-item">
140       <a class="nav-link {{#if hStructured}}active{{/if}}" data-toggle="tab" href="#structured">structured</a>
141     </li>
142     <div class="search-type-link">
143       <a id="switch-to-reverse" href="/reverse.html">reverse search</a>
144     </div>
145   </ul>
146   <div class="tab-content p-2">
147     <div class="tab-pane {{#unless hStructured}}active{{/unless}}" id="simple" role="tabpanel">
148       <form class="form-inline" role="search" accept-charset="UTF-8" action="">
149         <input id="q"
150                name="q"
151                type="text"
152                class="form-control form-control-sm"
153                placeholder="Search"
154                value="{{sQuery}}" />
155
156         <div class="form-group search-button-group">
157           <button type="submit" class="btn btn-primary btn-sm mx-1">Search</button>
158           <input type="hidden" name="viewbox" value="{{sViewBox}}" />
159           <div class="form-check form-check-inline">
160             <input type="checkbox" class="form-check-input"
161                    id="use_viewbox" {{#if sViewBox}}checked="checked"{{/if}}>
162             <label class="form-check-label" for="use_viewbox">apply viewbox</label>
163           </div>
164         </div>
165       </form>
166     </div>
167     <div class="tab-pane {{#if hStructured}}active{{/if}}" id="structured" role="tabpanel">
168       <form class="form-inline" role="search" accept-charset="UTF-8" action="">
169         <input name="street" type="text" class="form-control form-control-sm mr-1"
170                placeholder="House number/Street"
171                value="{{hStructured.street}}" />
172         <input name="city" type="text" class="form-control form-control-sm mr-1"
173                placeholder="City"
174                value="{{hStructured.city}}" />
175         <input id="county" name="county" type="text" class="form-control form-control-sm mr-1"
176                placeholder="County"
177                value="{{hStructured.county}}" />
178         <input name="state" type="text" class="form-control form-control-sm mr-1"
179                placeholder="State"
180                value="{{hStructured.state}}" />
181         <input name="country" type="text" class="form-control form-control-sm mr-1"
182                placeholder="Country"
183                value="{{hStructured.country}}" />
184         <input name="postalcode" type="text" class="form-control form-control-sm mr-1"
185                placeholder="Postal Code"
186                value="{{hStructured.postalcode}}" />
187
188         <div class="form-group search-button-group">
189           <button type="submit" class="btn btn-primary btn-sm mx-1">Search</button>
190           <input type="hidden" name="viewbox" value="{{sViewBox}}" />
191           <div class="form-check form-check-inline">
192             <input type="checkbox" class="form-check-input"
193                    id="use_viewbox" {{#if sViewBox}}checked="checked"{{/if}}>
194             <label class="form-check-label" for="use_viewbox">apply viewbox</label>
195           </div>
196         </div>
197       </form>
198     </div>
199   </div> <!-- /tab-content -->
200 </div> <!-- /top-bar -->
201
202 <div id="content">
203
204   {{#if bSearchRan}}
205     <div id="searchresults" class="sidebar">
206       {{#each aSearchResults as |aResult|}}
207         {{>partial_one_result iResNum=@index aResult=aResult env=env}}
208       {{/each}}
209
210       {{#if aSearchResults}}
211         {{#if sMoreURL}}
212           <div class="more">
213             <a class="btn btn-primary" href="{{sMoreURL}}">
214               Search for more results
215             </a>
216           </div>
217         {{/if}}
218       {{else}}
219         <div class="noresults">No search results found</div>
220       {{/if}}
221     </div>
222
223   {{else}}
224
225     <div id="intro" class="sidebar">
226       <h2>Welcome to Nominatim</h2>
227
228       <p>
229         Nominatim is a search engine for
230         <a href="https://www.openstreetmap.org">OpenStreetMap</a> data. This
231         is the debugging interface. You may search for a name or address
232         (forward search) or look up data by its geographic coordinate (reverse
233         search). Each result comes with a link to a details page where you
234         can inspect what data about the object is saved in the database and
235         investigate how the address of the object has been computed.
236       </p>
237
238       For more information visit the
239       <a href="https://nominatim.org">Nominatim home page</a>.
240     </div>
241
242   {{/if}}
243
244   <div id="map-wrapper">
245     <div id="map-position">
246       <div id="map-position-inner"></div>
247       <div id="map-position-close"><a href="#">hide</a></div>
248     </div>
249     <div id="map"></div>
250   </div>
251 </div>
252 </script>
253 <script id="reversepage-template" type="text/x-handlebars-template">
254
255 {{#*inline "partial_one_result"}}
256   <div class="result" data-position="{{iResNum}}">
257     {{formatMapIcon aResult}}
258
259     <span class="name">{{aResult.display_name}}</span>
260     <span class="type">{{formatLabel aResult}}</span>
261     <p class="coords">{{aResult.lat}},{{aResult.lon}}</p>  
262
263     <a class="details btn btn-outline-secondary btn-sm" href="{{detailsURL aResult}}">details</a>
264   </div>
265 {{/inline}}
266
267 <div class="top-bar">
268   <form class="form-inline" role="search" accept-charset="UTF-8" action="">
269     <div class="form-group">
270       <input name="format" type="hidden" value="html">
271       <label>lat</label>
272       <input name="lat"
273              type="text"
274              class="form-control form-control-sm"
275              placeholder="latitude"
276              value="{{fLat}}" />
277       <a id="switch-coords" class="btn btn-outline-secondary btn-sm" title="switch lat and lon">&lt;&gt;</a>
278       <label>lon</label>
279       <input name="lon"
280              type="text"
281              class="form-control form-control-sm"
282              placeholder="longitude"
283              value="{{fLon}}" />
284       <label>max zoom</label>
285       <select name="zoom" class="form-control form-control-sm" value="{{iZoom}}">
286         {{zoomLevels iZoom}}
287       </select>
288       <button type="submit" class="btn btn-primary btn-sm mx-1">
289         Search
290       </button>
291     </div>
292     <div class="search-type-link">
293       <a href="search.html">forward search</a>
294     </div>
295   </form>
296 </div>
297
298 <div id="content">
299   {{#if aPlace}}
300     <div id="searchresults" class="sidebar">
301       {{>partial_one_result iResNum=0 aResult=aPlace env=env}}
302     </div>
303   {{else}}
304     <div id="intro" class="sidebar">
305       Search for coordinates or click anywhere on the map.
306     </div>
307   {{/if}}
308
309   <div id="map-wrapper">
310     <div id="map-position">
311       <div id="map-position-inner"></div>
312       <div id="map-position-close"><a href="#">hide</a></div>
313     </div>
314     <div id="map"></div>
315   </div>
316 </div>
317 </script>
318 <script id="detailspage-template" type="text/x-handlebars-template">
319
320 {{#*inline "partial_details_one_row"}}
321   <tr class="{{#unless bAddressLineUsed}}notused{{/unless}}">
322     <td class="name">
323       {{#if this.localname}}
324         {{this.localname}}
325       {{else}}
326         <span class="noname">No Name</span>
327       {{/if}}
328     </td>
329     <td>{{formatPlaceType this}}</td>
330     <td>{{osmLink this}}</td>
331     <td>{{this.rank_address}}</td>
332     <td>{{formatAdminLevel this.admin_level}}</td>
333     <td>{{formatDistance this.distance bDistanceInMeters}}</td>
334     <td><a href="{{detailsURL this}}">details</td>
335   </tr>
336 {{/inline}}
337
338 {{#*inline "partial_details_keyword_one_row"}}
339   <tr>
340     <td>{{formatKeywordToken this.token}}</td>
341     {{#if this.id}}
342       <td>word id: {{this.id}}</td>
343     {{/if}}
344   </tr>
345 {{/inline}}
346
347
348 {{#*inline "partial_h2"}}
349   <tr class="all-columns"><td colspan="6"><h2>{{this}}</h2></td></tr>
350 {{/inline}}
351
352 {{#*inline "partial_h3"}}
353   <tr class="all-columns"><td colspan="6"><h3>{{this}}</h3></td></tr>
354 {{/inline}}
355
356 <div class="container">
357   <div class="row">
358     <div class="col-sm-10">
359       <h1>
360         {{aPlace.localname}}
361         <small><a href="{{detailsURL aPlace}}">link to this page</a></small>
362       </h1>
363     </div>
364     <div class="col-sm-2 text-right">
365       {{formatMapIcon aPlace}}
366     </div>
367   </div>
368   <div class="row">
369     <div class="col-md-6">
370       <table id="locationdetails" class="table table-striped">
371         <tr>
372           <td>Name</td>
373           <td>
374             {{#each aPlace.names}}
375               <div class="line">
376                 <span class="name">{{this}}</span> ({{@key}})
377               </div>
378             {{/each}}
379           </td>
380         </tr>
381         <tr>
382           <td>Type</td>
383           <td>{{aPlace.category}}:{{aPlace.type}}</td>
384         </tr>
385         <tr>
386           <td>Last Updated</td>
387           <td>{{aPlace.indexed_date}}</td>
388         </tr>
389         <tr>
390           <td>Admin Level</td>
391           <td>{{aPlace.admin_level}}</td>
392         </tr>
393         <tr>
394           <td>Rank</td>
395           <td>{{formatSearchRank aPlace.rank_search}}</td>
396         </tr>
397         {{#if aPlace.calculated_importance}}
398           <tr>
399             <td>Importance</td>
400             <td>
401               {{aPlace.calculated_importance}}
402               {{#unless aPlace.importance}} (estimated){{/unless}}
403             </td>
404           </tr>
405         {{/if}}
406         <tr>
407           <td>Coverage</td>
408           <td>{{coverageType aPlace}}</td>
409         </tr>
410         <tr>
411           <td>Centre Point (lat,lon)</td>
412           <td>
413             {{aPlace.centroid.coordinates.[1]}},{{aPlace.centroid.coordinates.[0]}}
414           </td>
415         </tr>
416         <tr>
417           <td>OSM</td>
418           <td>{{osmLink aPlace}}
419         </tr>
420         <tr>
421           <td>
422             Place Id
423             (<a href="https://nominatim.org/release-docs/develop/api/Output/#place_id-is-not-a-persistent-id">on this server</a>)
424           </td>
425           <td>{{aPlace.place_id}}</td>
426         </tr>
427         {{#if aPlace.calculated_wikipedia}}
428           <tr>
429             <td>Wikipedia Calculated</td>
430             <td>{{wikipediaLink aPlace}}</td>
431           </tr>
432         {{/if}}
433         <tr>
434           <td>Computed Postcode</td>
435           <td>{{aPlace.calculated_postcode}}</td>
436         </tr>
437         <tr>
438           <td>Address Tags</td>
439           <td>
440             {{#each aPlace.addresstags}}
441               <div class="line">
442                 <span class="name">{{this}}</span> ({{@key}})
443               </div>
444             {{/each}}
445           </td>
446         </tr>
447         <tr>
448           <td>Extra Tags</td>
449           <td>
450             {{#each aPlace.extratags}}
451               <div class="line">
452                 <span class="name">{{this}}</span> ({{@key}})
453               </div>
454             {{/each}}
455           </td>
456         </tr>
457       </table>
458     </div>
459     <div class="col-md-6">
460       <div id="map"></div>
461     </div>
462   </div>
463   <div class="row">
464     <div class="col-md-12">
465       <h2>Address</h2>
466        <table id="address" class="table table-striped table-small">
467         <thead>
468           <tr>
469             <th>Local name</th>
470             <th>Type</th>
471             <th>OSM</th>
472             <th>Address rank</th>
473             <th>Admin level</th>
474             <th>Distance</th>
475             <th></th>
476           </tr>
477         </thead>
478         <tbody>
479           {{#if aPlace.address}}
480             {{#each aPlace.address}}
481               {{> partial_details_one_row bDistanceInMeters=false bAddressLineUsed=this.isaddress}}
482             {{/each}}
483           {{/if}}
484
485           {{#if aPlace.linked_places}}
486             {{> partial_h2 'Linked Places'}}
487             {{#each aPlace.linked_places}}
488               {{> partial_details_one_row bDistanceInMeters=true bAddressLineUsed=true}}
489             {{/each}}
490           {{/if}}
491
492           {{#if aPlace.keywords}}
493             {{> partial_h2 'Name Keywords'}}
494             {{#each aPlace.keywords.name}}
495               {{> partial_details_keyword_one_row}}
496             {{/each}}
497
498             {{> partial_h2 'Address Keywords'}}
499             {{#each aPlace.keywords.address}}
500               {{> partial_details_keyword_one_row}}
501             {{/each}}
502           {{/if}}
503
504           {{> partial_h2 'Parent Of'}}
505           {{#if aPlace.hierarchy}}
506
507             {{#each aPlace.hierarchy as |lines type|}}
508               {{> partial_h3 type}}
509               {{#each lines}}
510                 {{> partial_details_one_row bDistanceInMeters=true bAddressLineUsed=true}}
511               {{/each}}
512             {{/each}}
513           {{else}}
514             <tr>
515               <td>
516                 <a class="btn btn-outline-secondary btn-sm"
517                   href="{{base_url}}&hierarchy=1">display child places</a>
518               </td>
519             </tr>
520           {{/if}}
521           {{tooManyHierarchyLinesWarning aPlace}}
522         </tbody>
523       </table>
524     </div>
525   </div>
526 </div>
527
528 </script>
529 <script id="detailspage-index-template" type="text/x-handlebars-template">
530 <div class="container" id="details-index-page">
531   <div class="row">
532     <div class="col-md-12">
533
534       <h1>Show details for place</h1>
535
536       <div class="search-form">
537         <h4>Search by place id</h4>
538
539         <form class="form-inline" action="details.html">
540           <input type="edit"
541                  class="form-control input-sm"
542                  pattern="^[0-9]+$"
543                  name="place_id"
544                  placeholder="12345" />
545           <input type="submit"
546                  class="btn btn-primary btn-sm"
547                  value="Show" />
548         </form>
549       </div>
550
551       <div class="search-form">
552         <h4>Search by OSM type and OSM id</h4>
553
554         <form id="form-by-type-and-id"
555               class="form-inline"
556               action="details.html">
557           <input type="edit"
558                  class="form-control input-sm"
559                  pattern="^[NWR][0-9]+$"
560                  placeholder="N123 or W123 or R123" />
561           <input type="hidden" name="osmtype" />
562           <input type="hidden" name="osmid" />
563           <input type="submit" class="btn btn-primary btn-sm" value="Show" />
564         </form>
565       </div>
566
567       <div class="search-form">
568         <h4>Search by openstreetmap.org URL</h4>
569
570         <form id="form-by-osm-url"
571               class="form-inline"
572               action="details.html">
573           <input type="edit"
574                  class="form-control input-sm"
575                  pattern=".*openstreetmap.*"
576                  placeholder="https://www.openstreetmap.org/relation/123" />
577           <input type="hidden" name="osmtype" />
578           <input type="hidden" name="osmid" />
579           <input type="submit" class="btn btn-primary btn-sm" value="Show" />
580         </form>
581       </div>
582
583     </div>
584   </div>
585 </div></script>
586 <script id="deletable-template" type="text/x-handlebars-template">
587 <div class="container">
588   <div class="row">
589     <div class="col-sm-12">
590       <h1>Deletable</h1>
591
592       <p>
593           {{aPolygons.length}} objects have been deleted in OSM but are still in the Nominatim database.
594       </p>
595
596       <table class="table table-striped table-hover">
597         <thead>
598           <th>Place id</th>
599           <th>Country Code</th>
600           <th>Name</th>
601           <th>OSM id</th>
602           <th>OSM type</th>
603           <th>Class</th>
604           <th>Type</th>
605         </thead>
606         <tbody>
607           {{#each aPolygons}}
608           <tr>
609             <td><a href="{{detailsURL this}}">{{this.place_id}}</a></td>
610             <td>{{country_code}}</td>
611             <td>{{name}}</td>
612             <td>{{osmLink this}}</td>
613             <td>{{osm_type}}</td>
614             <td>{{class}}</td>
615             <td>{{type}}</td>
616           </tr>
617           {{/each}}
618         </tbody>
619       </table>
620
621
622     </div>
623   </div>
624 </div
625
626 </script>
627 <script id="polygons-template" type="text/x-handlebars-template">
628 <div class="container">
629   <div class="row">
630     <div class="col-sm-12">
631       <h1>Broken polygons</h1>
632
633       <p>
634           Total number of broken polygons: {{aPolygons.length}}.
635       </p>
636
637       <table class="table table-striped table-hover">
638         <thead>
639           <th>OSM type</th>
640           <th>OSM id</th>
641           <th>Class</th>
642           <th>Type</th>
643           <th>Name</th>
644           <th>Country Code</th>
645           <th>Error message</th>
646           <th>Updated</th>
647           <th>&nbsp;</th>
648         </thead>
649         <tbody>
650           {{#each aPolygons}}
651           <tr>
652             <td>{{osm_type}}</td>
653             <td>{{osmLink this}}</td>
654             <td>{{class}}</td>
655             <td>{{type}}</td>
656             <td>{{name}}</td>
657             <td>{{country_code}}</td>
658             <td>{{errormessage}}</td>
659             <td>{{updated}}</td>
660             <td>
661               <a href="http://localhost:8111/import?url=https://www.openstreetmap.org/api/0.6/{{formatOSMType osm_type}}/{{osm_id}}/full" target="josm">josm</a>
662             </td>
663           </tr>
664           {{/each}}
665         </tbody>
666       </table>
667
668
669     </div>
670   </div>
671 </div
672
673 </script>
674 </body>
675 </html>