My partners and I are trying to create a google map version of our
college campus using your API. So the issue is this: We have specific
parts of the campus in a MySQL database stored either with its address
or latitude/longitude. Our website has two drop downs (a start and an
end location) and after the user hits submit we just want to print out
directions from point a to point b and to have markers and the
direction path. Since we have to access info from the database in the
API we are attempting to use PHP, but it does not work. I've pasted
our PHP and the load function that is supposed to do the
aforementioned details. I'm just not quite sure why this isn't
working. Is there some sort of restriction to using PHP within the
API? I've noticed that <? ?> (PHP tags) do not seem to show up as the
same color as they do in other parts of the HTML on my text editor.
Any help you can provide us with would be absolutely amazing.

Here is the exact area of the code that is not working:

// code courtesy of google (http://code.google.com/apis/maps/
documentation/services.html#Local_Search)
            var directionsPanel;
            var directions;

            directionsPanel = document.getElementById
("my_textual_div");
            directions = new GDirections(map, directionsPanel);

 // if starting location has an address and the end location does not
             <? if ($startr["Address"] != NULL) ?>
                  directions.load("from: <? echo "$startr["Address"] ?
> to: <? echo $enda["Lat"], $enda["Long"]",
{travelMode:G_TRAVEL_MODE_WALKING});

            <? else if ($enda["Address"] != NULL) ?>
                 directions.load("from: <? echo "$startr["Lat"],
$startr["Long"] ?> to: <? echo $enda["Address"]",
{travelMode:G_TRAVEL_MODE_WALKING});
             <? else ?>
                 directions.load("from: <? echo "$startr["Lat"],
$startr["Long"] ?> to: echo $enda["Lat"], $enda["Long"]",
{travelMode:G_TRAVEL_MODE_WALKING});

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