<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Linea de Codigo &#187; Google</title>
	<atom:link href="http://lineadecodigo.com/categoria/google/feed/" rel="self" type="application/rss+xml" />
	<link>http://lineadecodigo.com</link>
	<description>/* Programación en la red */</description>
	<lastBuildDate>Tue, 22 May 2012 22:10:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Mi primera extensión en Google Chrome</title>
		<link>http://lineadecodigo.com/google/mi-primera-extension-en-google-chrome/</link>
		<comments>http://lineadecodigo.com/google/mi-primera-extension-en-google-chrome/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 06:00:38 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[icono]]></category>
		<category><![CDATA[manifest.json]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/?p=2748</guid>
		<description><![CDATA[Mediante este artículo vamos a ver como podemos crear nuestra primera extensión en Google Chrome. Pero antes de empezar, ¿qué son las extensiones de Google Chrome? Las extensiones de Google Chrome son componentes que se le pueden añadir al navegador web Google Chrome para ampliar la funcionalidad del mismo. Si queréis, podéis informaros más sobre [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-2748'></div><g:plusone size='medium' href='http://lineadecodigo.com/google/mi-primera-extension-en-google-chrome/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fgoogle%2Fmi-primera-extension-en-google-chrome%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/google/mi-primera-extension-en-google-chrome/" data-count="horizontal" data-text="Mi primera extensión en Google Chrome" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p>Mediante este artículo vamos a ver <strong>como podemos crear nuestra primera extensión en <a href="http://www.ayudaenlaweb.com/navegadores/que-es-google-chrome/" title="Google Chrome">Google Chrome</a></strong>.</p>
<p>Pero antes de empezar, ¿qué son las extensiones de <a href="http://www.ayudaenlaweb.com/navegadores/que-es-google-chrome/" title="Google Chrome">Google Chrome</a>? Las extensiones de <a href="http://www.ayudaenlaweb.com/navegadores/que-es-google-chrome/" title="Google Chrome">Google Chrome</a> son componentes que se le pueden añadir al navegador web <a href="http://www.ayudaenlaweb.com/navegadores/que-es-google-chrome/" title="Google Chrome">Google Chrome</a> para ampliar la funcionalidad del mismo.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2755" title="chrome_extensions" src="http://img.aulambra.com/wp-content/uploads/2010/09/chrome_extensions.png" alt="" width="353" height="91" /></p>
<p>Si queréis,  <a title="extensiones google chrome" href="https://chrome.google.com/extensions?page=1&amp;hl=en&amp;itemlang=es">podéis informaros más sobre las extensiones de Google Chrome</a>.</p>
<p>Lo primero que tenemos que saber para crear una extensión en <a href="http://www.ayudaenlaweb.com/navegadores/que-es-google-chrome/" title="Google Chrome">Google Chrome</a> es que hay que <strong>declarar un fichero manifest en formato json</strong>. Este fichero se llamará <strong>manifest.json</strong>. La <a title="estructura manifest.json" href="http://code.google.com/chrome/extensions/manifest.html">estructura de manifest.json</a> es la que define los elementos que contienen la extensión. A ver:</p>
<ul>
<li><strong>name</strong>, nombre de la extensión.</li>
<li><strong>version</strong>, versión de la extensión.</li>
<li><strong>description</strong>, descripción de la extensión.</li>
<li><strong>icons</strong>, iconos que representan la extensión. Hay que proporcionar, al menos, dos. Uno que sea 48x48 y otro 128x128</li>
<li><strong>browser_action</strong>, nos permite añadir un elemento a la barra de <a href="http://www.ayudaenlaweb.com/navegadores/que-es-google-chrome/" title="Google Chrome">Google Chrome</a>. Este será el elemento más importante de nuestra primera extensión en Google Chrome.</li>
</ul>
<p>Así, podemos ir creando el fichero manifest.json:</p>
<pre>{
  "name": "Mi Primera Extension",
  "version": "1.0",
  "description": "Extension que dice hola mundo",
}</pre>
<p>Pero vamos a entrar en profundidad en <strong>browser_action</strong>. Y es que <strong>browser_action</strong> es una estructura en si mismo, la cual puede contener los siguientes campos:</p>
<ul>
<li><strong>default_icon</strong>, icono que saldrá en la barra del <a href="http://www.ayudaenlaweb.com/navegadores/que-es-google-chrome/" title="Google Chrome">Google Chrome</a>.</li>
<li><strong>default_title</strong>, tooltip que se mostrará al pasar sobre el icono.</li>
<li><strong>default_popup</strong>, fichero <a href="http://www.manualweb.net/tutorial-html/" title="HTML">HTML</a> que se abrirá al pulsar sobre la extensión.</li>
</ul>
<p>Vamos añadiendo cosas a  nuestro fichero manifest.json:</p>
<pre>{
  "name": "Mi Primera Extension",
  "version": "1.0",
  "description": "Extension que dice hola mundo",
  "browser_action": {
    "default_icon": "logo.ico",
    "popup": "miprimeraextension.html"
  }
}</pre>
<p>Vemos que el fichero que se abrirá al pulsar sobre la extensión en <a href="http://www.ayudaenlaweb.com/navegadores/que-es-google-chrome/" title="Google Chrome">Google Chrome</a> será "miprimeraextension.html". Así que será dentro de él dónde codificaremos lo que queramos mostrar en la extensión. En este caso será algo muy sencillo.</p>
<pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:HTML"><span style="color: #000000; font-weight: bold;">html</span></a>&gt;&lt;<a href="http://w3api.com/wiki/HTML:HEAD"><span style="color: #000000; font-weight: bold;">head</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:HEAD"><span style="color: #000000; font-weight: bold;">head</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:BODY"><span style="color: #000000; font-weight: bold;">body</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:H1"><span style="color: #000000; font-weight: bold;">h1</span></a>&gt;</span>Hola Mundo!!<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:H1"><span style="color: #000000; font-weight: bold;">h1</span></a>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:BODY"><span style="color: #000000; font-weight: bold;">body</span></a>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:HTML"><span style="color: #000000; font-weight: bold;">html</span></a>&gt;</span></pre>
<p>Así, tenemos 3 ficheros dentro de nuestro directorio.</p>
<pre>/MiPrimeraExtension
|-- manifest.json
|-- miprimeraextension.html
|-- logo.ico</pre>
<p>Ahora solo tendremos que instalarlo en <a href="http://www.ayudaenlaweb.com/navegadores/que-es-google-chrome/" title="Google Chrome">Google Chrome</a>. Para ello vamos al menú:</p>
<pre>Tools &raquo; Developer Extensions</pre>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2756" title="chrome_extensions_load" src="http://img.aulambra.com/wp-content/uploads/2010/09/chrome_extensions_load.png" alt="" width="458" height="127" /></p>
<p>En la parte superior veremos que hay una opción que se llama <strong><em>Load unpacked extension</em></strong>. Al pulsar sobre esta opción se nos mostrará un explorador mediante el cual hay que elegir el directorio MiPrimeraExtension. Y ya tendremos la extensión instalada en <a href="http://www.ayudaenlaweb.com/navegadores/que-es-google-chrome/" title="Google Chrome">Google Chrome</a>.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2757" title="chrome_miprimeraextension" src="http://img.aulambra.com/wp-content/uploads/2010/09/chrome_miprimeraextension.png" alt="" width="478" height="104" /></p>
<p>Y el resultado de nuestra primera extensión en Google Chrome es el siguiente...</p>
<p style="text-align: center;"><img src="http://img.aulambra.com/wp-content/uploads/2010/09/chrome_miprimeraextension_working.png" alt="" title="chrome_miprimeraextension_working" width="348" height="207" class="aligncenter size-full wp-image-2767" /></p>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/vbscript/hola-mundo-en-vbscript/" rel="bookmark" title="Noviembre 12, 2010">Hola Mundo en VBScript</a></li>
<li><a href="http://lineadecodigo.com/linea-de-codigo/que-es-una-linea-de-codigo/" rel="bookmark" title="Noviembre 18, 2006">¿Qué es una línea de código?</a></li>
<li><a href="http://lineadecodigo.com/svg/hola-mundo-en-svg/" rel="bookmark" title="Diciembre 29, 2006">Hola mundo en SVG</a></li>
<li><a href="http://lineadecodigo.com/desarrollo-movil/hola-mundo-con-jquery-mobile/" rel="bookmark" title="Mayo 9, 2012">Hola Mundo con jQuery Mobile</a></li>
<li><a href="http://lineadecodigo.com/java/hola-mundo-en-java/" rel="bookmark" title="Marzo 31, 2007">Hola Mundo en Java</a></li>
</ul>
<p><!-- Similar Posts took 5.601 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_2748()',1000); }); </script><script type="text/javascript"> function loadGoogle1_2748(){ jQuery(document).ready(function($) { $('.dd-google1-2748').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/google/mi-primera-extension-en-google-chrome/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ventanas de información con imágenes en Google Maps</title>
		<link>http://lineadecodigo.com/google/ventanas-de-informacion-con-imagenes-en-google-maps/</link>
		<comments>http://lineadecodigo.com/google/ventanas-de-informacion-con-imagenes-en-google-maps/#comments</comments>
		<pubDate>Wed, 23 Sep 2009 06:00:30 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[GLatLng]]></category>
		<category><![CDATA[GMap2]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[GUnload]]></category>
		<category><![CDATA[H3]]></category>
		<category><![CDATA[imagen]]></category>
		<category><![CDATA[IMG]]></category>
		<category><![CDATA[onLoad]]></category>
		<category><![CDATA[onunload]]></category>
		<category><![CDATA[openInfoWindowHtml]]></category>
		<category><![CDATA[UL]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/?p=1999</guid>
		<description><![CDATA[Ya hace tiempo que veíamos el ejemplo de cómo mostrar una ventana de información en Google Maps. Pero dicho ejemplo nos daba poco juego ya poniendo texto en la ventana de información no llegamos muy lejos. Ahora vamos a ver como poner ventanas de información con imágenes. Bueno, con imágenes y con más cosas. La [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-1999'></div><g:plusone size='medium' href='http://lineadecodigo.com/google/ventanas-de-informacion-con-imagenes-en-google-maps/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fgoogle%2Fventanas-de-informacion-con-imagenes-en-google-maps%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/google/ventanas-de-informacion-con-imagenes-en-google-maps/" data-count="horizontal" data-text="Ventanas de información con imágenes en Google Maps" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p>Ya hace tiempo que veíamos el ejemplo de <a href="http://lineadecodigo.com/google/abrir-una-ventana-de-informacion-en-google-maps/" title="ventana de información en Google Maps">cómo mostrar una ventana de información en Google Maps</a>. Pero dicho ejemplo nos daba poco juego ya poniendo texto en la ventana de información no llegamos muy lejos.</p>
<p>Ahora vamos a ver como poner ventanas de información con imágenes. Bueno, con imágenes y con más cosas. La verdad que lo que hacemos es cargar una ventana de información que nos permita cargar <a href="http://www.manualweb.net/tutorial-html/" title="HTML">HTML</a>. Pero vamos por pasos... lo primero, siempre, crear un área para el mapa y cargar <a href="http://www.manualweb.net/tutorial-google-maps/" title="Google Maps">Google Maps</a>.</p>
<pre class="html4strict" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:HTML"><span style="color: #000000; font-weight: bold;">html</span></a>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:HEAD"><span style="color: #000000; font-weight: bold;">head</span></a>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:TITLE"><span style="color: #000000; font-weight: bold;">title</span></a>&gt;</span>Ventana de información con imagen<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:TITLE"><span style="color: #000000; font-weight: bold;">title</span></a>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:SCRIPT"><span style="color: #000000; font-weight: bold;">script</span></a> <a href="http://w3api.com/wiki/HTML:src"><span style="color: #000066;">src</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://maps.google.com/maps?file=api&amp;amp;v=2.x&amp;amp;key=CLAVE&quot;</span> <a href="http://w3api.com/wiki/HTML:type"><span style="color: #000066;">type</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:SCRIPT"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:SCRIPT"><span style="color: #000000; font-weight: bold;">script</span></a> <a href="http://w3api.com/wiki/HTML:type"><span style="color: #000066;">type</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">//<span style="color: #404040;">&lt;![CDATA[</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #404040;">function load(){</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #404040;">  if (GBrowserIsCompatible()) </span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #404040;">     var map = new GMap2(document.getElementById(&quot;mapa&quot;));    </span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #404040;"> }</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #404040;">//]]&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:SCRIPT"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:HEAD"><span style="color: #000000; font-weight: bold;">head</span></a>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:BODY"><span style="color: #000000; font-weight: bold;">body</span></a> <a href="http://w3api.com/wiki/HTML:onload"><span style="color: #000066;">onload</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;load();&quot;</span> <a href="http://w3api.com/wiki/HTML:onunload"><span style="color: #000066;">onunload</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;GUnload();&quot;</span>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:H1"><span style="color: #000000; font-weight: bold;">h1</span></a>&gt;</span>Ventana de información con imagen<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:H1"><span style="color: #000000; font-weight: bold;">h1</span></a>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a> <a href="http://w3api.com/wiki/HTML:id"><span style="color: #000066;">id</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;mapa&quot;</span> <a href="http://w3api.com/wiki/HTML:style"><span style="color: #000066;">style</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;width: 800px;height: 600px;&quot;</span>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:BODY"><span style="color: #000000; font-weight: bold;">body</span></a>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:HTML"><span style="color: #000000; font-weight: bold;">html</span></a>&gt;</span></div></li></ol></pre>
<p>Los pasos, ya explicados en <a href="http://lineadecodigo.com/google/cargando-google-maps/" title="Cargando Google Maps">Cargando Google Maps</a>, se pueden resumir en:</p>
<ul>
<li>Cargar el script de <a href="http://www.manualweb.net/tutorial-google-maps/" title="Google Maps">Google Maps</a></li>
<li>Definir una capa donde irá el mapa</li>
<li>Cargar el Mapa, vía función <a href="http://w3api.com/wiki/HTML:OnLoad" title="onload">onLoad</a>, en la capa</li>
<li>Indicar la función <a href="http://w3api.com/wiki/Google:GUnload()" title="GUnload()">GUnload</a> en el <a href="http://w3api.com/wiki/HTML:OnUnload" title="onunload">onunload</a> de la página, para liberar memoria</li>
</ul>
<p>Cargar la ventana de información que lleve el <a href="http://www.manualweb.net/tutorial-html/" title="HTML">HTML</a> lo hacemos mediante el método <a href="http://w3api.com/wiki/Google:GMap2.openInfoWindowHtml()" title="openInfoWindowHtml()">.openInfoWindowHtml()</a>. Este método recibe como parámetros la longitud-latitud, representado por una clase <a href="http://w3api.com/wiki/Google:GLatLng" title="GLatLng">GLatLng</a>, en la cual se abrirá la la ventana y el <a href="http://www.manualweb.net/tutorial-html/" title="HTML">HTML</a> que queremos cargar.</p>
<p>Así que incluir la imagen será tan sencillo como poner el siguiente código:</p>
<pre class="javascript" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">map.<span style="color: #660066;">openInfoWindowHtml</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40.381351</span><span style="color: #339933;">,-</span><span style="color: #CC0000;">5.764591</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&lt;h3&gt;Casa Rural Los Tejos&lt;/h1&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&lt;img src='casarural.jpg' style='float:left;margin-right:40px;'&gt; Distribución:</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&lt;ul&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&lt;li&gt;1 Habitación de matrimonio&lt;/li&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&lt;li&gt;2 habitaciones dobles&lt;/li&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&lt;li&gt;2 cuartos de baño completos&lt;/li&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&lt;li&gt;1 aseo&lt;/li&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&lt;li&gt;Cocina&lt;/li&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&lt;li&gt;...&lt;/li&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&lt;/ul&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #3366CC;">&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li></ol></pre>
<p>Vemos que no solo cargamos la imagen mediante la etiqueta <a href="http://w3api.com/wiki/HTML:IMG" title="IMG">IMG</a>, si no que hemos incluido un titular con <a href="http://w3api.com/wiki/HTML:H3" title="H3">H3</a> y una lista de elementos con <a href="http://w3api.com/wiki/HTML:UL" title="UL">UL</a>. El resultado... pues <a href="http://img.aulambra.com/wp-content/uploads/2009/09/ventana-informacion-imagen.html" title="visualizar ejemplo">compruébalo tu mismo</a>. <img src='http://img.aulambra.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/google/abrir-una-ventana-de-informacion-en-google-maps/" rel="bookmark" title="Enero 22, 2008">Abrir una ventana de información en Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/cargando-google-maps/" rel="bookmark" title="Abril 6, 2007">Cargando Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/poner-un-icono-dentro-de-google-maps/" rel="bookmark" title="Junio 21, 2009">Poner un icono dentro de Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/tipos-de-mapas-con-google-maps/" rel="bookmark" title="Enero 13, 2009">Tipos de mapas con Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/comunicando-dos-direcciones-en-google-maps/" rel="bookmark" title="Junio 9, 2007">Comunicando dos direcciones en Google Maps</a></li>
</ul>
<p><!-- Similar Posts took 4.567 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_1999()',1000); }); </script><script type="text/javascript"> function loadGoogle1_1999(){ jQuery(document).ready(function($) { $('.dd-google1-1999').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/google/ventanas-de-informacion-con-imagenes-en-google-maps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Poner un icono dentro de Google Maps</title>
		<link>http://lineadecodigo.com/google/poner-un-icono-dentro-de-google-maps/</link>
		<comments>http://lineadecodigo.com/google/poner-un-icono-dentro-de-google-maps/#comments</comments>
		<pubDate>Sun, 21 Jun 2009 17:03:47 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[addOverlay]]></category>
		<category><![CDATA[GLatLng]]></category>
		<category><![CDATA[GMap2]]></category>
		<category><![CDATA[GMarker]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[GPoint]]></category>
		<category><![CDATA[icono]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/?p=1800</guid>
		<description><![CDATA[Para poner un icono dentro de Google Maps lo que tenemos que hacer es poner una marca. La marca está representada mediante la clase GMarker. Los primeros pasos son los de siempre y que podéis leer detenidamente en Cargando Google Maps. Si bien, resumidamente, consisten en: Cargar Google Maps &#60;script src=&#34;http://maps.google.com/maps?file=api&#38;v=2&#38;key=miclave&#34; type=&#34;text/javascript&#34;&#62;&#60;/script&#62; Definir un área [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-1800'></div><g:plusone size='medium' href='http://lineadecodigo.com/google/poner-un-icono-dentro-de-google-maps/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fgoogle%2Fponer-un-icono-dentro-de-google-maps%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/google/poner-un-icono-dentro-de-google-maps/" data-count="horizontal" data-text="Poner un icono dentro de Google Maps" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p>Para poner un icono dentro de <a href="http://www.manualweb.net/tutorial-google-maps/" title="Google Maps">Google Maps</a> lo que tenemos que hacer es poner una marca. La marca está representada mediante la clase <a href="http://w3api.com/wiki/Google:GMarker" title="GMarker">GMarker</a>.</p>
<p>Los primeros pasos son los de siempre y que podéis leer detenidamente en <a href="http://lineadecodigo.com/google/cargando-google-maps/" title="Cargando Google Maps">Cargando Google Maps</a>. Si bien, resumidamente, consisten en:</p>
<ol>
<li>Cargar Google Maps</li>
<pre class="javascript" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;http://maps.google.com/maps?file=api&amp;v=2&amp;key=miclave&quot;</span> type<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;text/javascript&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span></div></li></ol></pre>
<li>Definir un área para el mapa</li>
<pre class="javascript" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;mapa&quot;</span> style<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;width: 400px; height: 300px;&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></div></li></ol></pre>
<li>Instanciar el mapa</li>
<pre class="javascript" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>GBrowserIsCompatible<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  map <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GMap<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;mapa&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  map.<span style="color: #660066;">setCenter</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40.655997</span><span style="color: #339933;">,-</span><span style="color: #CC0000;">4.700518</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">15</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #009900;">&#125;</span></div></li></ol></pre>
</ol>
<p>Lo siguiente que pasaremos a realizar será la carga del icono dentro de <a href="http://www.manualweb.net/tutorial-google-maps/" title="Google Maps">Google Maps</a>. Para ello creamos una instancia de la clase <a href="http://w3api.com/wiki/Google:GMarker" title="GMarker">GMarker</a>.</p>
<pre class="javascript" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #003366; font-weight: bold;">var</span> marker <span style="color: #339933;">=</span>   <span style="color: #003366; font-weight: bold;">new</span> GMarker<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40.655997</span><span style="color: #339933;">,-</span><span style="color: #CC0000;">4.700518</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre>
<p>La clase GMarker recibe como parámetro un punto: ya sea relativo al mapa (<a href="http://w3api.com/wiki/Google:GPoint" title="GPoint">GPoint</a>) o una Latitud-Longitud (<a href="http://w3api.com/wiki/Google:GLatLng" title="GLatLng">GlatLng</a>). En nuestro caso nos hemos decantado por la segunda opción y hemos pasado como parámetro de la clase <a href="http://w3api.com/wiki/Google:GMarker" title="GMarker">GMarker</a> una clase <a href="http://w3api.com/wiki/Google:GLatLng" title="GLatLng">GlatLng</a>.</p>
<p>Una vez creada la marca tendremos que insertarla dentro del mapa. Para ello utilizamos el método <a href="http://w3api.com/wiki/Google:GMap2.addOverlay()" title=".addOverlay()">.addOverlay()</a> de la clase <a href="http://w3api.com/wiki/Google:GMap2" title="GMap2">GMap2</a>. Finalmente nos quedan dos líneas de código muy sencillas, las cuales nos permiten poner un icono dentro de <a href="http://www.manualweb.net/tutorial-google-maps/" title="Google Maps">Google Maps</a>.</p>
<pre class="javascript" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #003366; font-weight: bold;">var</span> marker <span style="color: #339933;">=</span>   <span style="color: #003366; font-weight: bold;">new</span> GMarker<span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40.655997</span><span style="color: #339933;">,-</span><span style="color: #CC0000;">4.700518</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">map.<span style="color: #660066;">addOverlay</span><span style="color: #009900;">&#40;</span>marker<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/google/incluir-imagenes-en-google-maps/" rel="bookmark" title="Junio 6, 2007">Incluir imagenes en Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/anadir-control-de-trafico-con-google-maps/" rel="bookmark" title="Enero 18, 2009">Añadir control de trafico con Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/tipos-de-mapas-con-google-maps/" rel="bookmark" title="Enero 13, 2009">Tipos de mapas con Google Maps</a></li>
<li><a href="http://lineadecodigo.com/javascript/anadiendo-controles-a-google-maps/" rel="bookmark" title="Abril 7, 2007">Añadiendo controles a Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/modificar-longitud-y-latitud-en-google-maps/" rel="bookmark" title="Enero 17, 2009">Modificar longitud y latitud en Google Maps</a></li>
</ul>
<p><!-- Similar Posts took 5.134 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_1800()',1000); }); </script><script type="text/javascript"> function loadGoogle1_1800(){ jQuery(document).ready(function($) { $('.dd-google1-1800').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/google/poner-un-icono-dentro-de-google-maps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Añadir control de trafico con Google Maps</title>
		<link>http://lineadecodigo.com/google/anadir-control-de-trafico-con-google-maps/</link>
		<comments>http://lineadecodigo.com/google/anadir-control-de-trafico-con-google-maps/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 14:00:18 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[addOverlay]]></category>
		<category><![CDATA[GBrowserIsCompatible]]></category>
		<category><![CDATA[GMap2]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[GTrafficOverlay]]></category>
		<category><![CDATA[Mashup]]></category>
		<category><![CDATA[setCenter]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/?p=866</guid>
		<description><![CDATA[Una de las cosas que nos ofrece Gogle Maps es información del tráfico de ciertas ciudades, indicando qué vias son más lentas y cuales más rápidas. Para ello utiliza el típico código de colores verde a rojo. A parte de esto ofrece otras carácterísticas como puntos en los cuales hay accidentes, conocer el tráfico en [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-866'></div><g:plusone size='medium' href='http://lineadecodigo.com/google/anadir-control-de-trafico-con-google-maps/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fgoogle%2Fanadir-control-de-trafico-con-google-maps%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/google/anadir-control-de-trafico-con-google-maps/" data-count="horizontal" data-text="Añadir control de trafico con Google Maps" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p>Una de las cosas que nos ofrece <a href="http://www.manualweb.net/tutorial-google-maps/" title="Google Maps">Gogle Maps</a> es información del tráfico de ciertas ciudades, indicando qué vias son más lentas y cuales más rápidas. Para ello utiliza el típico código de colores verde a rojo.</p>
<p>A parte de esto ofrece otras carácterísticas como puntos en los cuales hay accidentes, conocer el tráfico en un día y hora en concreto. Si bien, estas dos carácterísticas no están accesibles vía API (de momento) de <a href="http://www.manualweb.net/tutorial-google-maps/" title="Google Maps">Gogle Maps</a>.</p>
<p>Añadir el tráfico a nuestro mapa será tan sencillo como superponer una capa al mapa. La capa que refleja el tráfico es <a href="http://www.w3api.com/wiki/Google:GTrafficOverlay" title="GTrafficOverlay">GTrafficOverlay</a>. Su creación será de la siguiente forma:</p>
<pre class="javascript" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #003366; font-weight: bold;">new</span> GTrafficOverlay<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre>
<p>Para añadir capas al mapa tenemos el método <a href="http://www.w3api.com/wiki/Google:GMap2.addOverlay()" title="addOverlay()">addOverlay()</a> sobre la clase <a href="http://www.w3api.com/wiki/Google:GMap2" title="GMap2">GMap2</a>. Por lo cual añadir la capa de tráfico quedará de la siguiente forma:</p>
<pre class="javascript" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">map.<span style="color: #660066;">addOverlay</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GTrafficOverlay<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li></ol></pre>
<p>Solo nos habrá quedado cargar inicialmente el mapa y posicionarlo en una ciudad de la cual <a href="http://www.google.com" title="Google">Google</a> nos pueda dar información de tráfico. En nuestro caso hemos elegido <a href="http://maps.google.com/maps?f=q&source=s_q&hl=es&geocode=&q=seattle&sll=37.0625,-95.677068&sspn=33.710275,79.101563&ie=UTF8&ll=47.636709,-122.167969&spn=0.447876,1.235962&z=10&iwloc=addr&layer=t" title="Seattle">Seattle</a>.</p>
<pre class="javascript" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>GBrowserIsCompatible<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> <span style="color: #003366; font-weight: bold;">var</span> map <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GMap2<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;mapa&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> map.<span style="color: #660066;">setCenter</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">47.645962</span><span style="color: #339933;">,-</span><span style="color: #CC0000;">122.236633</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">10</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"> map.<span style="color: #660066;">addOverlay</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GTrafficOverlay<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#125;</span></div></li></ol></pre>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/google/poner-un-icono-dentro-de-google-maps/" rel="bookmark" title="Junio 21, 2009">Poner un icono dentro de Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/abrir-una-ventana-de-informacion-en-google-maps/" rel="bookmark" title="Enero 22, 2008">Abrir una ventana de información en Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/poner-control-de-escala-con-google-maps/" rel="bookmark" title="Abril 11, 2007">Poner control de escala con Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/tipos-de-mapas-con-google-maps/" rel="bookmark" title="Enero 13, 2009">Tipos de mapas con Google Maps</a></li>
<li><a href="http://lineadecodigo.com/javascript/anadiendo-controles-a-google-maps/" rel="bookmark" title="Abril 7, 2007">Añadiendo controles a Google Maps</a></li>
</ul>
<p><!-- Similar Posts took 8.706 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_866()',1000); }); </script><script type="text/javascript"> function loadGoogle1_866(){ jQuery(document).ready(function($) { $('.dd-google1-866').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/google/anadir-control-de-trafico-con-google-maps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modificar longitud y latitud en Google Maps</title>
		<link>http://lineadecodigo.com/google/modificar-longitud-y-latitud-en-google-maps/</link>
		<comments>http://lineadecodigo.com/google/modificar-longitud-y-latitud-en-google-maps/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 23:00:25 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[GLatLng]]></category>
		<category><![CDATA[GMap2]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[GUnload]]></category>
		<category><![CDATA[latitud]]></category>
		<category><![CDATA[longitud]]></category>
		<category><![CDATA[panTo]]></category>
		<category><![CDATA[setCenter]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/?p=1417</guid>
		<description><![CDATA[Las posiciones dentro de Google Maps se indican mediante una longitud y una latitud. Concretamente Google Mapss nos ofrece la clase GLatLng, la cual pasándola como parámetro la latitud y la longitud nos devolverá un punto en concreto. En este ejemplo vamos a crear un formulario que nos permita introduccir latitudes y longitudes que actualicen [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-1417'></div><g:plusone size='medium' href='http://lineadecodigo.com/google/modificar-longitud-y-latitud-en-google-maps/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fgoogle%2Fmodificar-longitud-y-latitud-en-google-maps%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/google/modificar-longitud-y-latitud-en-google-maps/" data-count="horizontal" data-text="Modificar longitud y latitud en Google Maps" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p>Las posiciones dentro de <a href="http://www.manualweb.net/tutorial-google-maps/" title="Manual Google Maps">Google Maps</a> se indican mediante una longitud y una latitud. Concretamente <a href="http://www.manualweb.net/tutorial-google-maps/" title="Manual Google Maps">Google Maps</a>s nos ofrece la clase <a href="http://www.w3api.com/wiki/Google:GLatLng" title="GLatLng">GLatLng</a>, la cual pasándola como parámetro la latitud y la longitud nos devolverá un punto en concreto.</p>
<p>En este ejemplo vamos a crear un formulario que nos permita introduccir latitudes y longitudes que actualicen el centro del mapa cargado en pantalla.</p>
<p>Lo primero será cargar el mapa de <a href="http://www.manualweb.net/tutorial-google-maps/" title="Manual Google Maps">Google Maps</a>. Para ello utilizamos la función load() estándar:</p>
<pre class="html4strict" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:SCRIPT"><span style="color: #000000; font-weight: bold;">script</span></a> <a href="http://w3api.com/wiki/HTML:type"><span style="color: #000066;">type</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">var map;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">function load(){</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  if (GBrowserIsCompatible()) {</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    map = new GMap2(document.getElementById(&quot;mapa&quot;));</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    map.setCenter(new GLatLng(40.655997,-4.700518), 15);</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">  }</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">}</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:SCRIPT"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span></div></li></ol></pre>
<p>Hay que destacar que en este caso la variable que instancia el objeto <a href="http://www.w3api.com/wiki/Google:GMap2" title="GMap2">GMap2</a>, y por consiguiente el mapa, la declaramos fuera de la función, como una variable global. Esto lo hacemos ya que a posteriorío vamos a crear otras funciones que interactuen con el mapa.</p>
<p>En el cuerpo de la página, en el evento <a href="http://www.w3api.com/wiki/HTML:OnLoad" title="onLoad">onLoad</a> cargamos esta función y por cuestiones de optimización llamamos a <a href="http://www.w3api.com/wiki/Google:GUnload()" title="GUnload">GUnload</a> en el evento <a href="http://www.w3api.com/wiki/HTML:OnUnload" title="onUnload">onUnload</a>.</p>
<pre class="html4strict" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:BODY"><span style="color: #000000; font-weight: bold;">body</span></a> <a href="http://w3api.com/wiki/HTML:onload"><span style="color: #000066;">onload</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;load();&quot;</span> <a href="http://w3api.com/wiki/HTML:onunload"><span style="color: #000066;">onunload</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;GUnload();&quot;</span>&gt;</span></div></li></ol></pre>
<p>Una vez cargado el mapa creamos el formulario. Esto es una tarea sencilla, ya que serán dos campos input de tipo text donde introduzcamos la latitud y la longitud. Al formulario le vamos a añadir dos botones. Uno que desplace el mapa a la latitud y longitud introducida por el usuario y el segundo que nos devuelva el mapa a la posición inicial.</p>
<pre class="html4strict" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:FORM"><span style="color: #000000; font-weight: bold;">form</span></a>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LABEL"><span style="color: #000000; font-weight: bold;">label</span></a> <a href="http://w3api.com/wiki/HTML:for"><span style="color: #000066;">for</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;latitud&quot;</span>&gt;</span>Latitud: <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LABEL"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:INPUT"><span style="color: #000000; font-weight: bold;">input</span></a> <a href="http://w3api.com/wiki/HTML:type"><span style="color: #000066;">type</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <a href="http://w3api.com/wiki/HTML:id"><span style="color: #000066;">id</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;latitud&quot;</span> <a href="http://w3api.com/wiki/HTML:value"><span style="color: #000066;">value</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;40.655997&quot;</span>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:LABEL"><span style="color: #000000; font-weight: bold;">label</span></a> <a href="http://w3api.com/wiki/HTML:for"><span style="color: #000066;">for</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;longitud&quot;</span>&gt;</span>Longitud: <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:LABEL"><span style="color: #000000; font-weight: bold;">label</span></a>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:INPUT"><span style="color: #000000; font-weight: bold;">input</span></a> <a href="http://w3api.com/wiki/HTML:type"><span style="color: #000066;">type</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> <a href="http://w3api.com/wiki/HTML:id"><span style="color: #000066;">id</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;longitud&quot;</span> <a href="http://w3api.com/wiki/HTML:value"><span style="color: #000066;">value</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;-4.700518&quot;</span>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:INPUT"><span style="color: #000000; font-weight: bold;">input</span></a> <a href="http://w3api.com/wiki/HTML:type"><span style="color: #000066;">type</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <a href="http://w3api.com/wiki/HTML:value"><span style="color: #000066;">value</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Cambiar&quot;</span> <a href="http://w3api.com/wiki/HTML:onclick"><span style="color: #000066;">onClick</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cambiar(document.getElementById('latitud').value, document.getElementById('longitud').value);&quot;</span><span style="color: #66cc66;">/</span>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:INPUT"><span style="color: #000000; font-weight: bold;">input</span></a> <a href="http://w3api.com/wiki/HTML:type"><span style="color: #000066;">type</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;button&quot;</span> <a href="http://w3api.com/wiki/HTML:value"><span style="color: #000066;">value</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Punto de Origen&quot;</span> <a href="http://w3api.com/wiki/HTML:onclick"><span style="color: #000066;">onClick</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;cambiar(40.655997,-4.700518);&quot;</span><span style="color: #66cc66;">/</span>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:FORM"><span style="color: #000000; font-weight: bold;">form</span></a>&gt;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li></ol></pre>
<p>Vemos que ambos botones en el evento <a href="http://www.w3api.com/wiki/HTML:Onclick" title="onClick">onClick</a> están llamando a la función cambiar, la cual recibe dos parámetros longitud y latitud.</p>
<p>Ahora pasamos a codificar dicha función. Para mover el mapa a una latitud y longitud en concreto deberemos de utilizar el método .panTo, el cual recibe una clase <a href="http://www.w3api.com/wiki/Google:GLatLng" title="GLatLng">GLatLng</a>. La clase <a href="http://www.w3api.com/wiki/Google:GLatLng" title="GLatLng">GLatLng</a> es muy sencilla de instanciar, ya que solo hará falta indicarle la latitud y longitud.</p>
<p>El código de la función nos quedaría de la siguiente forma:</p>
<pre class="javascript" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #003366; font-weight: bold;">function</span> cambiar<span style="color: #009900;">&#40;</span>latitud<span style="color: #339933;">,</span>longitud<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">	map.<span style="color: #660066;">panTo</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span>latitud<span style="color: #339933;">,</span>longitud<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&#125;</span></div></li></ol></pre>
<p>Vemos que el método .panTo lo ejecutamos sobre la variable global map que es la que instancia el objeto <a href="http://www.w3api.com/wiki/Google:GMap2" title="GMap2">GMap2</a>.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/google/poner-un-icono-dentro-de-google-maps/" rel="bookmark" title="Junio 21, 2009">Poner un icono dentro de Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/cargando-google-maps/" rel="bookmark" title="Abril 6, 2007">Cargando Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/abrir-una-ventana-de-informacion-en-google-maps/" rel="bookmark" title="Enero 22, 2008">Abrir una ventana de información en Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/tipos-de-mapas-con-google-maps/" rel="bookmark" title="Enero 13, 2009">Tipos de mapas con Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/incluir-imagenes-en-google-maps/" rel="bookmark" title="Junio 6, 2007">Incluir imagenes en Google Maps</a></li>
</ul>
<p><!-- Similar Posts took 7.037 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_1417()',1000); }); </script><script type="text/javascript"> function loadGoogle1_1417(){ jQuery(document).ready(function($) { $('.dd-google1-1417').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/google/modificar-longitud-y-latitud-en-google-maps/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Tipos de mapas con Google Maps</title>
		<link>http://lineadecodigo.com/google/tipos-de-mapas-con-google-maps/</link>
		<comments>http://lineadecodigo.com/google/tipos-de-mapas-con-google-maps/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 07:00:33 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[GLatLng]]></category>
		<category><![CDATA[GMap2]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[G_DEFAULT_MAP_TYPES]]></category>
		<category><![CDATA[G_HYBRID_MAP]]></category>
		<category><![CDATA[G_NORMAL_MAP]]></category>
		<category><![CDATA[G_SATELLITE_MAP]]></category>
		<category><![CDATA[setCenter]]></category>
		<category><![CDATA[setMapType]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/?p=1365</guid>
		<description><![CDATA[Cuando cargamos un mapa con Google Maps, este, por defecto, se carga en su vista de mapa predeterminada. Esta vista es la del formato callejero. Puede suceder que queramos cambiar el tipo de mapa que estamos mostrando. Los tipos de mapas que nos ofrece Google Maps son: Mapa Callejero - G_NORMAL_MAP Mapa Satélite - G_SATELLITE_MAP [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-1365'></div><g:plusone size='medium' href='http://lineadecodigo.com/google/tipos-de-mapas-con-google-maps/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fgoogle%2Ftipos-de-mapas-con-google-maps%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/google/tipos-de-mapas-con-google-maps/" data-count="horizontal" data-text="Tipos de mapas con Google Maps" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p>Cuando <a href="http://lineadecodigo.com/2007/04/06/cargando-google-maps/" title="Cargar Mapa con Google Maps">cargamos un mapa con Google Maps</a>, este, por defecto, se carga en su vista de mapa predeterminada. Esta vista es la del formato callejero.</p>
<p>Puede suceder que queramos cambiar el tipo de mapa que estamos mostrando. Los tipos de mapas que nos ofrece <a href="http://www.manualweb.net/tutorial-google-maps/" title="Google Maps">Google Maps</a> son:</p>
<ul>
<li>Mapa Callejero - G_NORMAL_MAP</li>
<li>Mapa Satélite - G_SATELLITE_MAP</li>
<li>Mapa Híbrido - G_HYBRID_MAP</li>
<li>Mapa mezcla de los tres anteriores - G_DEFAULT_MAP_TYPES</li>
</ul>
<p>Nos apoyaremos en el método <a href="http://www.w3api.com/wiki/Google:GMap2.setMapType()" title="setMapType">setMapType</a> de la clase <a href="http://www.w3api.com/wiki/Google:GMap2" title="GMap2">GMap2</a> para cambiar la visualización del mapa. Así, si queremos poner el mapa en formato satélite tendremos las siguientes líneas:</p>
<pre class="javascript" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #003366; font-weight: bold;">var</span> map <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GMap2<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;mapa&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">map.<span style="color: #660066;">setCenter</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40.655997</span><span style="color: #339933;">,-</span><span style="color: #CC0000;">4.700518</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">15</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">map.<span style="color: #660066;">setMapType</span><span style="color: #009900;">&#40;</span>G_SATELLITE_MAP<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li></ol></pre>
<p><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/javascript/anadiendo-controles-a-google-maps/" rel="bookmark" title="Abril 7, 2007">Añadiendo controles a Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/poner-un-icono-dentro-de-google-maps/" rel="bookmark" title="Junio 21, 2009">Poner un icono dentro de Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/cargando-google-maps/" rel="bookmark" title="Abril 6, 2007">Cargando Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/modificar-longitud-y-latitud-en-google-maps/" rel="bookmark" title="Enero 17, 2009">Modificar longitud y latitud en Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/poner-control-de-escala-con-google-maps/" rel="bookmark" title="Abril 11, 2007">Poner control de escala con Google Maps</a></li>
</ul>
<p><!-- Similar Posts took 7.816 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_1365()',1000); }); </script><script type="text/javascript"> function loadGoogle1_1365(){ jQuery(document).ready(function($) { $('.dd-google1-1365').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/google/tipos-de-mapas-con-google-maps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Abrir una ventana de información en Google Maps</title>
		<link>http://lineadecodigo.com/google/abrir-una-ventana-de-informacion-en-google-maps/</link>
		<comments>http://lineadecodigo.com/google/abrir-una-ventana-de-informacion-en-google-maps/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 22:45:52 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[document.createTextNode]]></category>
		<category><![CDATA[getElementById]]></category>
		<category><![CDATA[GLatLng]]></category>
		<category><![CDATA[GMap2]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[GPoint]]></category>
		<category><![CDATA[openInfoWindow]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/2008/01/22/abrir-una-ventana-de-informacion-en-google-maps/</guid>
		<description><![CDATA[Una de las cosas que podemos hacer sobre los mapas de Google Maps es abrir una ventana de información. Esta nos servirá para dar información adicional sobre el punto localizado. Para ello el propio objeto GMap2 nos ofrece un método llamado openInfoWindow. Lo primero que tenemos que hacer es cargar el API de Google Maps. [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-1144'></div><g:plusone size='medium' href='http://lineadecodigo.com/google/abrir-una-ventana-de-informacion-en-google-maps/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fgoogle%2Fabrir-una-ventana-de-informacion-en-google-maps%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/google/abrir-una-ventana-de-informacion-en-google-maps/" data-count="horizontal" data-text="Abrir una ventana de información en Google Maps" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p>Una de las cosas que podemos hacer sobre los mapas de Google Maps es abrir una ventana de información. Esta nos servirá para dar información adicional sobre el punto localizado.</p>
<p>Para ello el propio objeto GMap2 nos ofrece un método llamado openInfoWindow. Lo primero que tenemos que hacer es cargar el API de Google Maps. Para ello utilizamos el siguiente código JavaScript:</p>
<p><span id="more-1144"></span>
<pre class="html4strict" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:SCRIPT"><span style="color: #000000; font-weight: bold;">script</span></a> <a href="http://w3api.com/wiki/HTML:src"><span style="color: #000066;">src</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://maps.google.com/maps? file=api&amp;amp;v=2.x&amp;amp;key=CLAVE&quot;</span> <a href="http://w3api.com/wiki/HTML:type"><span style="color: #000066;">type</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:SCRIPT"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span></div></li></ol></pre>
<p>Tendremos que sustituir la palabra clave por la clave que nos proporcione Google.</p>
<p>Lo siguiente será empezar cargando el mapa. Para ello utilizamos el objeto GMap2. Este objeto necesita el elemento HTML donde se cargará el mapa. Normalmente en una capa.</p>
<pre class="javascript" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #003366; font-weight: bold;">var</span> map <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GMap2<span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;mapa&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li></ol></pre>
<p>El elemento de nuestra página web, la capa, se tiene que llamar "mapa".</p>
<p>Ahora empezamos utilizando el método openInfoWindow. Este método recibe tres parámetros:</p>
<ul>
<li><strong>punto</strong>, representa el punto del mapa donde se abrirá la ventana. Este punto lo podemos abrir mediante un punto relativo al mapa GPoint o mediante un punto geográfico GLatLng.</li>
<li><strong>nodo</strong>, representa el nodo DOM que se abrirá en la ventana de información.</li>
<li><strong>opciones</strong>, opciones adicionales para la ventana de información</li>
</ul>
<p>En el caso de crear un objeto GLatLang, los parámetros que se le pasaran será la longitud y latitud.</p>
<pre class="javascript" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #003366; font-weight: bold;">var</span> punto <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40.381351</span><span style="color: #339933;">,-</span><span style="color: #CC0000;">5.764591</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li></ol></pre>
<p>Para el nodo vamos a crear un objeto de texto. En este caso nos apoyamos en el método document.createTextNode, el cual crea un simple elemento de texto.</p>
<pre class="javascript" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">document.<span style="color: #660066;">createTextNode</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Casa Rural Los Tejos&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li></ol></pre>
<p>El código quedará finalmente de la siguiente forma:</p>
<pre class="javascript" style="font-family:monospace;"><ol><li style="font-weight: normal; vertical-align:top;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">map.<span style="color: #660066;">openInfoWindow</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">new</span> GLatLng<span style="color: #009900;">&#40;</span><span style="color: #CC0000;">40.381351</span><span style="color: #339933;">,-</span><span style="color: #CC0000;">5.764591</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> document.<span style="color: #660066;">createTextNode</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Casa Rural Los Tejos&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></li></ol></pre>
<p><a href='http://img.aulambra.com/wp-content/uploads/2008/01/ventana-de-informacion.html' title='Abrir una ventana de información en Google Maps'>Visualizar el ejemplo</a> | <a href='http://img.aulambra.com/wp-content/uploads/2008/01/ventana-de-informacion.zip' title='Descargar Abrir una ventana de información en Google Maps'>Descargar el código</a><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/google/poner-un-icono-dentro-de-google-maps/" rel="bookmark" title="Junio 21, 2009">Poner un icono dentro de Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/tipos-de-mapas-con-google-maps/" rel="bookmark" title="Enero 13, 2009">Tipos de mapas con Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/modificar-longitud-y-latitud-en-google-maps/" rel="bookmark" title="Enero 17, 2009">Modificar longitud y latitud en Google Maps</a></li>
<li><a href="http://lineadecodigo.com/javascript/anadiendo-controles-a-google-maps/" rel="bookmark" title="Abril 7, 2007">Añadiendo controles a Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/cargando-google-maps/" rel="bookmark" title="Abril 6, 2007">Cargando Google Maps</a></li>
</ul>
<p><!-- Similar Posts took 6.703 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_1144()',1000); }); </script><script type="text/javascript"> function loadGoogle1_1144(){ jQuery(document).ready(function($) { $('.dd-google1-1144').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/google/abrir-una-ventana-de-informacion-en-google-maps/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Generando lineas geodésicas en Google Maps</title>
		<link>http://lineadecodigo.com/google/generando-lineas-geodesicas-en-google-maps/</link>
		<comments>http://lineadecodigo.com/google/generando-lineas-geodesicas-en-google-maps/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 07:00:33 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[GLatLng]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[GPolyline]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/2007/12/12/generando-lineas-geodesicas-en-google-maps/</guid>
		<description><![CDATA[Una línea de geodésica es la línea de menor longitud entre dos puntos dados. Podríamos hablar de la distancia menor entre dos puntos terrestres. Y es que si vemos un mapa del mundo aplanado, la distancia más corta entre dos puntos no es una linea recta, sino que será la línea geodésica. En el artículo [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-1051'></div><g:plusone size='medium' href='http://lineadecodigo.com/google/generando-lineas-geodesicas-en-google-maps/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fgoogle%2Fgenerando-lineas-geodesicas-en-google-maps%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/google/generando-lineas-geodesicas-en-google-maps/" data-count="horizontal" data-text="Generando lineas geodésicas en Google Maps" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p>Una línea de geodésica es la línea de menor longitud entre dos puntos dados. Podríamos hablar de la distancia menor entre dos puntos terrestres.</p>
<p>Y es que si vemos un mapa del mundo aplanado, la distancia más corta entre dos puntos no es una linea recta, sino que será la línea geodésica.</p>
<p>En el <a href="http://programa-con-google.blogspot.com/2007/12/lneas-geodsicas-con-el-api-de-google.html" title="Articulo Base">artículo base</a> de este original, el autor habla de un viaje Londres-San Francisco, en el cual la ruta que se sigue no es la línea recta que atravesaría todo Estados Unidos, sino que el avión sube hasta Groelandia y entra por la frontera de Canada, siguiendo la línea geodésica.</p>
<p><span id="more-1051"></span>Si alguna vez voláis desde Europa a la costa oeste de los Estados Unidos (San Francisco, Seattle,...) podréis comprobar esta ruta y si tenéis suerte, disfrutar de unos bellos paisajes. Pero volvamos al código, que nos desviamos.</p>
<p><a href="http://lineadecodigo.com/tag/Google/Google-Maps/" title="Google Maps">Google Maps</a>, nos permite el trazar una línea geodésica entre dos puntos dados. Para ello nos apoyaremos en la clase GPolyline. La misma que nos sirve para crear un polígono definiendo sus vertices mediante longitudes-latitudes.</p>
<p>La estructura general de GPolyline es la siguiente:</p>
<pre>GPolyline(latlngs,  color?,  weight?,  opacity?,  opts?)</pre>
<p>Los parámetros son los siguientes:</p>
<ul>
<li><strong>latlngs</strong>, es un array de longitudes-latitudes. Las cuales representamos ayudándonos de la clase GLatLng.</li>
<li><strong>color?</strong>, es el color de la línea que dibujará el polígono. La interrogación demarca su opcionalidad.</li>
<li><strong>weight?</strong>, el ancho de la línea en pixeles.</li>
<li><strong>opacity?</strong>, opacidad de la línea. Que se indicara con un valor entre 0 y 1.</li>
<li><strong>opts?</strong>, las opciones del polígono. Para nuestro ejemplo el campo más importante.</li>
</ul>
<p>Decimos que el parámetro opts es el más importante, ya que dentro de las opciones que se le pueden pasar a la clase GPolyline, una de ellas es geodesic. Esta propiedad indicará si la línea a pintar es una línea geodésica, valor true o línea normal, valor false.</p>
<p>A si que lo primero definimos esta propiedad.</p>
<pre>var lineageodesica={geodesic:true};
var linearecta={geodesic:false};</pre>
<p>Ahora inicializamos la clase GPolyline:</p>
<pre>var geodesica = new GPolyline([
      new GLatLng(51.5002, -0.1262),  // Londres
      new GLatLng(47.6801, -122.3300)  // Seattle
], "#ff0000", 5, 0.7, lineageodesica);</pre>
<p>Y solo nos quedará añadirla al mapa que hayamos cargado:</p>
<pre>map.addOverlay(geodesica);</pre>
<p>Ya tendremos cargada la línea geodésica en el mapa.</p>
<p>Una cosa interesante es que la clase GPolyline, nos devuelve la distancia entre los dos puntos con el método .getLength(). Así podremos saber la distancia entre los dos puntos marcados.</p>
<p><a href="http://img.aulambra.com/wp-content/uploads/2007/12/linea-geodesica.html" title="Visualizar el ejemplo">Visualizar el ejemplo</a> | <a href="http://img.aulambra.com/wp-content/uploads/2007/12/linea-geodesica.zip" title="Descargar el codigo">Descargar el código</a></p>
<p>Vía: <a href="http://programa-con-google.blogspot.com/2007/12/lneas-geodsicas-con-el-api-de-google.html" title="Programa con Google">Programa con Google</a>.<strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/google/modificar-longitud-y-latitud-en-google-maps/" rel="bookmark" title="Enero 17, 2009">Modificar longitud y latitud en Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/poner-un-icono-dentro-de-google-maps/" rel="bookmark" title="Junio 21, 2009">Poner un icono dentro de Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/tipos-de-mapas-con-google-maps/" rel="bookmark" title="Enero 13, 2009">Tipos de mapas con Google Maps</a></li>
<li><a href="http://lineadecodigo.com/svg/dibujando-multiples-lineas-en-svg/" rel="bookmark" title="Diciembre 23, 2006">Dibujando multiples lineas en SVG</a></li>
<li><a href="http://lineadecodigo.com/javascript/anadiendo-controles-a-google-maps/" rel="bookmark" title="Abril 7, 2007">Añadiendo controles a Google Maps</a></li>
</ul>
<p><!-- Similar Posts took 9.063 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_1051()',1000); }); </script><script type="text/javascript"> function loadGoogle1_1051(){ jQuery(document).ready(function($) { $('.dd-google1-1051').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/google/generando-lineas-geodesicas-en-google-maps/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Mi primera gráfica Google Chart</title>
		<link>http://lineadecodigo.com/google/mi-primera-grafica-google-chart/</link>
		<comments>http://lineadecodigo.com/google/mi-primera-grafica-google-chart/#comments</comments>
		<pubDate>Sat, 08 Dec 2007 21:30:33 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Chart]]></category>
		<category><![CDATA[grafico]]></category>
		<category><![CDATA[PNG]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/2007/12/08/mi-primera-grafica-google-chart/</guid>
		<description><![CDATA[Google nos ofrece un servicio para poder generar gráficas en tiempo real llamado Google Chart, el cual podemos utilizar en nuestras páginas web. Su funcionamiento es muy sencillo, ya que simplemente tendremos que hacer invocaciones al servidor de Google Chart, para que este, mediante una petición GET nos componga las gráficas en tiempo real. De [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-1030'></div><g:plusone size='medium' href='http://lineadecodigo.com/google/mi-primera-grafica-google-chart/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fgoogle%2Fmi-primera-grafica-google-chart%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/google/mi-primera-grafica-google-chart/" data-count="horizontal" data-text="Mi primera gráfica Google Chart" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p><a href="http://www.ayudaenlaweb.com/buscadores/que-es-google/" title="Qué es Google">Google</a> nos ofrece un servicio para poder generar gráficas en tiempo real llamado <a href="http://www.manualweb.net/tutorial-google-chart/" title="Tutorial sobre Google Chart">Google Chart</a>, el cual podemos utilizar en nuestras páginas web.</p>
<p>Su funcionamiento es muy sencillo, ya que simplemente tendremos que hacer invocaciones al servidor de <a href="http://www.manualweb.net/tutorial-google-chart/" title="Tutorial sobre Google Chart">Google Chart</a>, para que este, mediante una petición GET nos componga las gráficas en tiempo real.</p>
<p>De esta forma bastará con insertar una URL en la barra de navegación para ver el resultado:</p>
<pre>http://chart.apis.google.com/chart?
            cht=p3&chd=s:hW&chs=250x100&chl=Hello|World</pre>
<p>En el caso que queramos añadirlo a nuestra página web, podemos utilizar la etiqueta <a href="http://www.manualweb.net/tutorial-html/" title="Manual de HTML">HTML</a> IMG, y en el atributo src indicar la URL.</p>
<pre>&lt;img src="http://chart.apis.google.com/chart?
      cht=p3&chd=s:hW&chs=250x100&chl=Hello|World" alt="Mi primera grafica"&gt;</pre>
<p>Esto funciona ya que el resultado de la petición GET es una imagen PNG.</p>
<p align="middle"><img id="image1031" src="http://img.aulambra.com/wp-content/uploads/2007/12/grafico_google_chart.jpg" alt="Grafico Google Charts"/></p>
<p>Hay que tener en cuenta que hay un límite de 50.000 peticiones diarias. Es por ello que si queremos usarlo de forma masiva, sería bueno el realizar algún tipo de cache de las imágenes.</p>
<p>Vía: <a href="http://www.tufuncion.com/graficas-php" title="TuFuncion">TuFunción</a></p>
<p><a href="http://img.aulambra.com/wp-content/uploads/2007/12/mi-primera-grafica-google-chart.html" title="Visualizar el ejemplo">Visualizar el ejemplo</a> | <a href="http://img.aulambra.com/wp-content/uploads/2007/12/mi-primera-grafica-google-chart.zip" title="Descargar el código">Descargar el código</a><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/google/cargando-google-maps/" rel="bookmark" title="Abril 6, 2007">Cargando Google Maps</a></li>
<li><a href="http://lineadecodigo.com/jquery/peticiones-ajax-con-jquery/" rel="bookmark" title="Enero 6, 2010">Peticiones AJAX con jQuery</a></li>
<li><a href="http://lineadecodigo.com/download/descargas-octubre-09/" rel="bookmark" title="Octubre 1, 2009">Descargas Octubre.09</a></li>
<li><a href="http://lineadecodigo.com/eventos/soa-world-2007/" rel="bookmark" title="Noviembre 2, 2007">SOA World 2007</a></li>
<li><a href="http://lineadecodigo.com/java/reenviar-peticion-a-otro-servlet/" rel="bookmark" title="Noviembre 8, 2006">Reenviar petición a otro Servlet</a></li>
</ul>
<p><!-- Similar Posts took 6.628 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_1030()',1000); }); </script><script type="text/javascript"> function loadGoogle1_1030(){ jQuery(document).ready(function($) { $('.dd-google1-1030').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/google/mi-primera-grafica-google-chart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comunicando dos direcciones en Google Maps</title>
		<link>http://lineadecodigo.com/google/comunicando-dos-direcciones-en-google-maps/</link>
		<comments>http://lineadecodigo.com/google/comunicando-dos-direcciones-en-google-maps/#comments</comments>
		<pubDate>Sat, 09 Jun 2007 20:16:54 +0000</pubDate>
		<dc:creator>Víctor Cuervo</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[GDirections]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[load]]></category>

		<guid isPermaLink="false">http://lineadecodigo.com/2007/06/09/comunicando-dos-direcciones-en-google-maps/</guid>
		<description><![CDATA[Hace unos días podíamos leer en aNieto2K y Tu Función que Google Maps había ampliado su API con Directions. Directions nos permite mostrar la ruta que hay dentro de un mapa entre dos puntos. Con Google Maps se suele utilizar una capa para posicionar el mapa. Con Directions, además del mapa, tendremos una segunda capa [...]]]></description>
			<content:encoded><![CDATA[<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><div class='dd-google1-ajax-load dd-google1-638'></div><g:plusone size='medium' href='http://lineadecodigo.com/google/comunicando-dos-direcciones-en-google-maps/'></g:plusone></div><div class='dd_button'><script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http%3A%2F%2Flineadecodigo.com%2Fgoogle%2Fcomunicando-dos-direcciones-en-google-maps%2F" send="false" show_faces="false"  layout="button_count" width="92"  ></fb:like></div><div class='dd_button'><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://lineadecodigo.com/google/comunicando-dos-direcciones-en-google-maps/" data-count="horizontal" data-text="Comunicando dos direcciones en Google Maps" data-via="" ></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div style='clear:both'></div></div><div style='clear:both'></div><p>Hace unos días podíamos leer en <a href="http://www.anieto2k.com/2007/06/07/google-maps-actualiza-su-api-e-integra-directions/" title="aNieto2K">aNieto2K</a> y <a href="http://www.tufuncion.com/drag-zoom" title="Tu Función">Tu Función</a> que <a href="http://www.manualweb.net/tutorial-google-maps/" title="Tutorial de Google Maps">Google Maps</a> había ampliado su API con Directions.</p>
<p>Directions nos permite mostrar la ruta que hay dentro de un mapa entre dos puntos.</p>
<p>Con <a href="http://www.manualweb.net/tutorial-google-maps/" title="Tutorial de Google Maps">Google Maps</a> se suele utilizar una capa para posicionar el mapa. Con Directions, además del mapa, tendremos una segunda capa donde se mostrará el contenido de la ruta.</p>
<p>Es por ello que el código del cuerpo de la página será similar a este:</p>
<pre class="html4strict" style="font-family:monospace;">&nbsp;
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:TABLE"><span style="color: #000000; font-weight: bold;">table</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:TR"><span style="color: #000000; font-weight: bold;">tr</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:TH"><span style="color: #000000; font-weight: bold;">th</span></a>&gt;</span>Itinerario<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:TH"><span style="color: #000000; font-weight: bold;">th</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:TH"><span style="color: #000000; font-weight: bold;">th</span></a>&gt;</span>Mapa<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:TH"><span style="color: #000000; font-weight: bold;">th</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:TR"><span style="color: #000000; font-weight: bold;">tr</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:TR"><span style="color: #000000; font-weight: bold;">tr</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:TD"><span style="color: #000000; font-weight: bold;">td</span></a> <a href="http://w3api.com/wiki/HTML:valign"><span style="color: #000066;">valign</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;top&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a> <a href="http://w3api.com/wiki/HTML:id"><span style="color: #000066;">id</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;direcciones&quot;</span> <a href="http://w3api.com/wiki/HTML:style"><span style="color: #000066;">style</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;width: 275px&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:TD"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:TD"><span style="color: #000000; font-weight: bold;">td</span></a> <a href="http://w3api.com/wiki/HTML:valign"><span style="color: #000066;">valign</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;top&quot;</span>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a> <a href="http://w3api.com/wiki/HTML:id"><span style="color: #000066;">id</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;mapa&quot;</span> <a href="http://w3api.com/wiki/HTML:style"><span style="color: #000066;">style</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;width: 310px; height: 400px&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:DIV"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:TD"><span style="color: #000000; font-weight: bold;">td</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:TR"><span style="color: #000000; font-weight: bold;">tr</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:TABLE"><span style="color: #000000; font-weight: bold;">table</span></a>&gt;</span>
&nbsp;</pre>
<p>Hay que indicar que la capa donde cargaremos las rutas solo le damos el ancho, ya que dependiendo de la ruta que carguemos, su largo podrá ser uno u otro.</p>
<p>Con lo que respecta al código <a href="http://www.manualweb.net/tutorial-javascript/" title="Tutorial de JavaScript">JavaScript</a> lo que tenemos que hacer es instanciar la clase GDirections. Esta clase recibe dos parámetros. El primero es la variable en la que hemos instanciado el mapa y el elemento de la página donde hay que cargar la ruta.</p>
<pre class="javascript" style="font-family:monospace;">panel_ruta <span style="color: #339933;">=</span> document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;direcciones&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
ruta <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> GDirections<span style="color: #009900;">&#40;</span>map<span style="color: #339933;">,</span> panel_ruta<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
<p>Una vez que hemos instanciado la clase GDirections tendremos que cargar la ruta. Para ello utilizaremos el método .load(). Este método recibe dos parámetros, el primero es una cadena con la ruta que queremos trazar y el segundo el idioma en el que queremos que se nos presente la ruta.</p>
<p>Con respecto a la cadena de la ruta, esta deberá de seguir el siguiente patrón:</p>
<pre>"from: ciudad_origen to: ciudad_destino"</pre>
<p>El código que cargaría la ruta será el siguiente:</p>
<pre class="javascript" style="font-family:monospace;">uta.<span style="color: #660066;">load</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;from: Madrid to: Avila&quot;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span>locale<span style="color: #339933;">:</span> <span style="color: #3366CC;">'es_ES'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre>
<p>Con esto ya tendríamos cargada nuestra ruta en el mapa y el texto de la ruta en la capa de la ruta.</p>
<p>Una cosa muy importante es que la clase Directions es incluida en la versión 2.x del API de <a href="http://www.manualweb.net/tutorial-google-maps/" title="Tutorial de Google Maps">Google Maps</a>. Es por ello que cuando realizemos la carga del API deberemos de comprobar que la versión que estamos utilizando es la 2.x y no la 2</p>
<pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<a href="http://w3api.com/wiki/HTML:SCRIPT"><span style="color: #000000; font-weight: bold;">script</span></a> <a href="http://w3api.com/wiki/HTML:src"><span style="color: #000066;">src</span></a><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://maps.google.com/maps?file=api&amp;amp;&lt;strong&gt;</span></span>v=2.x<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:STRONG"><span style="color: #000000; font-weight: bold;">strong</span></a>&gt;</span><span style="color: #ddbb00;">&amp;amp;</span>key=tu_clave&quot; type=&quot;text/javascript&quot;&gt;<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://w3api.com/wiki/HTML:SCRIPT"><span style="color: #000000; font-weight: bold;">script</span></a>&gt;</span></pre>
<p><a href="http://img.aulambra.com/wp-content/uploads/2007/06/comunicando-direcciones-con-google-maps.html" title="Visualizar el ejemplo">Visualizar el ejemplo</a> | <a href="http://img.aulambra.com/wp-content/uploads/2007/06/comunicando-direcciones-con-google-maps.zip" title="Descargar el código">Descargar el código</a><strong>Similar Posts:</strong>
<ul class="similar-posts">
<li><a href="http://lineadecodigo.com/google/ventanas-de-informacion-con-imagenes-en-google-maps/" rel="bookmark" title="Septiembre 23, 2009">Ventanas de información con imágenes en Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/cargando-google-maps/" rel="bookmark" title="Abril 6, 2007">Cargando Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/poner-un-icono-dentro-de-google-maps/" rel="bookmark" title="Junio 21, 2009">Poner un icono dentro de Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/abrir-una-ventana-de-informacion-en-google-maps/" rel="bookmark" title="Enero 22, 2008">Abrir una ventana de información en Google Maps</a></li>
<li><a href="http://lineadecodigo.com/google/anadir-control-de-trafico-con-google-maps/" rel="bookmark" title="Enero 18, 2009">Añadir control de trafico con Google Maps</a></li>
</ul>
<p><!-- Similar Posts took 5.612 ms --></p>
<script type="text/javascript"> jQuery(document).ready(function($) { window.setTimeout('loadGoogle1_638()',1000); }); </script><script type="text/javascript"> function loadGoogle1_638(){ jQuery(document).ready(function($) { $('.dd-google1-638').remove();$.getScript('https://apis.google.com/js/plusone.js'); }); }</script><!-- Social Buttons Generated by Digg Digg plugin v5.2.6,
    Author : Buffer, Inc
    Website : http://bufferapp.com/diggdigg -->]]></content:encoded>
			<wfw:commentRss>http://lineadecodigo.com/google/comunicando-dos-direcciones-en-google-maps/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

<!-- Served from: lineadecodigo.com @ 2012-05-23 19:23:23 by W3 Total Cache -->
