<?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: Bounding Box in Google Maps</title>
	<atom:link href="http://www.svennerberg.com/2008/11/bounding-box-in-google-maps/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.svennerberg.com/2008/11/bounding-box-in-google-maps/</link>
	<description>Web Applications Designed for Humans</description>
	<lastBuildDate>Fri, 03 Feb 2012 20:33:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Naresh</title>
		<link>http://www.svennerberg.com/2008/11/bounding-box-in-google-maps/#comment-169</link>
		<dc:creator>Naresh</dc:creator>
		<pubDate>Tue, 01 Mar 2011 07:08:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.svennerberg.com/?p=640#comment-169</guid>
		<description>Hi,

I have used ur code. but i m not able to see the any bounding box....

Can u please help me on this....

Rerads,
Naresh</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I have used ur code. but i m not able to see the any bounding box&#8230;.</p>
<p>Can u please help me on this&#8230;.</p>
<p>Rerads,<br />
Naresh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: buy kinect</title>
		<link>http://www.svennerberg.com/2008/11/bounding-box-in-google-maps/#comment-168</link>
		<dc:creator>buy kinect</dc:creator>
		<pubDate>Sun, 24 Oct 2010 09:50:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.svennerberg.com/?p=640#comment-168</guid>
		<description>Hello,
	
	I have a inquiry for the webmaster/admin here at www.svennerberg.com.

Can I use some of the information from this post above if I give a link back to your website?

Thanks,
Alex</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>	I have a inquiry for the webmaster/admin here at <a href="http://www.svennerberg.com" rel="nofollow">http://www.svennerberg.com</a>.</p>
<p>Can I use some of the information from this post above if I give a link back to your website?</p>
<p>Thanks,<br />
Alex</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Grapsus</title>
		<link>http://www.svennerberg.com/2008/11/bounding-box-in-google-maps/#comment-167</link>
		<dc:creator>Grapsus</dc:creator>
		<pubDate>Fri, 30 Jul 2010 15:17:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.svennerberg.com/?p=640#comment-167</guid>
		<description>Here is an adaptation of this code I made for API v3 :
