[OpenLayers-Dev] Map id

Christopher Schmidt crschmidt at metacarta.com
Wed Feb 27 07:42:39 EST 2008

On Wed, Feb 27, 2008 at 08:23:12AM +0100, Nils Weinander wrote:
> Fr?d?ric Junod:
>  >
>  > This is not not a good idea to control the CSS by using the id
>  > of the html elements: they are generated by a "random" algorithm
>  > and can change. You have guarantees that the id will always be
>  > "OpenLayers.Map_2.
>  >
>  > Your graphics designer should use the CSS class instead.
> This is indeed the case, but
> Christopher Schmidt:
>  >
>  > And if (as is likely the case) the CSS class isn't set on the
>  > element in question, one should be set.
> This is the reason for using the Id. The ZoomBar (the "ladder")
> and the ZoomBar slider are represented by classless <div>-s with
> a background image.

Right. But this is the bug, not the use of a non-useful ID :) (As fred
pointed out.)

Classes should be named things like .olControlPanZoomBarSlider and so on
in order to fit with OL Conventions.

Christopher Schmidt

More information about the Dev mailing list