For custom tools I use the Identify control, not bundled with OpenLayers:
http://dev.openlayers.org/sandbox/enjahova/openlayers/lib/OpenLayers/Control/Identify.js Example: toolbar.addControl( new OpenLayers.Control.Identify( identify,{ title: 'Point query: click on the map to retrieve the value of the currently selected WFAS dataset.' }),{ iconCls: 'id', toggleGroup: 'map' } ); identify is the name of the function holding your custom identify code. When activated, the control will activate and disable all others. As far as style, thee control's button shows as pushed when active. The toolbar I used is a Mapfish toolbar widget. Alex On Wed, Jan 12, 2011 at 12:47 PM, Brown, Adam <[email protected]> wrote: > Hi All, > > I’ve been trying to find a way to create a custom tool and add it to my > custom navigation toolbar. I want to add an identify tool similar to the > one found in ESRI’s ArcMap. The tool will select a feature and update a div > with information from a .Vector layer. When the tool is activated, I want > the panning and zooming tools to be turned off. Just like when panning is > selected and you choose zoom, the panning tool gets turned off. I also > wanted to know how to modify the CSS to add an “active” and “inactive” style > for this tool. > > I already have the code to select the feature and display its information > (and have tested it via radio button). I also have the –on and –off png for > this tool. I am looking for help or a tutorial on how to define the control > and add it to my navigation panel. > > Any help would be appreciated. Thanks! > > -Adam > > _______________________________________________ > Users mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/openlayers-users > > _______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
