[OpenLayers-Users] Control background-image

Richard Greenwood richard.greenwood at gmail.com
Fri Dec 25 10:46:42 EST 2009


Answering my own question - you would use displayClass to override the
image as documented at:
http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Control/Button-js.html

Happy holidays!
Rich


On Thu, Dec 24, 2009 at 9:44 AM, Richard Greenwood
<richard.greenwood at gmail.com> wrote:
> I have two OpenLayers.Control.DrawFeature controls in my panel. One
> draws a Polygon, the other a regular polygon. So I want to have
> different button background-images for the two buttons, but they both
> are getting the background-image defined by the
> .olControlDrawFeatureItemInactive class.
>
> I (think) I have assigned a unique id to the two controls:
>
>      new OpenLayers.Control.DrawFeature(lyrVectors,
>            OpenLayers.Handler.RegularPolygon,
>            {handlerOptions: {sides: 24}, title: 'Draw a circle.', id:
> 'drawEllipse'}),
>      new OpenLayers.Control.DrawFeature(lyrVectors,
>            OpenLayers.Handler.Polygon,
>            {title: 'Draw a polygon. Double click when done.', id: 'drawPoly'}),
>
> and in my .css I am attempting to use the id to assign a unique
> background-image:
>
>    div#drawPoly {
>       background-image: url("../graphics/polygon.gif");
>    }
>
> I may be going about this in completely the wrong way. Any help is appreciated.
>
> Thanks,
> Rich
>
> --
> Richard Greenwood
> richard.greenwood at gmail.com
> www.greenwoodmap.com
>



-- 
Richard Greenwood
richard.greenwood at gmail.com
www.greenwoodmap.com



More information about the Users mailing list