* need /details to support &format=json
* reverse: zoom not set
http://localhost:8000/reverse.html?format=html&lat=52.3755991766591&lon=7.646484374999999&zoom=
-* search page: add pagination, moreurl
-* search page: add viewbox
+* !search page: add pagination, moreurl
* details page: add "There are more child objects which are not shown" back in
* set acceptlanguage to API request
* move this TODO.txt to github issues
* write install instructions
* check output of /dist into repository
+* use polygon_geojson, not polygon parameter
## Unknown
return (typeof Nominatim_Config[str] !== 'undefined' ? Nominatim_Config[str] : default_val);
}
-function parse_and_normalize_geojson_string(raw_string){
+function parse_and_normalize_geojson_string(part){
// normalize places the geometry into a featurecollection, similar to
// https://github.com/mapbox/geojson-normalize
var parsed_geojson = {
features: [
{
type: "Feature",
- geometry: JSON.parse(raw_string),
+ geometry: part,
properties: {}
}
]
});
layerGroup.addLayer(circle);
}
- if (result.aBoundingBox){
+ if (result.boundingbox){
- var bounds = [[result.aBoundingBox[0]*1,result.aBoundingBox[2]*1], [result.aBoundingBox[1]*1,result.aBoundingBox[3]*1]];
+ var bounds = [[result.boundingbox[0]*1,result.boundingbox[2]*1], [result.boundingbox[1]*1,result.boundingbox[3]*1]];
map.fitBounds(bounds);
- if (result.asgeojson && result.asgeojson.match(/(Polygon)|(Line)/) ){
+ if (result.geojson && result.geojson.type.match(/(Polygon)|(Line)/) ){
var geojson_layer = L.geoJson(
- parse_and_normalize_geojson_string(result.asgeojson),
+ parse_and_normalize_geojson_string(result.geojson),
{
// http://leafletjs.com/reference-1.0.3.html#path-option
style: function(feature) {
var api_request_params = {
q: search_params.get('q'),
polygon_geojson: search_params.get('polygon_geojson') ? 1 : 0,
- polygon: search_params.get('polygon'),
viewbox: search_params.get('viewbox'),
format: 'jsonv2'
};
{{/if}}
<span class="name">{{aResult.display_name}}</span>
- <span class="type">{{formatLabel aResult}}</span>
+ <span class="type">({{formatLabel aResult}})</span>
<p class="coords">{{aResult.lat}},{{aResult.lon}}</p>
<a class="btn btn-default btn-xs details" href="details.html?place_id={{aResult.place_id}}">details</a>
<div class="form-group search-button-group">
<button type="submit" class="btn btn-primary btn-sm">Search</button>
{{#if env.Search_AreaPolygons}}
- <input type="hidden" value="1" name="polygon" />
+ <input type="hidden" value="1" name="polygon_geojson" />
{{/if}}
<input type="hidden" name="viewbox" value="{{sViewBox}}" />
<div class="checkbox-inline">