Home > PHP > PHP Code > Google maps using php code

Google maps using php code

We can implement two types of mpas, one google maps and second one is yahoo maps.
one first one is google maps- we have to sign up for API key, with that API key we can place the maps.

The Google Maps API lets you embed Google Maps in your own web pages with JavaScript. The API provides a number of utilities for manipulating maps (just like on the http://maps.google.com web page) and adding content to the map through a variety of services, allowing you to create robust maps applications on your website.

We can signup for our website url at :


In that fill the text box My web site URL: http://[Domain Name] . . . It will generate the one API Key.

with that API Key we can embed the google map to our website.

We can simple javascript to embed the maps to our website:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>GSmapSearchControl Sample</title>
<!– Note:
Make sure to replace the &key=internal with &key=~the value of your key~
in both the maps API script load and in the Ajax Search API script load statements
<!– maps api, ajax search api, map search control code –>
<script    src="http://maps.google.com/maps?file=api&v=2&

<script   src="http://www.google.com/uds/api?file=uds.js&    v=1.0&key=ABQIAAAAGvs30FUboNhX-BMsz1wHmhRueXhM_ZR0uaVb2boWRzq1eE2kghQvVdJiR71BuD29Jsee_kDbmydTOQ"
<script src="http://www.google.com/uds/solutions/mapsearch/gsmapsearch.js"
<!– ajax search stylesheet, map search stylesheet –>
<link href="http://www.google.com/uds/css/gsearch.css" rel="stylesheet"    type="text/css"/>
<link href="http://www.google.com/uds/solutions/mapsearch/gsmapsearch.css" rel="stylesheet"/>
body, table, p{
background-color: white;
font-family: Arial, sans-serif;
font-size: 13px;
#mapsearch {
width : 400px;
margin-left: 10px;
padding: 4px;
border : 1px solid #f9f9f9;
function LoadMapSearch() {
var options = {
title : "Googleplex",
url : "http://www.google.com/corporate/index.html"
new GSmapSearchControl(
"1600 Amphitheatre Parkway, Mountain View, CA",
<div id="mapsearch">Loading…</div>

With the above code we can implement the maps to our website.

Thank you,

Anil Kumar