Question Help With Google Maps Numbered Map Markers
I'm fairly new to google maps, hell I just found out what to do with
the map api code yesterday so bare with me. I built a simple map
program to pull data from 2 different databases and post there
locations on the map. i'm trying to find a way to make the colors from
one database different from the colors from the other. I have seprate
imgs for each I just don't know how to apply them. as well i'm also
trying to get the markers to have numbers on them which I have the
images for that as well and just can't for the life of me figure out
how to apply that either.
here's the code For the entire map:
PHP Code:
<script src="http://maps.google.com/maps?file=api&v=1
&key=ABQIAAAAwck-
cJHtWqhCPpb7YdIbxxQ330Nr9P2bWxzoQ7lYE8aZnHHG8BSpAUR9xgtcnWMX5AM2ZXmnKrqO1Q"
type="text/javascript">
</script>
<?php
while($rowx = mysql_fetch_array($xerrs))
{
$lat = $rowx['latitude'];
$lon = $rowx['longitude'];
}
?>
<div id="map" style="width: 300px; height: 300px; text-
align:center;margin-bottom:10px;"></div>
<script type="text/javascript">
//<![CDATA[
var map = new GMap(document.getElementById("map"));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.centerAndZoom(new GPoint(<?php echo $lon; ?>, <?php echo $lat; ?
>), 5);
// Create the marker and corresponding information window
function createInfoMarker(point, address) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function()
{ marker.openInfoWindowHtml(address); });
return marker;
}
<?php mysql_select_db('josegoes');
$qessx = mysql_query("SELECT DISTINCT * FROM ex_data WHERE city =
'$city' GROUP BY street ORDER BY title LIMIT $set_limit, $limit");
$thenumber = 1;
while($row = mysql_fetch_array($qessx))
{
?>
var point = new GPoint(<?=$row['longitude'];?>, <?=$row['latitude'];?
>);
address = "<span class='googtitle'><? echo $thenumber; ?>. <?=
$row['title'];?></span><br /><span class='googphone'><?=$row['phone'];?
></span><br /><span class='googaddre'><?=$row['street'];?></span><br /
><span class='googaddre'><?=$row['city'];?>, <?=$row['state'];?> <?=
$row['zipcode'];?></span>";
var marker = createInfoMarker(point, address);
map.addOverlay(marker);
<?php $thenumber++; } ?>
<?php mysql_select_db('edirectory_dfwdine');
$region = $region_id;
$listy = mysql_query("SELECT * FROM Listing WHERE region_id =
'$region'");
while($rowa = mysql_fetch_array($listy))
{
?>
var point = new GPoint(<?=$rowa['longitude'];?>, <?=$rowa['latitude'];?
>);
address = "<span class='googtitle'><?=$rowa['title'];?></span><br /
><span class='googphone'><?=$rowa['phone'];?></span><br /><span
class='googaddre'><?=$rowa['address'];?> <?=$rowa['address2'];?></
span><br /><span class='googaddre'><?=$city;?>, <?=$state;?> <?=
$rowa['zip_code'];?></span>";
var marker = createInfoMarker(point, address);
map.addOverlay(marker);
<?php } ?>
//]]>
</script>
The website that the map is on is www.josegoes.com. after you go to
the site just select a city and click go. the map is in the bottom
right hand corner.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---