[OpenLayers-Dev] .JPG image in OverviewMap

Jean-Daniel JDG. GONON jdg at geosphere.fr
Thu May 7 03:43:44 EDT 2009

Yes I want to use this idea, so I modify my code like this :


var minimapImgLayer = new OpenLayers.Layer.Image('ImageLayer', 'reference.jpg',

      new OpenLayers.Bounds(extent->minx, extent->miny, extent->maxx, extent->maxy),

      new OpenLayers.Size('150', '150'), {numZoomLevels: '1', alwaysInRange: true} );


var ol_miniMap;

var ol_Map = new OpenLayers.Map('viewport', {

      controls: [ ol_miniMap = new OpenLayers.Control.OverviewMap( {

            mapOptions: {

                  maxExtent: new OpenLayers.Bounds(extent->minx, extent->miny, extent->maxx, extent->maxy),

                  maxResolution: ResolutionMap,

                  projection: ProjectionMap,

                  units: UnitsMap,

                  layers: [minimapImgLayer],

                  numZoomLevels: '1'

            }, size: new OpenLayers.Size('150','150') } ) ],

      maxExtent: new OpenLayers.Bounds(extent->minx, extent->miny, extent->maxx, extent->maxy),

      scales: [NewScalesMap],

      maxResolution: ResolutionMap,

      units: UnitsMap,

      i: szImgFormat,

      tileSize: new OpenLayers.Size('tileWidth','tileHeight'),

      projection: ProjectionMap

}, numZoomLevels = NumberScalesMap );


The reference.jpg image has a resolution of 150*150 pixels.


With this code, I have no error message.

But the overview map display a clone of main map, instead of my JPG image.

I don't know why ..??


Is what someone have an idea of solution ??


Thank you in advance !!





De : XinGang Li [mailto:slinavlee at gmail.com] 
Envoyé : mercredi 6 mai 2009 07:25
À : Jean-Daniel JDG. GONON
Cc : dev at openlayers
Objet : Re: [OpenLayers-Dev] .JPG image in OverviewMap


You can use the OpenLayers.Layer.Image with one zoom level in your overview map, like this:
         var imageLayer = new OpenLayers.Layer.Image(
                new OpenLayers.Size(150, 150),
                {numZoomLevels: 1, alwaysInRange: true}

On Tue, May 5, 2009 at 6:12 PM, Jean-Daniel JDG. GONON <jdg at geosphere.fr> wrote:

For my question :

I can't specify LAYER attribut of overviewMap control, because this JPG image is generated by an admin according wanted layers mapfile's (it's generated when it's necessary) : the wanted layers can change often, so I can't modify LAYER attribute each times.
Selected layers by the admin in the JPG image aren't saved elsewhere.

Zooming function doesn't interrest me : the JPG image has 150*150px resolution, and I want always display the full map in OverviewMap (whatever the scale and the current position in OpenLayers map).
But I want to keep a moving function between OpenLayers map and OverviewMap...

Thank you in advance.



De : Jean-Daniel JDG. GONON 
Envoyé : lundi 4 mai 2009 14:14
À : 'dev at openlayers.org'
Objet : .JPG image in OverviewMap


Hi all,


Is it possible to load a .JPG image in the overview map control ?


In my application, a JPG mini-map is generated by an admin according to layers selected or not.

I want to load this JPG image (with a point to locate the current position), with a fixed size and without zoom function.


Thank you for answers


Dev mailing list
Dev at openlayers.org

Li XinGang
EMail: slinavlee at gmail.com
Blog:   avlee.cnblogs.com
Site:    www.mapboost.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20090507/22c0289b/attachment.html

More information about the Dev mailing list