I have a measurement control on an OpenLayers map which allows the user to (unsurprisingly) measure lines and areas on the map. They draw the line/area they want, OpenLayers does the measurements calculations and I draw the feature they drew back on to the map with the measuremets, like this.
var feature = new OpenLayers.Feature.Vector(geom_var, attributes, style_var); //Add features to layer measure.getLayer().layer.addFeatures([feature]);
This works fine, you can try it yourself by going to http://explorer.geowessex.com and right clicking on the map and choosing Measure Line (or Measure Area). Then just draw a line (or area) and double click to finish and get the results. You will then get a popup with the measurement results and you can also get the results again at any time by hovering over the feature. You can then click on it for more info and options to get rid of the annotation.
My problem is that the line that is being drawn is really hard to hover over. The areas are fine, its just lines, especially (it seems) if you draw a perfectly horizontal line. Try it yourself and you should (hopefully) see what I mean. Trying to move the mouse to the correct position so that the hover tooltip comes up is really difficult sometimes. Does anyone know if there is any way to make this easier to click, without making the width of the line massive. Thanks!