Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Google Map from Scratch


Go to End


1019 Views

Avatar
vlnrajesh

Community Member, 1 Post

28 October 2008 at 12:48am

I would like to have a Google map which only can point out a part of the globe not the whole, for no reason. I have followed some the instructions of Developer but i am not able to succeed. More over i want to run this site on a Virtual Machine so i want the Google App to be created as http://localhost/silverstripe/

and I got the char sequence as a API key
ABQIAAAAR961RmwqX6JM72dPhgxpXRSl2cCGfYLKpuS8wz_6fO3TDVgOThQQiyDYY7D2EVZCJe7_dnaqrSGN_Q

The Example webpage is this

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Maps JavaScript API Example</title>
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAR961RmwqX6JM72dPhgxpXRSl2cCGfYLKpuS8wz_6fO3TDVgOThQQiyDYY7D2EVZCJe7_dnaqrSGN_Q"
type="text/javascript"></script>
<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>
</head>
<body onload="load()" onunload="GUnload()">
<div id="map" style="width: 500px; height: 300px"></div>
</body>
</html>

Thanks in Advance for your help to me