]> git.openstreetmap.org Git - nominatim-ui.git/commitdiff
control requesting polygons from API without hidden HTML field
authormarc tobias <mtmail@gmx.net>
Fri, 19 Jun 2020 04:36:37 +0000 (06:36 +0200)
committermarc tobias <mtmail@gmx.net>
Fri, 19 Jun 2020 04:36:37 +0000 (06:36 +0200)
dist/assets/js/nominatim-ui.js
dist/config.example.js
dist/search.html
dist/searchpage.hbs
src/assets/js/searchpage.js
src/templates/searchpage.hbs

index c597643fc804858acb26475c08b8af8040b41791..05019aa87ba63d7e7da6f95df422c1b644f8d4eb 100644 (file)
@@ -653,7 +653,7 @@ jQuery(document).ready(function () {
       state: search_params.get('state'),
       country: search_params.get('country'),
       postalcode: search_params.get('postalcode'),
       state: search_params.get('state'),
       country: search_params.get('country'),
       postalcode: search_params.get('postalcode'),
-      polygon_geojson: search_params.get('polygon_geojson') ? 1 : 0,
+      polygon_geojson: get_config_value('Search_AreaPolygons', false) ? 1 : 0,
       viewbox: search_params.get('viewbox'),
       exclude_place_ids: search_params.get('exclude_place_ids'),
       format: 'jsonv2'
       viewbox: search_params.get('viewbox'),
       exclude_place_ids: search_params.get('exclude_place_ids'),
       format: 'jsonv2'
index bfddf7fc2610ff3a17e88f6637125daecb1490d3..30da76997b2f28a450fe06435113da944d5b73d3 100644 (file)
@@ -12,7 +12,7 @@ Nominatim_Config['Nominatim_API_Endpoint'] = 'https://nominatim.openstreetmap.or
 // Nominatim_Config['Images_Base_Url'] = '/mapicons/';
 
 // If the API should return polygons to be displayed on the map
 // Nominatim_Config['Images_Base_Url'] = '/mapicons/';
 
 // If the API should return polygons to be displayed on the map
-// Nominatim_Config['Search_AreaPolygons'] = 1;
+// Nominatim_Config['Search_AreaPolygons'] = true;
 // Nominatim_Config['Reverse_Default_Search_Zoom'] = 18;
 
 // ---- MAP ----
 // Nominatim_Config['Reverse_Default_Search_Zoom'] = 18;
 
 // ---- MAP ----
index b3e2b032ae5d05da845d05337700439c6a88be9d..afb6c33adb69e28514e988e0fb1b0d0622f374a9 100644 (file)
     </div>
     <div class="form-group search-button-group">
             <button type="submit" class="btn btn-primary btn-sm mx-1">Search</button>
     </div>
     <div class="form-group search-button-group">
             <button type="submit" class="btn btn-primary btn-sm mx-1">Search</button>
-      {{#if env.Search_AreaPolygons}}
-        <input type="hidden" value="1" name="polygon_geojson" />
-      {{/if}}
       <input type="hidden" name="viewbox" value="{{sViewBox}}" />
       <div class="form-check form-check-inline">
         <input type="checkbox" class="form-check-input"
       <input type="hidden" name="viewbox" value="{{sViewBox}}" />
       <div class="form-check form-check-inline">
         <input type="checkbox" class="form-check-input"
index ae13597009ce9f7353834d6b0aeeb6cdcf689af3..7451398d88c148222ec792eaf6a29aa7397ed56f 100644 (file)
@@ -59,9 +59,6 @@
     </div>
     <div class="form-group search-button-group">
             <button type="submit" class="btn btn-primary btn-sm mx-1">Search</button>
     </div>
     <div class="form-group search-button-group">
             <button type="submit" class="btn btn-primary btn-sm mx-1">Search</button>
-      {{#if env.Search_AreaPolygons}}
-        <input type="hidden" value="1" name="polygon_geojson" />
-      {{/if}}
       <input type="hidden" name="viewbox" value="{{sViewBox}}" />
       <div class="form-check form-check-inline">
         <input type="checkbox" class="form-check-input"
       <input type="hidden" name="viewbox" value="{{sViewBox}}" />
       <div class="form-check form-check-inline">
         <input type="checkbox" class="form-check-input"
index 1061712a6cf0afe8ca9f82f34905cf6cd4d31cb3..5455f8e8f6dc542170c4569f4b63cff4cb8d25a9 100755 (executable)
@@ -395,7 +395,7 @@ jQuery(document).ready(function () {
       state: search_params.get('state'),
       country: search_params.get('country'),
       postalcode: search_params.get('postalcode'),
       state: search_params.get('state'),
       country: search_params.get('country'),
       postalcode: search_params.get('postalcode'),
-      polygon_geojson: search_params.get('polygon_geojson') ? 1 : 0,
+      polygon_geojson: get_config_value('Search_AreaPolygons', false) ? 1 : 0,
       viewbox: search_params.get('viewbox'),
       exclude_place_ids: search_params.get('exclude_place_ids'),
       format: 'jsonv2'
       viewbox: search_params.get('viewbox'),
       exclude_place_ids: search_params.get('exclude_place_ids'),
       format: 'jsonv2'
index ae13597009ce9f7353834d6b0aeeb6cdcf689af3..7451398d88c148222ec792eaf6a29aa7397ed56f 100644 (file)
@@ -59,9 +59,6 @@
     </div>
     <div class="form-group search-button-group">
             <button type="submit" class="btn btn-primary btn-sm mx-1">Search</button>
     </div>
     <div class="form-group search-button-group">
             <button type="submit" class="btn btn-primary btn-sm mx-1">Search</button>
-      {{#if env.Search_AreaPolygons}}
-        <input type="hidden" value="1" name="polygon_geojson" />
-      {{/if}}
       <input type="hidden" name="viewbox" value="{{sViewBox}}" />
       <div class="form-check form-check-inline">
         <input type="checkbox" class="form-check-input"
       <input type="hidden" name="viewbox" value="{{sViewBox}}" />
       <div class="form-check form-check-inline">
         <input type="checkbox" class="form-check-input"