[OpenLayers-Dev] OpenLayers.Control.PanZoom

christopher.schmidt at nokia.com christopher.schmidt at nokia.com
Fri Jul 15 07:45:49 EDT 2011


On Jul 15, 2011, at 3:26 AM, ext Denis Rykov wrote:

> Hi, devs!
> I've discovered that there are no ways for changing
> OpenLayers.Control.PanZoom control position through CSS.
> What reason for hardcoding image filenames and div sizes instead using
> appropriate css styles? And please add some info about
> OpenLayers.Control.PanZoom.X and OpenLayers.Control.PanZoom.Y to
> documentation.

Denis,

The OpenLayers.Control.PanZoom is an old-style control, which can't be controlled
via CSS. It is maintained only for backwards compatibility with older applications
(Which is why it continues to be the default).

Instead, you should use the OpenLayers.Control.PanPanel and OpenLayers.Control.ZoomPanel;
these are new style 'panels' in OpenLayers, which use CSS for all of their styling.
(You can see an example of changing the look + feel entirely with CSS at
http://openlayers.org/dev/examples/mobile.html , for example.)

So, the answer is: "There is no good reason, other than history, and that's why
we wrote something better" :)

-- Chris

> _______________________________________________
> Dev mailing list
> Dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-dev



More information about the Dev mailing list