[OpenLayers-Users] adding buttons to OL UI
slyon
skylar at ccri.com
Tue Sep 16 16:09:59 EDT 2008
Thank you for the clarification!
Eric Lemoine-3 wrote:
>
> Hi. Control.Button creates buttons, not toggles; so ItemActive isn't
> used, only ItemInactive is. Eric
>
> 2008/9/16, slyon <skylar at ccri.com>:
>>
>> Eric,
>>
>> Thanks for the help... really got me on my way. I do have another inquiry
>> though, if you have the time...
>>
>> I've been following the panel.html example that you directed me toward,
>> and
>> while helpful, I can't get the xyzItemActive and xyzItemInactive aspect
>> of
>> the buttons to toggle. In my style.css code I have:
>>
>> .GeneralButtonItemActive {
>> width: 130px;
>> height: 30px;
>> background-image: url("../img/generalSelected.png");
>> }
>>
>> .GeneralButtonItemInactive {
>> width: 130px;
>> height: 30px;
>> background-image: url("../img/generalUnselected.png");
>>
>> }
>>
>> When the page loads the ItemInactive button is displayed. I expected this
>> in
>> looking at the OL docs:
>> http://dev.openlayers.org/releases/OpenLayers-2.6/doc/apidocs/files/OpenLayers/Control/Button-js.html
>>
>> Do I need to write separate code for the ItemActive button to be
>> displayed
>> when clicked? I don't see any such code in the panel.html example. I
>> appreciate any help, hints, or feedback.
>>
>> Thanks again,
>> Skylar
>>
>>
>>
>>
>>
>> Eric Lemoine-3 wrote:
>>>
>>> Hi
>>>
>>> If i had to do that i'd create two button controls (i.e. two instances
>>> of Control.Button), one per baselayer, and add them to a panel (an
>>> instance of Control.Panel).
>>>
>>> To create a button you'd use something like that:
>>>
>>> var button = new OpenLayers.Control.Button({trigger: function() {
>>> map.setBaseLayer(yourBaseLayer1); }});
>>>
>>> To create a custom panel look at the panel.html example.
>>>
>>> Hope this helps.
>>> --
>>> Eric
>>>
>>> 2008/9/12, slyon <skylar at ccri.com>:
>>>>
>>>> Howdy all,
>>>>
>>>> I've got two baselayers in my OL map currently. Instead of them
>>>> displaying
>>>> in the LayerSwitcher I'd like to add two buttons to the map that
>>>> correspond
>>>> to the baselayers. Is this easily done? I've been searching the forums,
>>>> but
>>>> haven't found much.
>>>>
>>>> So, if anyone can tell me how to add buttons to the map that I can tie
>>>> to
>>>> the baselayers that would be very helpful.
>>>>
>>>> Thanks,
>>>> Skylar
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/adding-buttons-to-OL-UI-tp19460603p19460603.html
>>>> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>>>>
>>>> _______________________________________________
>>>> 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/adding-buttons-to-OL-UI-tp19460603p19510554.html
>> Sent from the OpenLayers Users mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> 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/adding-buttons-to-OL-UI-tp19460603p19519608.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list