[OpenLayers-Users] Re: Lat Long as units for zoomify layer
Albert Ang
bluesky003 at gmail.com
Fri Apr 15 22:05:53 EDT 2011
> Dear all,
>
> I like to seek advice on using the zoomify layer. I'll using a satellite
> image and I know the lat long of this image. I like to ask the following
> questions :
>
> 1) Is it possible to set latitude / longitude (degree decimals) as unit for
> the zoomify layer instead of pixels?
> 2) is it possible to have a small overview window for zoomify layer?
> 3) how to code it so that the map zoom to a particular lat / long?
>
> Below are my code snipplet.
>
> Thank you very much and best regards.
>
> Albert Ang
>
> <script type="text/javascript">
>
> var zoomify_width = 4645;
> var zoomify_height = 4915;
> var zoomify_url = "SPOT5_20110223/";
>
> var map, zoomify;
>
> function init(){
> /* First we initialize the zoomify pyramid (to get number of tiers)
> */
> var zoomify = new OpenLayers.Layer.Zoomify( "Zoomify",
> zoomify_url,
> new OpenLayers.Size( zoomify_width, zoomify_height ) );
>
> /* Map with raster coordinates (pixels) from Zoomify image */
> var options = {
> controls: [],
> maxExtent: new OpenLayers.Bounds(0, 0, zoomify_width,
> zoomify_height),
> maxResolution: Math.pow(2, zoomify.numberOfTiers-1 ),
> numZoomLevels: zoomify.numberOfTiers,
> units: 'pixels'
> };
>
> map = new OpenLayers.Map("map", options);
> map.addLayer(zoomify);
>
> map.addControl(new OpenLayers.Control.MousePosition());
> map.addControl(new OpenLayers.Control.PanZoomBar());
> map.addControl(new OpenLayers.Control.MouseDefaults());
> map.addControl(new OpenLayers.Control.KeyboardDefaults());
>
> map.setBaseLayer(zoomify);
> map.zoomToMaxExtent();
> };
>
> </script>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110416/510c87c5/attachment.html
More information about the Users
mailing list