[OpenLayers-Users] OverviewMap - outside div?

Jeff Dege jdege at korterra.com
Wed Jul 25 16:37:27 EDT 2007


> From: users-bounces at openlayers.org 
> [mailto:users-bounces at openlayers.org] On Behalf Of Tim Schaub
> Sent: Wednesday, July 25, 2007 2:43 PM
> Cc: users at openlayers.org
> Subject: Re: [OpenLayers-Users] OverviewMap - bad coords?
> 
> Jeff Dege wrote:
> > Now I seem to remember having had a similar problem with KaMap on
the
> > main map, because the default tile size in OpenLayers was 256x256
and in
> > KaMap was 200x200.  Which I fixed by setting the tilesize option to
the
> > OpenLayers.Map constructor.  So I passed a tilesize option to the
> > OverviewMap constructor, and it made no difference.
> 
> Please see the wiki page on the OverviewMap, specifically the section
on 
> custom map options[1].

Yep, that's what I missed.
 
> You'll want to construct your overview map with some non-default 
> options.  Set the mapOptions property of the options object as in the 
> example, and you should get what you want.

But!!!

There are options I'm passing to Map() that I apparently don't want to
pass to OverviewMap.

My first attempt, I created a mapOptions variable, and passed it to both
constructors (as options, in Map(), as options.mapOptions in
OverviewMap.)  That didn't work.

I had been setting Map.scales.  That's inappropriate for OverviewMap.
Letting OverviewMap pick its own scales seems to work fine, but if you
want to force a set of scales, they'll most definitely not be the same
as you're using in the main map.

But one thing I've noticed.

Most controls have the option of being placed either over the map, or in
divs outside the map.  MousePosition, for example, or Scale, or
Permalink, all accept element as on option argument, and create their
own, attached to the map, only if it isn't passed.

OverviewMap does not allow for this.  It only allows the overviewmap to
be drawn over the map itself.

Is there a reason for this?





More information about the Users mailing list