[OpenLayers-Dev] calculateBounds function
abhirama.bhat at gmail.com
Tue Nov 11 07:43:40 EST 2008
Thanks for the detailed explanation.
On Tue, Nov 11, 2008 at 4:17 PM, <bartvde at osgis.nl> wrote:
> This is a very basic GIS calculation.
> Resolution is how many map units per pixel. Map units can be degrees,
> meters etc., but the OpenLayers terminology mostly comes from a
> degree/latitude/longtitude point of view.
> So if the map is 500 by 600 pixels, and the resolution is 20, then the
> width of the map in map units 10.000 and the height in map units is
> The extent then ranges from:
> -left: the center X (or longitude) minus half the width (in map units)
> -right: the center X (or longitude) plus half the width (in map units)
> -bottom: the center Y (or latitude) minus half the height (in map units)
> -top: the center Y (or latitude) plus half the height (in map units)
> Hope this helps, if not let us know.
> Best regards,
> > Can someone please tell me or point me to some literature that explains
> > the
> > logic behind the below piece of code (Taken from calculateBounds method
> > Map class)?
> > var size = this.getSize();<Returns view port size>
> > var w_deg = size.w * resolution;
> > var h_deg = size.h * resolution;
> > extent = new OpenLayers.Bounds(center.lon - w_deg / 2,
> > center.lat - h_deg / 2,
> > center.lon + w_deg / 2,
> > center.lat + h_deg / 2);
> > --
> > Cheers,
> > Abhi
> > _______________________________________________
> > Dev mailing list
> > Dev at openlayers.org
> > http://openlayers.org/mailman/listinfo/dev
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Dev