I successfully created a Google Maps mashup for a site I am working on
by I am tearing my hair out by something simple.

On the map webpage I created I have an address search form that zooms
and centers in on an address.
I want to make a similar form on all other pages of the site, but I am
having trouble passing the data using PHP (which is then passed to
javascript into the map).
All I need it to do is to zoom and center the map to the address that
is entered. What is the best way to go about this?

I tried using the same function I already use for the same page search
form by passing in php to javascript data. I used the old <?php
$whatever = $POST_["something"] ?> (<--in the body) and var
something_else = $whatever (<-- within my javascript tags). The
function is as follows, and was written by google :

function showAddress(searchaddress) {
      if (geocoder) {
        geocoder.getLatLng(
          searchaddress,
          function(point) {
            if (!point) {
              alert(searchaddress + " not found");
            } else {
              map.setCenter(point, 13);
            }
          }
        );
      }
    }


Should I try placing the function in my onload() function or is it not
even feasible for what I'm trying to do? Is there a way to use
variables with the map.setCenter() function? Any help would be greatly
appreciated.

I can post code snippets if needed.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to