I have setup two measure controls (distance and area) in my map and each
control has a different display class specified but both controls display
the same button image.  

Below are the relevant code sections:

.olControlMeasureItemInactive {
  background:url("http://niraengineers.com/img/measure16.png";) no-repeat;
  float:left;
  height:18px;
  margin-right:5px;
  width:18px;
}

.olControlMeasureItemActive {
  background:url("http://niraengineers.com/img/measure16.png";) no-repeat;
  border:2px solid #232323;
  float:left;
  height:18px;
  margin-right:5px;
  width:18px;

}

.olControlMeasureAreaItemInactive {
  background:url("http://niraengineers.com/img/measurepoly.png";) no-repeat;
  float:left;
  height:18px;
  margin-right:5px;
  width:18px;
}

.olControlMeasureAreaItemActive {
  background:url("http://niraengineers.com/img/measurepoly.png";) no-repeat;
  border:2px solid #232323;
  float:left;
  height:18px;
  margin-right:5px;
  width:18px;
}

var control_measure = new OpenLayers.Control.Measure(
                        OpenLayers.Handler.Path, {
                                immediate: true,
                                displaySystem: 'english',
                                eventListeners: {
                                        'measure': handleMeasure,
                                        'measurepartial': handleMeasure,
                                        'deactivate': hideDistance
                                },
                                handlerOptions: {
                                        persist: true,
                                        layerOptions: {styleMap: styleMap}
                                },
                                geodesic: true
                        },
                        {displayClass: 'olControlMeasureDistance'}
                )
                
                var control_measure_polygon = new OpenLayers.Control.Measure(
                        OpenLayers.Handler.Polygon, {
                                immediate: true,
                                displaySystem: 'english',
                                eventListeners: {
                                        'measure': handleArea,
                                        'measurepartial': handleArea,
                                        'deactivate': hideDistance
                                },
                                handlerOptions: {
                                        persist: true,
                                        layerOptions: {styleMap: styleMap}
                                        
                                },
                                geodesic: true
                        },
                        
                        {displayClass: 'olControlMeasureArea'}
                )                                



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Duplicate-Measure-Buttons-tp5061435.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
us...@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users

Reply via email to