Hi there,

I've just started to combine google maps with a database. I'm not very
good at javascript but with some help the first part worked. On my
page http://www.nederlandsevakanties.nl/noord-holland/aalsmeer-vakantie.php
there is a map with 4 accommodations with info out of the database.
So far.. everything works for me

The only problem is that I want to get the coordinates of
"map.setCenter" also from the database. I have a lot of different
cities and they all need a different map.

To display the coordinates on the website I use a code like:
<?
$query = "SELECT lat,lng FROM nieuwtotaal WHERE
place='{$data['placeitem']}'";
$result = mysql_query($query);
if($rij = mysql_fetch_array($result)){
echo "{$rij['lat']} {$rij['lng']}";
}
?>

How can I combine this with the map code like I have on the page
itself?

    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
        map.setCenter(new GLatLng(52.266751, 4.748942), 12);



If you can help me with this, I would be very happy! And if it is not
too much trouble, please show how the code should look and let me know
if I need to put some other codes in it as wel, like var codes or
anything. As said before, I'm not good with javascript so pure
technical talk doesn't help me too much :)

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to