maposmatic-dev
[Top][All Lists]
Advanced

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

[Maposmatic-dev] [PATCH] Resetting the osmid field while trying an other


From: pierre . mauduit
Subject: [Maposmatic-dev] [PATCH] Resetting the osmid field while trying an other place lookup / nominatim lookup
Date: Mon, 21 Dec 2009 00:16:08 +0100

From: Pierre Mauduit <address@hidden>

---
 www/templates/maposmatic/index.html |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/www/templates/maposmatic/index.html 
b/www/templates/maposmatic/index.html
index 3cfe43a..87988d1 100644
--- a/www/templates/maposmatic/index.html
+++ b/www/templates/maposmatic/index.html
@@ -49,6 +49,15 @@ function area_selection_mode_switch(mode)
         arr[i].style.display = 'table-row';
     }
   }
+  if (mode == 'bbox-mode')
+  {
+    reset_osmid_field();
+  }
+}
+
+function reset_osmid_field()
+{
+    document.getElementById("id_administrative_osmid").value = "";
 }
 
 function pageinit()
@@ -62,6 +71,8 @@ function pageinit()
     area_selection_mode_switch('bbox-mode');
   else
     area_selection_mode_switch('admin-mode');
+
+  
document.getElementById('id_administrative_city').setAttribute('onchange','reset_osmid_field()');
 }
 
 function validate_city_search()
@@ -75,13 +86,15 @@ function validate_city_search()
                if (typeof item.ocitysmap_params == "undefined")
                {
                  $("#result_nominatim_search").append("<li><img 
src=\"/smedia/icon_alert.png\" alt=\"Work In Progress\" />&nbsp;<label 
class=\"place_unavailable\""
-                   + ">" +item.display_name + "\"</label></li>");
+                   + ">" +item.display_name + "</label></li>");
                 }
                else
                 {
                   $("#result_nominatim_search").append("<li><input 
onchange=\"javascript:update_hidden(this,'"
                     +item.display_name+"');\" type=\"radio\" 
name=\"administrative_tmp_osmid\" value=\""
-                    +item.ocitysmap_params['id']+"\" 
/>"+item.display_name+"</li>");
+                    +item.ocitysmap_params['id']+"\" 
id=\"rd"+item.ocitysmap_params['id']+"\"/><label for=\"rd"+
+                    item.ocitysmap_params['id']+"\">"
+                    +item.display_name+"</label></li>");
                 }
               }
             );
-- 
1.6.5.7





reply via email to

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