http://grapsus.net/blog/post/Google-API-v3-fit-map-zoom-and-bounds-to-all-markers</description>
		<content:encoded><![CDATA[<p>Here is an adaptation of this code I made for API v3 :<br />
<a href="http://grapsus.net/blog/post/Google-API-v3-fit-map-zoom-and-bounds-to-all-markers" rel="nofollow">http://grapsus.net/blog/post/Google-API-v3-fit-map-zoom-and-bounds-to-all-markers</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Toleti S</title>
		<link>http://www.svennerberg.com/2008/11/bounding-box-in-google-maps/#comment-166</link>
		<dc:creator>Toleti S</dc:creator>
		<pubDate>Tue, 17 Nov 2009 16:32:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.svennerberg.com/?p=640#comment-166</guid>
		<description>We have an image with two points in the middle and the bound area in pixels only and two reference points in the image with their pixel coordinates.  We can get a zoom/scale for the image based on the above data.

We also know the latlng for the above two reference points.

How do I set the box north-east and south-west corners so that I can place it on the map.

Appreciate any help/pointers.

Thanks</description>
		<content:encoded><![CDATA[<p>We have an image with two points in the middle and the bound area in pixels only and two reference points in the image with their pixel coordinates.  We can get a zoom/scale for the image based on the above data.</p>
<p>We also know the latlng for the above two reference points.</p>
<p>How do I set the box north-east and south-west corners so that I can place it on the map.</p>
<p>Appreciate any help/pointers.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gopi</title>
		<link>http://www.svennerberg.com/2008/11/bounding-box-in-google-maps/#comment-165</link>
		<dc:creator>gopi</dc:creator>
		<pubDate>Fri, 05 Jun 2009 10:00:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.svennerberg.com/?p=640#comment-165</guid>
		<description>Here This bounded rectangle is not working in all the cases 
when we move the map at some zoomlevel 
  
 NorthEast  (topRight)  points (70.495574, -102.304688) 
topRight[0] = 70.495574;
topRight[1]= -102.304688;

 SouthWest(BottomLeft) points (-59.712097, 47.109375)
BottomLeft[0] =-59.712097;

and my point is under this getBounds 

we have a condition like 

if(lat &gt;  bottomLeft[0]  and lat  BottomLeft[1] and lng &lt; TopRight[1])
{}
this condition falils in some points even though its under that Bounded Rectangle
 and the actual point is (30.145127,75.234)  between those top and bottom points</description>
		<content:encoded><![CDATA[<p>Here This bounded rectangle is not working in all the cases<br />
when we move the map at some zoomlevel </p>
<p> NorthEast  (topRight)  points (70.495574, -102.304688)<br />
topRight[0] = 70.495574;<br />
topRight[1]= -102.304688;</p>
<p> SouthWest(BottomLeft) points (-59.712097, 47.109375)<br />
BottomLeft[0] =-59.712097;</p>
<p>and my point is under this getBounds </p>
<p>we have a condition like </p>
<p>if(lat &gt;  bottomLeft[0]  and lat  BottomLeft[1] and lng &lt; TopRight[1])<br />
{}<br />
this condition falils in some points even though its under that Bounded Rectangle<br />
 and the actual point is (30.145127,75.234)  between those top and bottom points</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex O'Byrne</title>
		<link>http://www.svennerberg.com/2008/11/bounding-box-in-google-maps/#comment-164</link>
		<dc:creator>Alex O'Byrne</dc:creator>
		<pubDate>Sun, 22 Feb 2009 13:01:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.svennerberg.com/?p=640#comment-164</guid>
		<description>OK that didn&#039;t post directly... I&#039;ll reformat it and post again later.</description>
		<content:encoded><![CDATA[<p>OK that didn&#8217;t post directly&#8230; I&#8217;ll reformat it and post again later.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex O'Byrne</title>
		<link>http://www.svennerberg.com/2008/11/bounding-box-in-google-maps/#comment-163</link>
		<dc:creator>Alex O'Byrne</dc:creator>
		<pubDate>Sun, 22 Feb 2009 12:59:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.svennerberg.com/?p=640#comment-163</guid>
		<description>If you&#039;re getting the lat and long from a collection of Ruby objects. 

Here&#039;s the method:

  # returns a hash of top right and bottom left bounds
  def self.bounds(collection)
    top = 0
    bottom = 0
    right = 0
    left = 0
    initially_set = false
    collection.each do &#124;point&#124;
      if point.lat and point.long
        if !initially_set or point.long &gt; top
          top = point.long
        end
        if !initially_set or point.long  right
          right = point.lat
        end
        if !initially_set or point.lat &lt; left
          left = point.lat
        end
        initially_set = true
      end
    end
    # you could add 10% to each value here 
    # if your map is correct portioned (otherwise)
    # your centre will be skewed
    # now create the hash
    result = Hash.new
    result[:top] = top
    result[:bottom] = bottom
    result[:right] = right
    result[:left] = left
    return result
  end

And then in the map definition...


// if we have a collection of items, set the map to fit them all 
// Define the two corners of the bounding box  
var sw = new GLatLng(, );  
var ne = new GLatLng(, );  
var bounds = new GLatLngBounds(sw, ne);</description>
		<content:encoded><![CDATA[<p>If you&#8217;re getting the lat and long from a collection of Ruby objects. </p>
<p>Here&#8217;s the method:</p>
<p>  # returns a hash of top right and bottom left bounds<br />
  def self.bounds(collection)<br />
    top = 0<br />
    bottom = 0<br />
    right = 0<br />
    left = 0<br />
    initially_set = false<br />
    collection.each do |point|<br />
      if point.lat and point.long<br />
        if !initially_set or point.long &gt; top<br />
          top = point.long<br />
        end<br />
        if !initially_set or point.long  right<br />
          right = point.lat<br />
        end<br />
        if !initially_set or point.lat &lt; left<br />
          left = point.lat<br />
        end<br />
        initially_set = true<br />
      end<br />
    end<br />
    # you could add 10% to each value here<br />
    # if your map is correct portioned (otherwise)<br />
    # your centre will be skewed<br />
    # now create the hash<br />
    result = Hash.new<br />
    result[:top] = top<br />
    result[:bottom] = bottom<br />
    result[:right] = right<br />
    result[:left] = left<br />
    return result<br />
  end</p>
<p>And then in the map definition&#8230;</p>
<p>// if we have a collection of items, set the map to fit them all<br />
// Define the two corners of the bounding box<br />
var sw = new GLatLng(, );<br />
var ne = new GLatLng(, );<br />
var bounds = new GLatLngBounds(sw, ne);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabriel Svennerberg</title>
		<link>http://www.svennerberg.com/2008/11/bounding-box-in-google-maps/#comment-162</link>
		<dc:creator>Gabriel Svennerberg</dc:creator>
		<pubDate>Thu, 29 Jan 2009 13:59:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.svennerberg.com/?p=640#comment-162</guid>
		<description>&lt;strong&gt;&lt;em&gt;Aiska:&lt;/em&gt;&lt;/strong&gt; After looking at your code again it occurred to me that there&#039;s a problem in it and that is in how you extend the bound. You don&#039;t use the &lt;code&gt;new&lt;/code&gt; keyword when you create a new &lt;code&gt;GLatLng&lt;/code&gt;. It should be:

&lt;code&gt;bounds.extend(new GLatLng(lat, lng));&lt;/code&gt;

Maybe that&#039;s the reason it doesn&#039;t work properly?

I haven&#039;t looked at your new method yet.</description>
		<content:encoded><![CDATA[<p><strong><em>Aiska:</em></strong> After looking at your code again it occurred to me that there&#8217;s a problem in it and that is in how you extend the bound. You don&#8217;t use the <code>new</code> keyword when you create a new <code>GLatLng</code>. It should be:</p>
<p><code>bounds.extend(new GLatLng(lat, lng));</code></p>
<p>Maybe that&#8217;s the reason it doesn&#8217;t work properly?</p>
<p>I haven&#8217;t looked at your new method yet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aiska</title>
		<link>http://www.svennerberg.com/2008/11/bounding-box-in-google-maps/#comment-161</link>
		<dc:creator>Aiska</dc:creator>
		<pubDate>Thu, 29 Jan 2009 10:32:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.svennerberg.com/?p=640#comment-161</guid>
		<description>&lt;strong&gt;Gabriel Svennerberg:&lt;/strong&gt; yeah that&#039;s right maybe this is bugs in API.

I found new method how to set zoom level of a google map base on markers.

maybe you can check this out for your reference. Thanks

&lt;a href=&quot;http://aiskahendra.blogspot.com/2009/01/set-zoom-level-of-google-map-base-on.html&quot; title=&quot;http://aiskahendra.blogspot.com/2009/01/set-zoom-level-of-google-map-base-on.html&quot; rel=&quot;nofollow&quot;&gt;Set zoom level of a google map base on markers&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p><strong>Gabriel Svennerberg:</strong> yeah that&#8217;s right maybe this is bugs in API.</p>
<p>I found new method how to set zoom level of a google map base on markers.</p>
<p>maybe you can check this out for your reference. Thanks</p>
<p><a href="http://aiskahendra.blogspot.com/2009/01/set-zoom-level-of-google-map-base-on.html" title="http://aiskahendra.blogspot.com/2009/01/set-zoom-level-of-google-map-base-on.html" rel="nofollow">Set zoom level of a google map base on markers</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gabriel Svennerberg</title>
		<link>http://www.svennerberg.com/2008/11/bounding-box-in-google-maps/#comment-160</link>
		<dc:creator>Gabriel Svennerberg</dc:creator>
		<pubDate>Wed, 28 Jan 2009 12:28:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.svennerberg.com/?p=640#comment-160</guid>
		<description>&lt;strong&gt;&lt;em&gt;Aiska:&lt;/em&gt;&lt;/strong&gt; Cool! I never thought of that, but naturally that&#039;s one way to do it. Thanks!

I have never encountered the error you&#039;re talking about myself. Could be a bug in the API?</description>
		<content:encoded><![CDATA[<p><strong><em>Aiska:</em></strong> Cool! I never thought of that, but naturally that&#8217;s one way to do it. Thanks!</p>
<p>I have never encountered the error you&#8217;re talking about myself. Could be a bug in the API?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

