hi everybody and sorry for my english.
I'm trying to make a map using the Api v3; i have a MySql database
with the informations for the markers (ID, address and nation), and I
wanna use this informations to create the markers dinamically.
Now I have created my map with the follow code:
var geocoder;
geocoder = new google.maps.Geocoder();
var map;
function convert_address ()
{
var indirizzo = "via duca degli abruzzi, milano";
if (geocoder)
{
geocoder.geocode(
{'address' : indirizzo}, function (results, status)
{
if (status == google.maps.GeocoderStatus.OK)
{
map.setCenter(results[0].geometry.location);
var marker = new google.maps.Marker(
{
map: map,
position: results[0].geometry.location
});
}
else
{
alert("The geocode service was unable to find
the address:
"+status);
}
});
}
}
function initialize()
{ var latlgn = new google.maps.LatLng(45, 12);
var myOptions =
{
zoom : 10,
center : latlgn,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map (document.getElementById("map_canvas"),
myOptions);
convert_address();
but it's a static page.
I've create a page named marker.php:
<?php
$nomehost = "localhost";
$username = "local";
$password = "host";
$nomedb = "powerDB";
$mysqli = new mysqli($nomehost, $username, $password, $nomedb);
if (mysqli_connect_errno())
{
echo "Error connecting @ DBMS: ".mysqli_connect_error();
exit();
}
else
{
but now I'm stopped.
How can I modify the files to take the information with a query
(SELECT ID, city, address from Store limit 50)
and use it to creating the markers?
thanks in advance.
--
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.