<?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>Minimizr.com &#187; Google</title>
	<atom:link href="http://minimizr.com/blog/category/google/feed/" rel="self" type="application/rss+xml" />
	<link>http://minimizr.com</link>
	<description>More With Less</description>
	<lastBuildDate>Sat, 05 Jun 2010 21:29:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Minimal How to Use Google Maps API With PHP</title>
		<link>http://minimizr.com/blog/2006/10/minimal-how-to-use-google-maps-api-with-php/</link>
		<comments>http://minimizr.com/blog/2006/10/minimal-how-to-use-google-maps-api-with-php/#comments</comments>
		<pubDate>Sat, 21 Oct 2006 13:39:35 +0000</pubDate>
		<dc:creator>kristian</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.minimizr.com/blog/2006/10/minimal-how-to-use-google-maps-api-with-php/</guid>
		<description><![CDATA[The goal of this how to is to easily add multiple markes into the map on your own site using Google Maps API and PHP. Google Maps API key If you don&#8217;t already have, sign up for the Google Account. Sign up for the Google Maps API key. Read at least the higlights from the [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="http://www.google.com/apis/maps/"><img id="image35" src="http://www.minimizr.com/wp-content/uploads/minimizr.com/2006/10/post-google-maps-php.gif" alt="Google Maps" style="float:right;margin-left:10px;"/></a><span class="summary"><strong>The goal of this how to is to easily add multiple markes into the map on your own site using Google Maps API and PHP.</strong></span></p>
<h4>Google Maps API key</h4>
<ol>
<li>If you don&#8217;t already have, sign up for the <a href="http://www.google.com/accounts/">Google Account</a>.</li>
<li>Sign up for the <a href="http://www.google.com/apis/maps/signup.html">Google Maps API key.</a> Read at least the higlights from the Google Maps API terms. Sign up for your site, forexample <em>http://www.mysite.com/</em></li>
</ol>
<p>After sign up you&#8217;ll get your key and an example html code. If you lost your key anytime, you can sign up again for the same site and use a new key. You can also sign up for multiple sites keys if needed. You&#8217;ll get different key for each site.</p>
<h4>JavaScript</h4>
<p>To add multiple markers on your map we&#8217;ll use some basic PHP code. Google&#8217;s example code is a good starting point for this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0</span>
<span style="color: #00bbdd;">  Strict//EN&quot;</span>
<span style="color: #00bbdd;">  &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> xmlns<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content-type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html;</span>
<span style="color: #009900;">    charset=utf-8&quot;</span><span style="color: #66cc66;">/</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>Google Maps JavaScript API Example<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://maps.google.com/maps?</span>
<span style="color: #009900;">      file=api&amp;amp;v=2&amp;amp;key=ABCDEFGH...&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
    //<span style="color: #009900;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #009900;">    function load<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #009900;">      if <span style="color: #66cc66;">&#40;</span>GBrowserIsCompatible<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #009900;">        var map <span style="color: #66cc66;">=</span> new GMap2<span style="color: #66cc66;">&#40;</span></span>
<span style="color: #009900;">        document.getElementById<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;map&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">        map.setCenter<span style="color: #66cc66;">&#40;</span></span>
<span style="color: #009900;">        new GLatLng<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">37.4419</span>, -<span style="color: #cc66cc;">122.1419</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;">13</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">      <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #009900;">    <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #009900;">    <span style="color: #66cc66;">//</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span> <span style="color: #000066;">onload</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;load()&quot;</span> <span style="color: #000066;">onunload</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;GUnload()&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;map&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;width: 500px; height: 300px&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

<p>You have your API key on the html head and JavaScript to load on page load and div element to show the map. With map.setCenter(new GLatLng(37.4419, -122.1419), 13) you define the map&#8217;s center point and the zoom level. Here is an <a href="http://www.minimizr.com/example/2006/10/minimal-how-to-google-maps-api-with-php-1.php">example</a>.</p>
<p>To have some controls in the map, add this line into JavaScript load funtion:</p>
<pre>map.addControl(new GSmallMapControl());</pre>
<p>Add this JavaScript function to make markers:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> createMarker<span style="color: #009900;">&#40;</span>point<span style="color: #339933;">,</span> text<span style="color: #339933;">,</span> title<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <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>point<span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span>title<span style="color: #339933;">:</span>title<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  GEvent.<span style="color: #660066;">addListener</span><span style="color: #009900;">&#40;</span>marker<span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;click&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    marker.<span style="color: #660066;">openInfoWindowHtml</span><span style="color: #009900;">&#40;</span>text<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">return</span> marker<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Add marker with this code:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> marker <span style="color: #339933;">=</span> createMarker<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;">37.4419</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">122.1419</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #3366CC;">'Marker text'</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'Example Title text'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
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></pre></div></div>

<p>Note that you can add in the markers any html code like links and images for example. So, the code looks now like this:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0</span>
<span style="color: #00bbdd;">  Strict//EN&quot;</span>
<span style="color: #00bbdd;">  &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> xmlns<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content-type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html;</span>
<span style="color: #009900;">    charset=utf-8&quot;</span><span style="color: #66cc66;">/</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>Google Maps JavaScript API Example<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://maps.google.com/maps?</span>
<span style="color: #009900;">      file=api&amp;amp;v=2&amp;amp;key=ABCDEFGH...&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
    //<span style="color: #009900;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #009900;">    function load<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #009900;">      if <span style="color: #66cc66;">&#40;</span>GBrowserIsCompatible<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #009900;">        var map <span style="color: #66cc66;">=</span> new GMap2<span style="color: #66cc66;">&#40;</span></span>
<span style="color: #009900;">        document.getElementById<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;map&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">        map.addControl<span style="color: #66cc66;">&#40;</span>new GSmallMapControl<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">        map.setCenter<span style="color: #66cc66;">&#40;</span></span>
<span style="color: #009900;">        new GLatLng<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">37.4419</span>, -<span style="color: #cc66cc;">122.1419</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;">13</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">        function createMarker<span style="color: #66cc66;">&#40;</span>point, <span style="color: #000066;">text</span>, <span style="color: #000066;">title</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #009900;">          var marker <span style="color: #66cc66;">=</span></span>
<span style="color: #009900;">          new GMarker<span style="color: #66cc66;">&#40;</span>point,<span style="color: #66cc66;">&#123;</span><span style="color: #000066;">title</span>:<span style="color: #000066;">title</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">          GEvent.addListener<span style="color: #66cc66;">&#40;</span></span>
<span style="color: #009900;">          marker, <span style="color: #ff0000;">&quot;click&quot;</span>, function<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #009900;">            marker.openInfoWindowHtml<span style="color: #66cc66;">&#40;</span><span style="color: #000066;">text</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">          <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">          return marker;</span>
<span style="color: #009900;">        <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #009900;">        var marker <span style="color: #66cc66;">=</span> createMarker<span style="color: #66cc66;">&#40;</span></span>
<span style="color: #009900;">        new GLatLng<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">37.4419</span>, -<span style="color: #cc66cc;">122.1419</span><span style="color: #66cc66;">&#41;</span>,</span>
<span style="color: #009900;">        <span style="color: #ff0000;">'Marker text'</span>, <span style="color: #ff0000;">'Example Title text'</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">        map.addOverlay<span style="color: #66cc66;">&#40;</span>marker<span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">      <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #009900;">    <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #009900;">    <span style="color: #66cc66;">//</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span> <span style="color: #000066;">onload</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;load()&quot;</span> <span style="color: #000066;">onunload</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;GUnload()&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;map&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;width: 500px; height: 300px&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

<p>Here is an <a href="http://www.minimizr.com/example/2006/10/minimal-how-to-google-maps-api-with-php-2.php">example</a>.</p>
<h4>PHP</h4>
<p>In order to add multiple markes, we&#8217;ll use some PHP to iterate over some marker points. Let&#8217;s use an array in this example, but you could get the marker points for example from database or xml file. Put the following lines around marker adding lines:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$points</span> <span style="color: #339933;">=</span> <span style="color: #990000;">Array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;37.4389, -122.1389&quot;</span><span style="color: #339933;">,</span>
<span style="color: #cc66cc;">2</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;37.4419, -122.1419&quot;</span><span style="color: #339933;">,</span>
<span style="color: #cc66cc;">3</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;37.4449, -122.1449&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$points</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$point</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
var marker = createMarker(
new GLatLng(<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$point</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>),
'Marker text <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$key</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>',
'Example Title text <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$key</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>');
map.addOverlay(marker);
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>And here is the final code:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #00bbdd;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0</span>
<span style="color: #00bbdd;">  Strict//EN&quot;</span>
<span style="color: #00bbdd;">  &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span> xmlns<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">meta</span> <span style="color: #000066;">http-equiv</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content-type&quot;</span> <span style="color: #000066;">content</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/html;</span>
<span style="color: #009900;">    charset=utf-8&quot;</span><span style="color: #66cc66;">/</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">title</span>&gt;</span>Google Maps JavaScript API Example<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">title</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://maps.google.com/maps?</span>
<span style="color: #009900;">      file=api&amp;amp;v=2&amp;amp;key=ABCDEFGH...&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
    //<span style="color: #009900;">&lt;!<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #009900;">    function load<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #009900;">      if <span style="color: #66cc66;">&#40;</span>GBrowserIsCompatible<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #009900;">        var map <span style="color: #66cc66;">=</span> new GMap2<span style="color: #66cc66;">&#40;</span></span>
<span style="color: #009900;">        document.getElementById<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;map&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">        map.addControl<span style="color: #66cc66;">&#40;</span>new GSmallMapControl<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">        map.setCenter<span style="color: #66cc66;">&#40;</span></span>
<span style="color: #009900;">        new GLatLng<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">37.4419</span>, -<span style="color: #cc66cc;">122.1419</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #cc66cc;">13</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">        function createMarker<span style="color: #66cc66;">&#40;</span>point, <span style="color: #000066;">text</span>, <span style="color: #000066;">title</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #009900;">          var marker <span style="color: #66cc66;">=</span></span>
<span style="color: #009900;">          new GMarker<span style="color: #66cc66;">&#40;</span>point,<span style="color: #66cc66;">&#123;</span><span style="color: #000066;">title</span>:<span style="color: #000066;">title</span><span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">          GEvent.addListener<span style="color: #66cc66;">&#40;</span></span>
<span style="color: #009900;">          marker, <span style="color: #ff0000;">&quot;click&quot;</span>, function<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></span>
<span style="color: #009900;">            marker.openInfoWindowHtml<span style="color: #66cc66;">&#40;</span><span style="color: #000066;">text</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">          <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #009900;">          return marker;</span>
<span style="color: #009900;">        <span style="color: #66cc66;">&#125;</span></span>
<span style="color: #009900;">        &lt;?php</span>
<span style="color: #009900;">        $points <span style="color: #66cc66;">=</span> Array<span style="color: #66cc66;">&#40;</span></span>
<span style="color: #009900;">        <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">=</span>&gt;</span> &quot;37.4389, -122.1389&quot;,
        2 =&gt; &quot;37.4419, -122.1419&quot;,
        3 =&gt; &quot;37.4449, -122.1449&quot;);
        foreach ($points as $key =&gt; $point) {
        ?&gt;
        var marker = createMarker(
        new GLatLng(<span style="color: #009900;">&lt;?php echo $point ?&gt;</span>),
        'Marker text <span style="color: #009900;">&lt;?php echo $key ?&gt;</span>',
        'Example Title text <span style="color: #009900;">&lt;?php echo $key ?&gt;</span>');
        map.addOverlay(marker);
        <span style="color: #009900;">&lt;?php <span style="color: #66cc66;">&#125;</span> ?&gt;</span>
      }
    }
    //]]&gt;
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span> <span style="color: #000066;">onload</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;load()&quot;</span> <span style="color: #000066;">onunload</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;GUnload()&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;map&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;width: 500px; height: 300px&quot;</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span></pre></div></div>

