[OpenLayers-Users] Re: Lat Long as units for zoomify layer

Albert Ang bluesky003 at gmail.com
Sun Apr 24 21:54:39 EDT 2011


Dear Bojan,

thank you for sharing your experience. I have successfully created the
overview map based on the code shared by other OpenLayers users. As for the
pixel bounds with map bounds conversion which you mentioned in (1) which can
display lat / long coordinates, can you share your coding so that I can take
a look?

Thank you and best regards.

Albert Ang

On Mon, Apr 25, 2011 at 2:29 AM, Бојан <crni.bombarder.17.45 at gmail.com>wrote:

> I don`t have direct answer for your problem,but I can share my expirience
> on this topic.
>
> 1)I tried various combinations for this,but i haven`t made it posible.So I
> solved this problem with simple bypass.I created function which combines
> pixels bounds with my map bounds and after conversion displays lat/lon
> coordinates,instead of pixel ones.
> 2)For this I also created a bypass.Basicly,this code worked for me (already
> posted it here<http://osgeo-org.1803224.n2.nabble.com/zoomify-layer-WITH-overview-map-td5534360.html#a5850568>
> ):
> Used variables:
>
>                 var width = ...;         //Your Zoomify width
>                 var height = ...;       //Your Zoomify height;
>                 var ll = ...;              //Optional number to reduce your
> original pixel to fit Overview map container (I used Math.floor(width/150),
> since my container is 150 x 110)
>                 var a = width/ll;
>                 var b = height/ll;
>
>
>
> New layer and new control:
>
>
>
>            var NameOfOverviewMap = new OpenLayers.Layer.Image(
>                 'NameOfOverviewMap',
>                 OverviewMapUrl,
>                 new OpenLayers.Bounds(0, 0, width, height),
>                 new OpenLayers.Size(a, b),
>                 { numZoomLevels: 1,
>           maxExtent: new OpenLayers.Bounds(..., ..., ..., ...)
>                 }
>                );
>
>             var NameOfOverviewMapControl = new
> OpenLayers.Control.OverviewMap({
>                  size: new OpenLayers.Size(150, 110),    //This is
> optional,you may use default values
>                 layers: [NameOfOverviewMap]
>         });
>
> At last,adding it to the map:
>
>                         map.addControl(NameOfOverviewMapControl);
>
>
> 3)Basicly,function used in 1) can be used for transforming pixels into
> lat/lon and vice versa.
>
> Maybe it is posible to do these things automaticly,but I haven`t found
> working code and I solved it this way.
> Bojan
> !!!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110425/c19a8ed6/attachment.html


More information about the Users mailing list