maposmatic-dev
[Top][All Lists]
Advanced

[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
    provided.

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/forms.py |    1 +
 www/media/osm_map.js    |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/www/maposmatic/forms.py b/www/maposmatic/forms.py
index 1c64634..abd6e70 100644
--- a/www/maposmatic/forms.py
+++ b/www/maposmatic/forms.py
@@ -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();
     setFormActivation(true);
+    $('#id_administrative_city').empty();
+    $('#id_administrative_osmid').empty();
     if (map == null)
       mapInit();
     resetLanguages();
-- 
1.6.3.3.277.g88938c





reply via email to

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