<p>And here is the final <a href="http://www.minimizr.com/example/2006/10/minimal-how-to-google-maps-api-with-php-3.php">example</a>.</p>
<p>If you have let&#8217;s say hundereds or thousands and more markers in your map, you might want to give a try to <a href="http://www.acme.com/javascript/#Clusterer">Clusterer</a>. It is an excellent and easy to use JavaScript library by Jef Poskanzer.</p>
<p>This how to showed only very basic usage of Google Maps API. To learn more Google Maps API has a good <a href="http://www.google.com/apis/maps/documentation/">documentation</a> and <a href="http://www.econym.demon.co.uk/">Mike</a> has many excellent <a href="http://www.econym.demon.co.uk/googlemaps/index.htm">examples</a> of the basics and more andvanced stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://minimizr.com/blog/2006/10/minimal-how-to-use-google-maps-api-with-php/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>From Del.icio.us to Google Bookmarks</title>
		<link>http://minimizr.com/blog/2006/10/from-delicious-to-google-bookmarks/</link>
		<comments>http://minimizr.com/blog/2006/10/from-delicious-to-google-bookmarks/#comments</comments>
		<pubDate>Fri, 20 Oct 2006 19:26:04 +0000</pubDate>
		<dc:creator>kristian</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.minimizr.com/blog/2006/10/from-delicious-to-google-bookmarks/</guid>
		<description><![CDATA[If you are for Google Bookamarks, you might be interested in about bookmarks importer from Del.icio.us to Google Google Bookmarks needs still quite a lot improvements to become a competitior for other bookmarking services, but still it has it&#8217;s advantages if you use also other Google&#8217;s services. Google Bookmarks are also private. Persistent.info has a [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><img id="image34" src="http://www.minimizr.com/wp-content/uploads/minimizr.com/2006/10/post-google-bookmarks.gif" alt="Google Bookmarks" style="float:right;margin-left:10px;"/><span class="summary"><strong>If you are for Google Bookamarks, you might be interested in about bookmarks importer from Del.icio.us to Google</strong></span></p>
<p>Google Bookmarks needs still quite a lot improvements to become a competitior for other bookmarking services, but still it has it&#8217;s advantages if you use also other Google&#8217;s services. Google Bookmarks are also private. Persistent.info has a script for <a href="http://persistent.info/archives/2006/10/16/delicious-google-bookmarks">importing Del.icio.us bookmarks to Google</a>. You can use the <a href="http://persistent.info/delicious2google/">script</a> on their website or copy the script and run your own copy.</p>
]]></content:encoded>
			<wfw:commentRss>http://minimizr.com/blog/2006/10/from-delicious-to-google-bookmarks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

