<?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>Facebook Cookbook &#187; Google Map</title>
	<atom:link href="http://fbcookbook.ofhas.in/tag/google-map/feed/" rel="self" type="application/rss+xml" />
	<link>http://fbcookbook.ofhas.in</link>
	<description>thousands of app development recipes</description>
	<lastBuildDate>Sun, 21 Mar 2010 10:38:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>embedding google map in canvas</title>
		<link>http://fbcookbook.ofhas.in/2009/02/15/embedding-static-google-map-in-canvas/</link>
		<comments>http://fbcookbook.ofhas.in/2009/02/15/embedding-static-google-map-in-canvas/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 00:44:11 +0000</pubDate>
		<dc:creator>Hasin Hayder</dc:creator>
				<category><![CDATA[Canvas]]></category>
		<category><![CDATA[External]]></category>
		<category><![CDATA[FBML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[iFrame]]></category>
		<category><![CDATA[fb:iframe]]></category>
		<category><![CDATA[Google Map]]></category>

		<guid isPermaLink="false">http://fbcookbook.ofhas.in/?p=264</guid>
		<description><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
digg_url = 'http://fbcookbook.ofhas.in/2009/02/15/embedding-static-google-map-in-canvas/';
digg_bgcolor = '#FFFFFF';
digg_skin = '';
digg_window = '';
digg_title = 'embedding google map in canvas';
digg_bodytext = '';
digg_media = 'news';
digg_topic = '';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>




ever tried to embed static google map in your facebook application canvas? wait a bit, i think you are firing a question at me &#8220;whats the difference, its all the same, a static image, eh?&#8221; &#8211; nope! it wont work the way you think . whenever you try to embed a static google map image, [...]]]></description>
			<content:encoded><![CDATA[<div style="float: right; width: 42px; padding-right: 10px; margin: 0 0 0 10px;"><script type="text/javascript">
<!--
digg_url = 'http://fbcookbook.ofhas.in/2009/02/15/embedding-static-google-map-in-canvas/';
digg_bgcolor = '#FFFFFF';
digg_skin = '';
digg_window = '';
digg_title = 'embedding google map in canvas';
digg_bodytext = '';
digg_media = 'news';
digg_topic = '';
//-->
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>
</div>
<p><script type="text/javascript"><!--
google_ad_client = "pub-3649773907774827";
/* 468x15, created 9/26/09 */
google_ad_slot = "6695465500";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>ever tried to embed static google map in your facebook application canvas? wait a bit, i think you are firing a question at me &#8220;whats the difference, its all the same, a static image, eh?&#8221; &#8211; nope! it wont work the way you think . whenever you try to embed a static google map image, google parse it as a &#8220;Bad Or Malformed&#8221; request and returns nothing! and in canvas url you can&#8217;t directly import any javascript but fbjs. so all we have to do is embed google map using a &lt;fb:iframe /> object</p>
<p>enough said, lets see it in action. first try to embed a google static map in regular way and see the result. </p>
<pre name="code" class="php">

&lt;php
include_once(&quot;config.php&quot;);
?&gt;
Here is the map of Dhaka &lt;br/&gt;
&lt;img src=&#039;http://maps.google.com/staticmap?center=23.70991,90.407&amp;amp;amp;zoom=14&amp;amp;amp;size=400x300&amp;amp;amp;key=&lt;api_key&gt;=23.7099,90.407,green&#039; /&gt; &lt;br/&gt;
Pretty cool, ya?
</pre>
<p>output is </p>
<pre name="code" class="html">

Here is the map of Dhaka
Pretty cool, ya?
</pre>
<p>you will be surprised that this code will render only the texts and no image in your application canvas, though the image url is fully valid. </p>
<p>now here is the revised version using &lt;fb:iframe /></p>
<pre name="code" class="php">

&lt;?php
include(&quot;config.php&quot;);
?&gt;
Here is the map of Dhaka &lt;br/&gt;
&lt;fb:iframe width=&#039;400&#039; height=&#039;300&#039; style=&#039;border:0&#039; frameborder=&#039;0&#039; src=&#039;http://sandbox.ofhas.in/fbtest/map.php?lat=23.7099&amp;amp;amp;lon=90.407&#039; &gt;&lt;/fb:iframe&gt;
&lt;br/&gt;
Pretty cool, eh?
</pre>
<p>we are using a map generator (map.php) using the latitude and longitude of a specific location, as the source of our iframe. so here is the source code of map.php</p>
<pre name="code" class="javascript">

&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
    &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xmlns:v=&quot;urn:schemas-microsoft-com:vml&quot;&gt;
  &lt;head&gt;
    &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=utf-8&quot;/&gt;
    &lt;title&gt;Google Maps JavaScript API Example: Map Markers&lt;/title&gt;
    &lt;script src=&quot;http://maps.google.com/maps?file=api&amp;amp;amp;v=2&amp;amp;amp;key=&lt;api_key&gt;&quot;
            type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
    &lt;script type=&quot;text/javascript&quot;&gt;

    function initialize() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById(&quot;map_canvas&quot;));
        map.setCenter(new GLatLng(&lt;?=$_GET[&#039;lat&#039;];?&gt;, &lt;?=$_GET[&#039;lon&#039;];?&gt;), 13);

          var point = new GLatLng(&lt;?=$_GET[&#039;lat&#039;];?&gt;, &lt;?=$_GET[&#039;lon&#039;];?&gt;);
          map.addOverlay(new GMarker(point));
      }
    }

    &lt;/script&gt;
  &lt;/head&gt;

  &lt;body onload=&quot;initialize()&quot; onunload=&quot;GUnload()&quot; style=&#039;margin:auto;padding:0px;&gt;
    &lt;div id=&quot;map_canvas&quot; style=&quot;width: 398px; height: 298px;margin:10 0;border:1px solid #ccc;&quot;&gt;&lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;
</pre>
<p>this time output is pretty cool <img src='http://fbcookbook.ofhas.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  have a look</p>
<p><a href="http://fbcookbook.ofhas.in/wp-content/uploads/2009/02/picture-18.png"><img src="http://fbcookbook.ofhas.in/wp-content/uploads/2009/02/picture-18-300x264.png" alt="picture-18" title="picture-18" width="300" height="264" class="alignnone size-medium wp-image-266" /></a></p>
<p>so this is it! in our next article we are coming with the complete source code of a standalone twitter like application, developed using FBConnect to allow you to monitor your friend&#8217;s status and also to change yours. stay tuned <img src='http://fbcookbook.ofhas.in/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-3649773907774827";
/* 468x15, created 9/26/09 */
google_ad_slot = "6695465500";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://fbcookbook.ofhas.in/2009/02/15/embedding-static-google-map-in-canvas/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
