<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Arial Narrow";
        panose-1:2 11 6 6 2 2 2 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"Balloon Text Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Arial Narrow","sans-serif";
        color:windowtext;}
span.BalloonTextChar
        {mso-style-name:"Balloon Text Char";
        mso-style-priority:99;
        mso-style-link:"Balloon Text";
        font-family:"Tahoma","sans-serif";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:856844004;
        mso-list-type:hybrid;
        mso-list-template-ids:83121214 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'>Hi
all<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'>I
will try and explain my problem as best as I can without confusing you. I have
searched the forum&#8217;s but have not found a solution to my problem. I am
trying to implement a toolbar using the control Panel. My toolbar will contain
the following tools:<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'>Zoom
Extent<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'>ZoomBox<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'>Pan<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'>Select
feature<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'>Delete
Feature<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'>Measure<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'>Draw
Point<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'>Draw
polygon<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'>Draw
Line<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'>The
measure tool will be implemented using the &#8220;DrawFeaturePath&#8221; and
the Delete feature using the &#8220;SelectFeature&#8221;. I can successfully assign
the appropriate function to each tool, but cannot seem to get it right in
assigning an appropriate icon through the stylesheet &#8211; i.e Measure icon
always defaults to the DrawFeaturePathItemActive/Inactive icons regardless of
trying to assign it different classes. <o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'>What
do I need to do to assign it a different icon? Also, How do you assign the
default control to your panel? I think my syntax must be incorrect below for &#8220;defaultControl&#8221;.
&nbsp;Below is my code I have implemented:<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'>___________________________________________________<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;
<span style='color:blue'>var</span>&nbsp; zb <span style='color:maroon'>=</span>
<span style='color:blue'>new</span> OpenLayers.Control.ZoomBox({title<span
style='color:maroon'>:</span> <span style='color:green'>&quot;Zoom Box:
Selecting it you can zoom on an area by clicking and draging&quot;</span>});<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;&nbsp;<span
style='color:blue'>var</span> panel <span style='color:maroon'>=</span> <span
style='color:blue'>new</span> OpenLayers.Control.Panel({div<span
style='color:maroon'>:</span>$(<span style='color:green'>'panel'</span>)}<span
style='color:maroon'>,</span>{defaultControl<span style='color:maroon'>:</span>
zb<span style='color:maroon'>,</span><span style='color:green'>'displayClass'</span><span
style='color:maroon'>:</span> <span style='color:green'>'olControlPanel'</span>});
<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;
<span style='color:blue'>var</span> select <span style='color:maroon'>=</span> <span
style='color:blue'>new</span> OpenLayers.Control.SelectFeature(vlayer<span
style='color:maroon'>,</span>{onSelect<span style='color:maroon'>:</span>
onFeatureSelect<span style='color:maroon'>,</span> handlerOptions<span
style='color:maroon'>:</span> {<span style='color:green'>'displayClass'</span><span
style='color:maroon'>:</span> <span style='color:green'>'olControlSelectFeature'</span>
}});<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;
<span style='color:blue'>var</span> mt <span style='color:maroon'>=</span> <span
style='color:blue'>new</span> OpenLayers.Control.DrawFeature(vlayer<span
style='color:maroon'>,</span> OpenLayers.Handler.Path<span style='color:maroon'>,</span>
<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;
{featureAdded<span style='color:maroon'>:</span> ShowMeasureDistance<span
style='color:maroon'>,</span>handlerOptions<span style='color:maroon'>:</span>
{<span style='color:green'>'freehand'</span><span style='color:maroon'>:</span>
<span style='color:blue'>false</span>}<span style='color:maroon'>,</span> <span
style='color:green'>'displayClass'</span><span style='color:maroon'>:</span> <span
style='color:green'>'MeasureTool'</span>});</span><span lang=EN-ZA
style='font-family:"Arial Narrow","sans-serif"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;&nbsp;
<b><span style='color:fuchsia'>// Add a multi-point polygon drawing tool tip
container </span></b><span style='color:fuchsia'><o:p></o:p></span></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;&nbsp;<span
style='color:blue'>var</span> dply <span style='color:maroon'>=</span> <span
style='color:blue'>new</span> OpenLayers.Control.DrawFeature(vlayer<span
style='color:maroon'>,</span> OpenLayers.Handler.Polygon<span style='color:
maroon'>,</span> <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;
{featureAdded<span style='color:maroon'>:</span> handleFeatureAdded<span
style='color:maroon'>,</span>handlerOptions<span style='color:maroon'>:</span>
{<span style='color:green'>'freehand'</span><span style='color:maroon'>:</span>
<span style='color:blue'>false</span>}<span style='color:maroon'>,</span> <span
style='color:green'>'displayClass'</span><span style='color:maroon'>:</span> <span
style='color:green'>'olControlDrawFeaturePolygon'</span>}); <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;
&nbsp;<b><span style='color:fuchsia'>// Add a multi-point line drawing tool tip
container </span></b><span style='color:fuchsia'><o:p></o:p></span></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;
<span style='color:blue'>var</span> df <span style='color:maroon'>=</span> <span
style='color:blue'>new</span> OpenLayers.Control.DrawFeature(vlayer<span
style='color:maroon'>,</span> OpenLayers.Handler.Path<span style='color:maroon'>,</span>
<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;
{featureAdded<span style='color:maroon'>:</span> handleFeatureAdded<span
style='color:maroon'>,</span>handlerOptions<span style='color:maroon'>:</span>
{<span style='color:green'>'freehand'</span><span style='color:maroon'>:</span>
<span style='color:blue'>false</span>}<span style='color:maroon'>,</span> <span
style='color:green'>'displayClass'</span><span style='color:maroon'>:</span> <span
style='color:green'>'olControlDrawFeaturePath'</span>});&nbsp; <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;
&nbsp;<b><span style='color:fuchsia'>// Add a single point drawing tool tip
container </span></b><span style='color:fuchsia'><o:p></o:p></span></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;
&nbsp;<span style='color:blue'>var</span> dp <span style='color:maroon'>=</span>
<span style='color:blue'>new</span> OpenLayers.Control.DrawFeature(vlayer<span
style='color:maroon'>,</span> OpenLayers.Handler.Point<span style='color:maroon'>,</span>
<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;
&nbsp;{featureAdded<span style='color:maroon'>:</span> handleFeatureAdded<span
style='color:maroon'>,</span>handlerOptions<span style='color:maroon'>:</span>
{<span style='color:green'>'freehand'</span><span style='color:maroon'>:</span>
<span style='color:blue'>false</span>}<span style='color:maroon'>,</span> <span
style='color:green'>'displayClass'</span><span style='color:maroon'>:</span> <span
style='color:green'>'olControlDrawFeaturePoint'</span>});</span><span
lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'><o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;
<b><span style='color:fuchsia'>//add selecttodelete tool</span></b><span
style='color:fuchsia'><o:p></o:p></span></span></p>

<p class=MsoNormal><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;
<span style='color:blue'>var</span> seldel <span style='color:maroon'>=</span> <span
style='color:blue'>new</span> OpenLayers.Control.SelectFeature(vlayer<span
style='color:maroon'>,</span>{onSelect<span style='color:maroon'>:</span>
onFeatureSelectDelete<span style='color:maroon'>,</span> handlerOptions<span
style='color:maroon'>:</span> {<span style='color:green'>'displayClass'</span><span
style='color:maroon'>:</span> <span style='color:green'>'DeleteTool'</span> }})<o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Arial Narrow","sans-serif"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;
panel.addControls([ <span style='color:blue'>new</span>
OpenLayers.Control.ZoomToMaxExtent()<span style='color:maroon'>,</span><span
style='color:blue'>new</span> OpenLayers.Control.Navigation()<span
style='color:maroon'>,</span> zb<span style='color:maroon'>,</span> select<span
style='color:maroon'>,</span>mt,dply,df,dp,seldel ]); <o:p></o:p></span></p>

<p class=MsoNormal style='text-autospace:none'><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;&nbsp;<b><span
style='color:fuchsia'>//add panel to map </span></b><span style='color:fuchsia'><o:p></o:p></span></span></p>

<p class=MsoNormal><span style='font-family:"Arial Narrow","sans-serif"'>&nbsp;
map.addControl(panel);<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-ZA style='font-family:"Arial Narrow","sans-serif"'>___________________________________________________<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-ZA><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-family:"Arial Narrow","sans-serif"'>I hope
that all makes sense<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-family:"Arial Narrow","sans-serif"'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-family:"Arial Narrow","sans-serif"'>Regards<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-family:"Arial Narrow","sans-serif"'>Andrew<o:p></o:p></span></p>

</div>

</body>

</html>