[OpenLayers-Users] LayerSwitcher

R. Ortner reinhard.ortner at edu.fh-kaernten.ac.at
Thu Nov 15 02:35:29 EST 2007


Hi, 

the color of the layerswitcher is not the problem, the problem is for me to
put it on the left side of my application. (In your posted second link the
layerswitcher is still at default position outside the map).

i tried to change it in the layerswitcher.js and that works basically, but
that is no solution. I need to change it within the html or css.

any ideas?


Richard Duivenvoorde wrote:
> 
> Hi R,
> I think, it is really working as it should:
> 
> If I take the code of the example of:
> http://www.openlayers.org/dev/examples/custom-style.html
> 
> and add a layerswithcher as in
> http://www.openlayers.org/dev/examples/layerswitcher.html
> 
> I can change styles like position etc in a css style blok in the page. 
> There is some style stuff defined in javascript though. The background 
> color of the layerswitcher is defined in LayerSwitcher.js and can be 
> changed by adding an option to the constructor.
> 
> Tips:
> - use firefox and the plugin 
> firebug:https://addons.mozilla.org/en-US/firefox/addon/1843  (!!!)
> with firebug you can not only view the DOM tree, but also debug (with 
> breakpoints), and edit css live (!!).
> - look in the Openlayers source code for clues
> 
> About the background: looking at LayerSwitcher.js you can see that the 
> activeColor-property set to "dark-blue" there. By giving this property 
> to the LayerSwitcher constructor, it changes color;
> 
> map.addControl(new 
> OpenLayers.Control.LayerSwitcher({'div':OpenLayers.Util.getElement('layerswitcher'),activeColor:'green'}));
> 
> But you can off course also roll you own one.
> 
> Richard
> 
> 
> 
> 
> 
> 
> 
> R. Ortner wrote:
>> The problem is, that a change of the entries in the style.css
>> rexpectively my
>> own made style.css have no effect.
>> I tried to change there the color of the background but there was no
>> change
>> respectively the color were overwritten by maybe some hardcoded code.
>> 
>> how can I make the style.css work for that?
>> 
>> 
>> 
>> HuubAtGeodan wrote:
>>> Hi R.
>>>
>>> The position of mapcontrols can be changed by editing and including the 
>>> style.css file in for instance
>>>
>>> .\OpenLayers\theme\default\
>>>
>>>
>>> Regards, Huub
>>>
>>> On 11/13/2007 9:58 AM, R. Ortner wrote:
>>>> Hi,
>>>>
>>>> i tried to change the position of the LayerSwitcher but were not really
>>>> successfully!
>>>> first, I placed the layerswitcher outside the map and I tried to change
>>>> the
>>>> position within the div tag but that had no effect, it still remained
>>>> top
>>>> right.
>>>>
>>>> next, I changed the layerswitcher.js, that worked but is not really a
>>>> good
>>>> solution because it will change the layerswitcher for all applications.
>>>>
>>>> maybe someone can tell me how to change the position of the
>>>> layerswitcher
>>>> at
>>>> best?
>>>> thx
>>>>   
>>> -- 
>>> =====================================
>>> Geodan IT b.v.
>>> Buitenhaven 27-A
>>> 5211 TP 's-Hertogenbosch (NL)
>>> -------------------------------------
>>> Tel: +31 (0)73 - 692 5151
>>> Fax:  +31 (0)73 - 692 5150
>>> Mobiel:
>>> -------------------------------------
>>> Postadres / mailing address
>>> President Kennedylaan 1
>>> 1079 MB Amsterdam (NL)
>>> -------------------------------------
>>> E-mail: huub.fleuren at geodan.nl
>>> Website: www.geodan.nl
>>> Disclaimer: www.geodan.nl/disclaimer
>>> -------------------------------------
>>>
>>>
>>>
>>> _______________________________________________
>>> Users mailing list
>>> Users at openlayers.org
>>> http://openlayers.org/mailman/listinfo/users
>>>
>>>
>> 
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://www.nabble.com/LayerSwitcher-tf4796527.html#a13763013
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list