[OpenLayers-Users] Measure a Vector layer?

eflow Jonathan.Wolfe at noaa.gov
Tue Apr 19 22:21:00 EDT 2011


Hi,

I can't seem to figure out how to measure a vector layer.

My layer looks like this:

var vectorLayer = new OpenLayers.Layer.Vector("Line Vectors", {
			styleMap : sm,
			eventListeners : {
				"featuresadded" : dataLoaded
			},			
		});
var polygon = new OpenLayers.Control.DrawFeature(vectorLayer, 
						OpenLayers.Handler.Polygon, {
							displayClass : 'polyButton',
							title : 'Add Polygon',
							handlerOptions : {
								style : sty
							}
						});
editPanel.addControls([	polygon ]);

the example here: openlayers.org/dev/examples/measure.html

goes straight to this: 
new OpenLayers.Control.Measure(
                    OpenLayers.Handler.Path, {
                        persist: true,
                        handlerOptions: {
                            layerOptions: {styleMap: styleMap}
                        }
                    } 

How do I get this to work when I defined my polygon vector layer as a
OpenLayers.Control.DrawFeature? Any help would be appreciated.  Thanks!
Jonathan

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Measure-a-Vector-layer-tp6289410p6289410.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110419/5557dfe8/attachment.html


More information about the Users mailing list