For those interested in developing with Google Maps I thought I would share with you a very nifty framework/extension called GMapEz.
It is probably the most useful tool you could ever use for implementing Google Maps into your site. It contains all the scripts in one JS file so all you have to do is call some HTML and it will generate the map for you.
There is no need to chuck this messing JS everywhere in your page for mapping a lot of people, all you have to do is make a hyperlink and it will build markers from that.Code:<html xmlns:v="urn:schemas-microsoft-com:vml"> <head> <title>My GMapEZ Maps</title> <meta name="gmapkey" content="abcdefg" /> <script src="http://bluweb.com/chouser/gmapez/gmapez-2.js" type="text/javascript"></script> </head> <body> <div class="GMapEZ" style="width: 300px; height: 300px;"> </div> </body> </html>
For example to create a marker:
This makes it very easy when using PHP to print recursive markers for 1000+ students as I have done. You just need to couple it with a cURL function for geocoding and you have a very powerful mapping script.Code:<a href="http://maps.google.com/maps?ll=41.092104,-85.144740&spn=0.006130,0.009795&t=k&hl=en"></a>
To add controls such as zoom it is as simple as modify the main div!
Putting that into Server-Side language such as PHP.
Here is the script I use for building the map
GMapEZ makes it very easy to build Google Maps without all the JS knowledge, I suggest those developing for Google Maps try it out!PHP Code:<html xmlns:v="urn:schemas-microsoft-com:vml">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>My Maps</title>
<meta name="gmapkey" content="ABQIAAAA9BGXXVM68Vhwg8Lj4oKLtxSDSwKFTcPXitZF-tRvZ-CMUGEZShTOqGpwrQAw-sTTfRDQWkfA_xmnDw" />
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<link href="style.css" rel="stylesheet" type="text/css"/>
<script
src="gmapez-2.js"
type="text/javascript"></script>
</head>
<body>
<div class="header" id="pageHeader">JTC Maps</div>
<div class="nav" id="navContent">
<p class="navText"><a href="map.php">Current Students</a></p>
<p class="navText"><a href="map.waiting.php">Waiting Students</a></p>
</div>
<div class="container" id="mainContent">
<div class="GMapEZ GLargeMapControl GMapTypeControl GScaleControl GOverviewMapControl" style="width: 950px; height: 500px;">
<?php
$sql = "SELECT * FROM `people`";
$result=mysql_query($sql);
$num=@mysql_numrows($result);
$i=0;
$male = 0;
$female = 0;
while ($i < $num) {
$address1=mysql_result($result,$i,"Address01");
$address2=mysql_result($result,$i,"Address02");
$state=mysql_result($result,$i,"State");
$status=mysql_result($result,$i,"Gender");
$first_name=mysql_result($result,$i,"FirstName");
$address_full = $address1 ." ". $address2 ." ". $state ." Australia";
//Colour the markers
if ($status == "M") {
$colour = "BLUE";
$male++;
} elseif ($status == "F") {
$colour = "RED";
$female++;
}
//GeoCODE!
$data = google_geo($address_full);
$data = explode(",",$data);
$lat = $data[1];
$long = $data[0];
//create the maker
echo "<a href=\"http://maps.google.com/maps?f=q&hl=en&geocode=&ie=UTF8&ll=". $lat .",". $long ."&z=16&iwloc=addr&om=1\">". $colour ."</a>\n";
//now place a bubble (so people can click and expand info")
echo "<div>". $first_name ." ". $last_name ."<br>". $address1 ."<br>". $address2 ."<br></div>\n";
$i++;
}
?>
Digg it!


LinkBack URL
About LinkBacks







Reply With Quote