Repeatedly prodded by digitaladoptive , telematics adventure companion for some time now, we begin this new venture, which aims to venture into the still mysterious world of bees, whether Google, Flickr or other "devilish" 2.0.
This space would be born as a support, integration, analysis, completion of subject matter from digitaladoptive precisely in his new blog Mashing Up .
But since it is my intention to be very simple and understandable, really want to start with the basics, as it has solid foundations that skyscrapers are born. Wanting to start from
Google Maps API, we try to understand what they are and that they serve.
Google does not just put at our disposal a set of dynamic maps (navigable, clickable, Zoom in and out), but gives us the possibility to include (embed) portions of these maps (and the information contained therein) in our staff Web site through the scripting language Javascript .
What you need to start using the Google Maps API?
1. A web space
For our purposes, a free web space should be just fine. Be careful though that the service provides support PHP and MySQL, things that will serve us later. It is not my intention to advertise, but since I used it I also suggest http://www.ilbello.com/
2. An FTP client
Although this type of software there are dozens of versions with different features more or less. Always the intention of not advertising, I suggest you even begin to install software but do not use http://www.net2ftp.it/ , an FTP client that works directly from the web
3. A Google Account
To use Google maps on your website you need a Google Map API key, ASK FOR FREE here after signing up Gmail (still do not have a Gmail account? What are you waiting?). Click the box where you agree to the terms and conditions for Google and type in the space after the address of the site where you're going to include a map
NOTE! Each key is valid for one and only one directory within a domain. Using an API key in a page like http://www.pippo.com/ , you can not use the same key to include a map on a page within http://www.pippo.com / folder . Be very careful. You can still get a new API key if you have to manage multiple Google Maps directory of your website. Google helps us
indeed the task because, in addition to the API key request, you will see a sample page, which contains the basic elements of the first to view our map:
\u0026lt;! DOCTYPE html PUBLIC "- / / W3C / / DTD XHTML 1.0 Strict / / EN "
" http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd ">
\u0026lt;html xmlns =" \u200b\u200bhttp://www.w3.org/1999 / xhtml ">
\u0026lt;head>
\u0026lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
\u0026lt;title> Google Maps JavaScript API Example \u0026lt;/ title >
\u0026lt;script src = "& http://maps.google.com/maps?file=api&v=2
key=ABQIAAAAynaMdsZYAs5aITp8oGFoixRJHuyTOYtQsjTGz8OInkxDcZHO1RR_8HzINN3BOtSIuhhpB8eBaotMiQ"
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">
\u0026lt;/ body>
\u0026lt;/ html>
Just then copy the proposed code and paste it into any text editor and then upload the file received via FTP, the folder our site. This
the result. This is a portion of the map of the area Palo Alto, California in ; in the next post will start to work on the code to customize a little bit of our map.
0 comments:
Post a Comment