<?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>Xavisys&#187; Google Maps</title>
	<atom:link href="http://xavisys.com/tag/google-maps/feed/" rel="self" type="application/rss+xml" />
	<link>http://xavisys.com</link>
	<description>WordPress Plugins and Custom WordPress Development</description>
	<lastBuildDate>Wed, 16 Nov 2011 20:45:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<atom:link rel='hub' href='http://xavisys.com/?pushpress=hub'/>
		<item>
		<title>Google Maps API</title>
		<link>http://xavisys.com/google-maps-api/</link>
		<comments>http://xavisys.com/google-maps-api/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 16:42:04 +0000</pubDate>
		<dc:creator>Aaron D. Campbell</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[xavisys]]></category>

		<guid isPermaLink="false">http://xavisys.com/google-maps-api/</guid>
		<description><![CDATA[I started working some with the Google Maps API, and it&#8217;s pretty nice. The documentation is decent, the examples are good, etc. I realized that I&#8217;ve come to expect this from Google, so I wanted to take the time instead to point out that this is an exceptional product. For example, I began to look [...]]]></description>
			<content:encoded><![CDATA[<p>I started working some with the <a href="http://code.google.com/apis/maps/">Google Maps API</a>, and it&#8217;s pretty nice.  The documentation is decent, the examples are good, etc.  I realized that I&#8217;ve come to expect this from Google, so I wanted to take the time instead to point out that this is an exceptional product.  For example, I began to look into making the scroll wheel zoom on my maps like they do on the Google Maps site.  What does it entail?  One line:
<pre class="brush: jscript; title: ; notranslate">map.enableScrollWheelZoom();</pre>
<p>However, as great of a product as it is, it seems to be lacking some things.  For example, if I want an info window that gives the options to get directions to or from that location, I have to do all that myself.  I have to generate the links, and make them replace the content of the info window with a form that <em>I</em> have to make, and I have to make that form run some JavaScript when executed to get the directions.  Why?  This has GOT to be a common task.  Why not build it into the API?  However, in the end, that pales in comparison to the real problem.  There is no way to validate a Google Maps API key!  Instead, you have to load JavaScript using that key, and it uses an <em>alert</em> to announce that the key was bad!  No one wants a JavaScript alert to pop up on their page!  Since I&#8217;m making a WordPress plugin out of this (teaser!), I needed to make sure that the users of my plugin wouldn&#8217;t have this issue.  I ended up having to override the alert function on the options page for my plugin like this:</p>
<pre class="brush: jscript; title: ; notranslate">var KillAlerts = true;
var realAlert = alert;
var alert = new Function('a', 'if(!KillAlerts){realAlert(a)}');</pre>
<p>Then I added a function that runs on page load, re-enables the alerts, and checks if the key was valid:</p>
<pre class="brush: jscript; title: ; notranslate">function load()
{
    // Re-anable alerts
    KillAlerts = false;

    if (GBrowserIsCompatible()) {
        // Key is valid
    } else {
        if (G_INCOMPAT) {
            // Key is NOT valid.
        } else {
            // Can't tell if the Google API Key is valid, due to the browser not being compatible with the Google Maps API.
        }
    }
}</pre>
<p>There is no reason that it should be that complicated.  They should have a web service where I can send a request to verify a key, or their script should set a global variable rather than send an ugly alert!  In the end, it&#8217;s a great product, but I would have expected that these kind of rough edges would have been taken care of by now.  Google, you make me sad.<br />
<h3 class='related_post_title'>Related Posts:</h3>
<ul class='related_post'>
<li><a href='http://xavisys.com/press-release-xavisys-acquires-attackr-web-development-news-blogs/' title='Press Release: Xavisys Acquires Attackr.com – Web Development News Blogs'>Press Release: Xavisys Acquires Attackr.com – Web Development News Blogs</a></li>
<li><a href='http://xavisys.com/acquia-puts-drupal-in-the-news/' title='Acquia Puts Drupal in the News'>Acquia Puts Drupal in the News</a></li>
<li><a href='http://xavisys.com/all-work-and-no-play/' title='All Work and No Play'>All Work and No Play</a></li>
<li><a href='http://xavisys.com/the-heart-of-open-source/' title='The Heart of Open Source'>The Heart of Open Source</a></li>
<li><a href='http://xavisys.com/a-marketing-strategy-you-can-believe-in/' title='A Marketing Strategy You Can Believe In'>A Marketing Strategy You Can Believe In</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://xavisys.com/google-maps-api/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

