<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How to make Google static maps interactive</title>
	<atom:link href="http://blog.revahealth.com/2008/10/how-to-make-google-static-maps-interactive.html/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.revahealth.com/2008/10/how-to-make-google-static-maps-interactive.html</link>
	<description>Tech, Marketing, Health 2.0 and stuff from the RevaHealth.com team</description>
	<lastBuildDate>Sat, 21 Nov 2009 04:42:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Nesan</title>
		<link>http://blog.revahealth.com/2008/10/how-to-make-google-static-maps-interactive.html/comment-page-1#comment-526</link>
		<dc:creator>Nesan</dc:creator>
		<pubDate>Tue, 28 Jul 2009 02:37:54 +0000</pubDate>
		<guid isPermaLink="false">http://ibehealth.com/2008/10/how-to-make-google-static-maps-interactive.html#comment-526</guid>
		<description>Thank you for your reply Tim.I got it correct now.</description>
		<content:encoded><![CDATA[<p>Thank you for your reply Tim.I got it correct now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://blog.revahealth.com/2008/10/how-to-make-google-static-maps-interactive.html/comment-page-1#comment-516</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Wed, 22 Jul 2009 13:37:13 +0000</pubDate>
		<guid isPermaLink="false">http://ibehealth.com/2008/10/how-to-make-google-static-maps-interactive.html#comment-516</guid>
		<description>Hi Nesan - hard to know what problem you are having but I did notice I wrote some of the examples down wrong 2 to the power of a zoom of 2 is clearly 4 and 4 times 256 is 1024... if that is not the problem here is some example code for the dynamic api that shows the same equations in action (some rounding errors in there but gives a pretty good idea of what&#039;s going on). Should work off the file system without a key - play around with the ideas and then ask if you have any problems.



  
    
    Google Maps JavaScript API Example
    
    

    function initialize() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById(&quot;map_canvas&quot;));
        map.setCenter(new GLatLng(40.702147,-73.9986), 2);
        map.setUIToDefault();

        var leftEdge = new GPoint(0, 128);
        var leftLatLng = map.fromContainerPixelToLatLng(leftEdge);
        var rightEdge = new GPoint(255, 128);
        var rightLatLng = map.fromContainerPixelToLatLng(rightEdge);

        var degreesToLeftEdge = leftLatLng.lng()-map.getCenter().lng();
        var degreesToRightEdge = rightLatLng.lng()-map.getCenter().lng();
        
        var pixelWidth = (256 * Math.pow(2, map.getZoom()))/360;
        var calcDegreesToEdge = 128/pixelWidth;

		var radianPixelWidth = (256 * Math.pow(2, map.getZoom()))/(2*Math.PI);
		
		var radianCalc = Math.log(   (1+Math.sin(map.getCenter().latRadians()))  / (1-Math.sin(map.getCenter().latRadians())) )/ 2;

		var calcCentre = radianCalc * radianPixelWidth + 1;
		
        alert(degreesToLeftEdge + &quot;, &quot; + degreesToRightEdge + &quot;, &quot; + calcDegreesToEdge + &quot;, &quot; + calcCentre);
        
      }
      
    }

    
  
  
  
    
  
  
</description>
		<content:encoded><![CDATA[<p>Hi Nesan &#8211; hard to know what problem you are having but I did notice I wrote some of the examples down wrong 2 to the power of a zoom of 2 is clearly 4 and 4 times 256 is 1024&#8230; if that is not the problem here is some example code for the dynamic api that shows the same equations in action (some rounding errors in there but gives a pretty good idea of what&#8217;s going on). Should work off the file system without a key &#8211; play around with the ideas and then ask if you have any problems.</p>
<p>    Google Maps JavaScript API Example</p>
<p>    function initialize() {<br />
      if (GBrowserIsCompatible()) {<br />
        var map = new GMap2(document.getElementById(&#8221;map_canvas&#8221;));<br />
        map.setCenter(new GLatLng(40.702147,-73.9986), 2);<br />
        map.setUIToDefault();</p>
<p>        var leftEdge = new GPoint(0, 128);<br />
        var leftLatLng = map.fromContainerPixelToLatLng(leftEdge);<br />
        var rightEdge = new GPoint(255, 128);<br />
        var rightLatLng = map.fromContainerPixelToLatLng(rightEdge);</p>
<p>        var degreesToLeftEdge = leftLatLng.lng()-map.getCenter().lng();<br />
        var degreesToRightEdge = rightLatLng.lng()-map.getCenter().lng();</p>
<p>        var pixelWidth = (256 * Math.pow(2, map.getZoom()))/360;<br />
        var calcDegreesToEdge = 128/pixelWidth;</p>
<p>		var radianPixelWidth = (256 * Math.pow(2, map.getZoom()))/(2*Math.PI);</p>
<p>		var radianCalc = Math.log(   (1+Math.sin(map.getCenter().latRadians()))  / (1-Math.sin(map.getCenter().latRadians())) )/ 2;</p>
<p>		var calcCentre = radianCalc * radianPixelWidth + 1;</p>
<p>        alert(degreesToLeftEdge + &#8220;, &#8221; + degreesToRightEdge + &#8220;, &#8221; + calcDegreesToEdge + &#8220;, &#8221; + calcCentre);</p>
<p>      }</p>
<p>    }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Philip Boyle</title>
		<link>http://blog.revahealth.com/2008/10/how-to-make-google-static-maps-interactive.html/comment-page-1#comment-515</link>
		<dc:creator>Philip Boyle</dc:creator>
		<pubDate>Wed, 22 Jul 2009 11:35:36 +0000</pubDate>
		<guid isPermaLink="false">http://ibehealth.com/2008/10/how-to-make-google-static-maps-interactive.html#comment-515</guid>
		<description>Hi Nesan,

I&#039;ve asked Tim to take a look at this and I&#039;ll have an answer for your later today.

Philip</description>
		<content:encoded><![CDATA[<p>Hi Nesan,</p>
<p>I&#8217;ve asked Tim to take a look at this and I&#8217;ll have an answer for your later today.</p>
<p>Philip</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nesan</title>
		<link>http://blog.revahealth.com/2008/10/how-to-make-google-static-maps-interactive.html/comment-page-1#comment-514</link>
		<dc:creator>Nesan</dc:creator>
		<pubDate>Tue, 21 Jul 2009 08:55:20 +0000</pubDate>
		<guid isPermaLink="false">http://ibehealth.com/2008/10/how-to-make-google-static-maps-interactive.html#comment-514</guid>
		<description>Hi,
I followed the given formulas for calculating the pixel values of map.I have 256x256 pix map.Center is at 40.702147,-73.9986.I substituted in the given formula but i am not getting 128px i am geetting someother values.Can you please tell me where i am going wrong.</description>
		<content:encoded><![CDATA[<p>Hi,<br />
I followed the given formulas for calculating the pixel values of map.I have 256&#215;256 pix map.Center is at 40.702147,-73.9986.I substituted in the given formula but i am not getting 128px i am geetting someother values.Can you please tell me where i am going wrong.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
