Thanks for the detailed explanation.<br><br><div class="gmail_quote">On Tue, Nov 11, 2008 at 4:17 PM,  <span dir="ltr">&lt;<a href="mailto:bartvde@osgis.nl">bartvde@osgis.nl</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This is a very basic GIS calculation.<br>
<br>
Resolution is how many map units per pixel. Map units can be degrees,<br>
meters etc., but the OpenLayers terminology mostly comes from a<br>
degree/latitude/longtitude point of view.<br>
<br>
So if the map is 500 by 600 pixels, and the resolution is 20, then the<br>
width of the map in map units 10.000 and the height in map units is<br>
12.000.<br>
<br>
The extent then ranges from:<br>
-left: the center X (or longitude) minus half the width (in map units)<br>
-right: the center X (or longitude) plus half the width (in map units)<br>
-bottom: the center Y (or latitude) minus half the height (in map units)<br>
-top: the center Y (or latitude) plus half the height (in map units)<br>
<br>
Hope this helps, if not let us know.<br>
<br>
Best regards,<br>
Bart<br>
<div><div></div><div class="Wj3C7c"><br>
&gt; Can someone please tell me or point me to some literature that explains<br>
&gt; the<br>
&gt; logic behind the below piece of code (Taken from calculateBounds method of<br>
&gt; Map class)?<br>
&gt;<br>
&gt; var size = this.getSize();&lt;Returns view port size&gt;<br>
&gt; var w_deg = size.w * resolution;<br>
&gt; var h_deg = size.h * resolution;<br>
&gt; extent = new OpenLayers.Bounds(center.lon - w_deg / 2,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;center.lat - h_deg / 2,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;center.lon + w_deg / 2,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;center.lat + h_deg / 2);<br>
&gt;<br>
&gt; --<br>
&gt; Cheers,<br>
&gt; Abhi<br>
</div></div>&gt; _______________________________________________<br>
&gt; Dev mailing list<br>
&gt; <a href="mailto:Dev@openlayers.org">Dev@openlayers.org</a><br>
&gt; <a href="http://openlayers.org/mailman/listinfo/dev" target="_blank">http://openlayers.org/mailman/listinfo/dev</a><br>
&gt;<br>
<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>Cheers,<br>Abhi<br>