Wednesday, January 14, 2009

Tetas Grandes Bizarre

Overlay e markers su una Google Map: un primo esempio

We have learned so far how to insert a Google Map your site, focusing on specific geographic coordinates . We learned how to put some controls (the arrows, zoom, scale) and a dialog box at the point where the map is centered. The next
'esigenza becomes the view of the particular points on our map.
According to the code of Google Maps, all that can be identified by geographic coordinates is defined Overlay . A special type of Overlay is the marker, that is the single point position on a map. Other overlay are, for example polylines (sets of points forming a line) and polygons (polygons). The list does not end here, but in this post we will focus only on the first.

example that I propose, on a Google Map markers are displayed on the schools I attended (elementary, middle, high). Hover on each marker displays the type of school.
As in the previous example, before we begin we need the coordinates of the points that we would like to view. There may be entrusted again MyGeoPosition.com or just to point out other sites geocoding, a different alternative as this . The important thing, remember, is that the coordinates are in decimal format.

The coordinates of one of the schools I will also serve to center the map, then reuse the method

map.setCenter (new GLatLng ( lat, long ) livellozoom )

For view of the marker, however, I introduce the new method

GMarker ( coord , {title: " string"});


dove coord è il vettore bidimensionale delle coordinate, valorizzato attraverso la classe GLatLng. title è uno degli attributi opzionali di GMarker , e consente la visualizzazione di una stringa al passaggio del mouse sul marker.

A questo punto abbiamo tutti gli elementi per finire il nostro lavoro. Il risultato lo potete apprezzare qui e passiamo dunque a visualizzare il codice per intero:


<!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"> \u0026lt;head>


\u0026lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

\u0026lt;title> Visualizzazione markers its a Google Map \u0026lt;/ title > \u0026lt;script src="http://maps.google.com/maps?file=api&v=2&


key=APIKEYCHEMIHADATOGOOGLE"

type="text/javascript"> \u0026lt;/ script>



\u0026lt;script type="text/javascript"> function initialize () {

if (GBrowserIsCompatible ()) {

/ / Visualizza map mode only 'road
var map = new GMap2 (document.getElementById ("map_canvas"));

/ / ITIS G. Capellini
var center = new GLatLng (44.111508, 9.835831);

/ / Elementary Via Pascoli
var pin1 = new GLatLng (44.113902, 9.834570);

/ / Medium Via Leopardi
var pin2 = new GLatLng (44.113715, 9.833441) ;

map.setCenter (center, 16);

/ / The title option brings up a string of Gmarker
to step on the marker var marker = new

GMarker (center, {title: "Here I attended
superior "});
map.addOverlay (marker);

var marker = new GMarker (pin1, {title:" Here I attended the elementary
"});
map.addOverlay (marker);

var marker = new GMarker (pin2, {title: "Here I attended
medium"});
map.addOverlay (marker);

/ / If you want to add more markers in high
just declare a new variable (eg pin3) and copy the two lines just above this comment
replacing the variable name

/ / Add controls map.addControl
large format (new GLargeMapControl ());

/ / Add the scale
map.addControl (new GScaleControl ());}



} \u0026lt;/ script>
\u0026lt;/ head>

\u0026lt;body onload = "initialize ( ) "onunload =" GUnload () "> \u0026lt;div
id="map_canvas" style="width: 550px; height: 450px"> \u0026lt;/ div>

\u0026lt;/ body>
\u0026lt;/ html>



The example that I have proposed the display of markers is a bit 'rude. If we were to add new markers in fact we should necessarily change the above code, among other things that become difficult to read if we had to place several markers on a map.
The static display of markers is thus a major limitation, the remedies which will be used in posts to come.

Tuesday, January 13, 2009

Four Word Phrases For Friends

I primi controlli e metodi nell'utilizzo delle Google Maps

begin to do some work on files of the previous article to make it even more 'useful to our work.
Map of the previous post did not allow us either to move the map nor zoom controls attravero classic Google Maps. Suppose we have the need to include such controls. Suppose also that you have the need to incorporate into our site a map centered on a particular item by entering a description in the same place.
For centering the map, will be the method

map.setCenter (new GLatLng (lat, long), livellozoom)

To do this we need to know the latitude and longitude (NB in decimal format, not in degrees) of the point where we're going to center the map. To do this, or record the data from our GPS or use applications like http://mygeoposition.com/ .
Regarding the controls, you can simply use the methods

map.addControl (new GMapTypeControl ());


map.addControl (new GSmallMapControl ());

map.addControl (new GLargeMapControl ());


map.addControl (new GScaleControl ());


the first control allows you to select the type of map (Map, Satellite, Hybrid), the second and third are used to activate the navigation bar (the arrows to move) and buttons for zooming, in two versions, small and large, the fourth allows you to see the scale of our map.
Finally, with regard to the dialog box, you use the method


map.openInfoWindow (map.getCenter (), document.createTextNode ("testodavisualizzare"));


The work done so far can find here, followed by the HTML document.


\u0026lt;! DOCTYPE html PUBLIC "- / / W3C / / DTD XHTML 1.0 Strict / / EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

\u0026lt;html xmlns="http://www.w3.org/1999/xhtml">
\u0026lt;head>
\u0026lt;meta http-equiv = "content-type" content = "text / html; charset = utf- 8 "/>
\u0026lt;title> Example 2 \u0026lt;/ title>
\u0026lt;script src =" & key = http://maps.google.com/maps?file=api&v=2
ABQIAAAAynaMdsZYAs5aITp8oGFoixTaBdm2rMFwTfjoALLN-mPT1dOPXBTTmmyWoK3
otqrSo4SXBqg8UMWHOA "type =" text / javascript "> \u0026lt;/ script>

\u0026lt;script type="text/javascript">

/ / function load () {
if (GBrowserIsCompatible ()) {var map = new
GMap2 (document.getElementById ("map"));

/ / ***** Center Spezia on the map zoom level 16
map.setCenter (new GLatLng (44.111206, 9.834749), 16);

/ / ***** View Control - Zoom Piccolo
map.addControl (new GSmallMapControl ());

/ / ***** View Map Type Control
map.addControl (new GMapTypeControl ());

/ / View *****
the scale of the map map.addControl (new GScaleControl ());

/ / ***** Opens information window
map.openInfoWindow (map.getCenter (), document.createTextNode ("The house where I was born
: Italy Avenue 40, Los Angeles'));}

}


//]]> \u0026lt;/ script>
\u0026lt;/ head>
\u0026lt;body onload = "load ()" onunload = "GUnload () "> \u0026lt;div
id="map" style="width:600px;height:400px"> \u0026lt;/ div>
\u0026lt;/ body>
\u0026lt;/ html>

Saturday, January 10, 2009

Equity Derivatives Tutorial

Il BigBang ovvero: tutto comincia da qui

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.