Forum Moderators: coopster

Message Too Old, No Replies

Showing google map with php $ GET

Showing google map with php $_GET

         

drooh

11:23 am on Aug 9, 2007 (gmt 0)

10+ Year Member



Ok, i really can't seem to figure this out. Google has tons of documentation but it's still not clicking for me.

Here is what Im trying to do.

I have a database with about 1000 churches in it. We have all sorts of data including their address, zip etc.

I want to have this data displayed publicly and show a small button that says "map". When they click this a pop up box opens approx 500x400 and then displays a google map for the address of that church.

on the page that pops up I would like to have some code like the follwing

<?php
$address = $_GET['address'];
$zip = $_GET['zip'];
?>

now how to I insert that data so I can geocode it and show a map? Here is what I have from google so far

<script type="text/javascript">
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
}
}
//]]>
</script>

I've already looked at stuff google has and it's over my head, I just need a script that converts that address & zip and then brings up a map. No manula entry or clciking another submit button.

hope i communicated this clear enough, thanks for the help

:)

Habtom

11:30 am on Aug 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<script type="text/javascript">
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
}
}
//]]>
</script>

This function doesn't seem to take address and zip as input, instead you see the latitude and longitude of the place as inputs. You might need to check other google functions which can take the zip and address as input and display the map.

Habtom

drooh

11:36 am on Aug 9, 2007 (gmt 0)

10+ Year Member



thats exactly what im trying to do, but cannot seem to find anything... or atleast cannt translate how they tell me to do it.

stever

12:50 pm on Aug 9, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You have to feed it to a geocoder - take a look around in your favourite search engine, there are some php geocoding solutions out there which relate to the Google geocoding API.