[OpenLayers-Users] Change cursor onDrag

Waberzeck, Thomas Thomas.Waberzeck at liag-hannover.de
Thu May 10 23:50:26 PDT 2012


Hi,
I need to draw a Line "on drag" - which means by without clicks. I've got this by using the following Code:

                var mydrag=new OpenLayers.Class(OpenLayers.Handler.Drag,{
                    move:function(event){
                            
                        lineLayer.removeAllFeatures();
                        
                        var pa=map.getLonLatFromLayerPx(this.start);
                        pa=new OpenLayers.Geometry.Point(pa.lon,pa.lat);

                        var pb=map.getLonLatFromLayerPx(this.last);
                        pb=new OpenLayers.Geometry.Point(pb.lon,pb.lat);
                        var lin=new OpenLayers.Geometry.LineString([pa,pb]);
                        lin=new OpenLayers.Feature.Vector(lin);
                        lineLayer.addFeatures([lin]);
                        lineLayer.drawFeature(lin);
                    }
                });
                
                mess=new OpenLayers.Control.Measure(mydrag,{
                    immediate:true,
                    getArea:function(){return false}
                });
                    
                map.addControl(mess);

No I need some custom cursors at the time I draw a line. (The line will be drawn to perform some actions). 
Where may I set the cursor? 
I'd be happy if I could change the cursor for the whole map and every action is taken as long as I do not define an other.


Thomas


More information about the Users mailing list