<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Any ideas?<br>
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.<br>
<br>
Is there another way I can build my toolbar and specify what items to
show? Any existing examples?<br>
<br>
Regards,<br>
Adrian<br>
<br>
On 07/05/2010 03:27 PM, Adrian Popa wrote:
<blockquote cite="mid:4C31CFBD.6090306@romtelecom.ro" type="cite">Hello
everyone,
  <br>
  <br>
Long time no see :)
  <br>
  <br>
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:
  <br>
  <br>
  //overload the EditingToolbar initialize function:
  <br>
    OpenLayers.Control.EditingToolbar.prototype.initialize =
function(layer, options){
  <br>
            OpenLayers.Control.Panel.prototype.initialize.apply(this,
[options]);
  <br>
  <br>
        this.addControls(
  <br>
          [ new OpenLayers.Control.Navigation() ]
  <br>
        );
  <br>
        var controls = [
  <br>
          new OpenLayers.Control.DrawFeature(layer,
OpenLayers.Handler.Point, {'displayClass':
'olControlDrawFeaturePoint'}),
  <br>
          new OpenLayers.Control.Button({ title: "Save changes",
  <br>
                                                  trigger: function() {
  <br>
                                                     
saveStrategy.save();
  <br>
                                                  },
  <br>
                                                  displayClass:
"olControlSaveFeatures"
  <br>
                                                  })
  <br>
        ];
  <br>
        this.addControls(controls);
  <br>
  <br>
    };
  <br>
    editingToolbar = new OpenLayers.Control.EditingToolbar(
editableLayer ) ;
  <br>
    map.addControl( editingToolbar );
  <br>
  <br>
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...
  <br>
  <br>
Any ideas on how to fix this - even as a hack?
  <br>
  <br>
Thanks.
  <br>
  <br>
I attached some small screenshots to illustrate this.
  <br>
  <br>
Regards,
  <br>
Adrian
  <br>
  <br>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@openlayers.org">Users@openlayers.org</a>
<a class="moz-txt-link-freetext" href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a>
  </pre>
</blockquote>
<br>
<br>
</body>
</html>