On Oct 14, 4:53 am, jef <[EMAIL PROTECTED]> wrote:
> yes, actually my question is : with what do i replace my form.
>
> the only thing I need is to reset the center of the map from a zip
> code.
>
hi jef, you will need to use AJAX instead of submitting the form
1. set the form "action" and submit button "onclick" to a javascript
function, for example
<form action="codePostalRecherche()" ...
<input onclick="codePostalRecherche()" ...
2. make the input field id unique
<input class="search_field" id="recherche_input"
name="recherche_input" ...
3. write javascript search function
function codePostalRecherche() {
var codePostal = document.getElementById('recherche_input').value;
var url = '/producteurs/recherche?codepostal=' + codePostal;
GDownloadUrl(url, function(data) {
var xml = GXml.parse(data);
var zoom = extract from xml
var center = extract from xml
map.setCenter(center,zoom);
}
}
4. write new search page that returns postal code center and zoom in
xml
input
/producteurs/recherche?codepostal=14000
output
<?xml version="1.0" encoding="UTF-8"?>
<bounds>
<zoom></zoom>
<center latitude="" longitude="" />
</bounds>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---