[OpenLayers-Users] Custom EditingToolbar displays the wrong button icon

Adrian Popa adrian_gh.popa at romtelecom.ro
Tue Jul 6 03:23:13 EDT 2010


Any ideas?
I thought of changing the icon for the button (as a hack), but the 
trouble is - I need to add two buttons and both of them display the same 
icon - so I can't use that approach.

Is there another way I can build my toolbar and specify what items to 
show? Any existing examples?

Regards,
Adrian

On 07/05/2010 03:27 PM, Adrian Popa wrote:
> Hello everyone,
>
> Long time no see :)
>
> I want to add a "save" button to my editingToolbar (which was 
> customized) in order to manually save changes. I am using the 
> following code:
>
>   //overload the EditingToolbar initialize function:
>     OpenLayers.Control.EditingToolbar.prototype.initialize = 
> function(layer, options){
>             OpenLayers.Control.Panel.prototype.initialize.apply(this, 
> [options]);
>
>         this.addControls(
>           [ new OpenLayers.Control.Navigation() ]
>         );
>         var controls = [
>           new OpenLayers.Control.DrawFeature(layer, 
> OpenLayers.Handler.Point, {'displayClass': 'olControlDrawFeaturePoint'}),
>           new OpenLayers.Control.Button({ title: "Save changes",
>                                                   trigger: function() {
>                                                       
> saveStrategy.save();
>                                                   },
>                                                   displayClass: 
> "olControlSaveFeatures"
>                                                   })
>         ];
>         this.addControls(controls);
>
>     };
>     editingToolbar = new OpenLayers.Control.EditingToolbar( 
> editableLayer ) ;
>     map.addControl( editingToolbar );
>
> Everything works as expected, but there is only one problem. In the 
> toolbar I get instead of the "save_features_off.png" icon the "move" 
> icon.  Playing with firebug I can see that the active CSS for the 
> toolbar (.olControlEditingToolbar) overrides 
> ".olControlSaveFeaturesItemInactive" and overrides the image. If I 
> disable the background-image statement from .olControlEditingToolbar I 
> can see the save icon. Most likely the move icon is on top of the save 
> icon...
>
> Any ideas on how to fix this - even as a hack?
>
> Thanks.
>
> I attached some small screenshots to illustrate this.
>
> Regards,
> Adrian
>
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>    


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100706/615633f4/attachment.html


More information about the Users mailing list