[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Maposmatic-dev] [PATCH maposmatic] Make sure the byadmin and bybbox mod

From: Maxime Petazzoni
Subject: [Maposmatic-dev] [PATCH maposmatic] Make sure the byadmin and bybbox mode are really exclusive
Date: Tue, 9 Feb 2010 10:25:40 +0100

This fixes task #10150. When selecting a city by administrative
boundary, and the rendering is refused because the area is too large,
and then switching to bounding box mode trying to render an acceptable
area, the big administrative boundary is rendered instead. This is
because of two things:

  * the administrative city and administrative osmid fields are not
    cleared when switching to bounding box / when cleaning the form data
    for bounding box mode
  * the daemon renders the given osmID even if a bounding box is

This changes fixes the first issue, which effectively resolves task
10150. The second issue will be fixed by the new (upcoming) daemon code.

Signed-off-by: Maxime Petazzoni <address@hidden>
 www/maposmatic/ |    1 +
 www/media/osm_map.js    |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/www/maposmatic/ b/www/maposmatic/
index 1c64634..abd6e70 100644
--- a/www/maposmatic/
+++ b/www/maposmatic/
@@ -131,6 +131,7 @@ class MapRenderingJobForm(forms.ModelForm):
             # Make sure that bbox and admin modes are exclusive
             cleaned_data["administrative_city"] = ''
+            cleaned_data["administrative_osmid"] = None
         return cleaned_data
diff --git a/www/media/osm_map.js b/www/media/osm_map.js
index 52424c9..1819438 100644
--- a/www/media/osm_map.js
+++ b/www/media/osm_map.js
@@ -324,6 +324,8 @@ $(document).ready(function() {
     $('#mapform tbody').children('tr.byadmin').hide();
     $('#mapform tbody').children('tr.bybbox').show();
+    $('#id_administrative_city').empty();
+    $('#id_administrative_osmid').empty();
     if (map == null)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]