Commit #637, "add cursor property in Feature.Vector" from pgiraud, with

minor modification: because features by default do nothing at all, change
the default cursor property (keep it at null) so that users aren't confused
when clicking has no affect. Thanks for the patch.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@3040 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-04-10 10:19:13 +00:00
parent 6ffc672436
commit df65488d3a
3 changed files with 11 additions and 1 deletions

View File

@@ -277,7 +277,8 @@ OpenLayers.Feature.Vector.style = {
pointRadius: 6, pointRadius: 6,
hoverPointRadius: 1, hoverPointRadius: 1,
hoverPointUnit: "%", hoverPointUnit: "%",
pointerEvents: "visiblePainted" pointerEvents: "visiblePainted",
cursor: "pointer"
}, },
'temporary': { 'temporary': {
fillColor: "yellow", fillColor: "yellow",

View File

@@ -130,6 +130,7 @@ OpenLayers.Renderer.SVG.prototype =
style = style || node.olStyle; style = style || node.olStyle;
options = options || node.olOptions; options = options || node.olOptions;
if (node.geometry.CLASS_NAME == "OpenLayers.Geometry.Point") { if (node.geometry.CLASS_NAME == "OpenLayers.Geometry.Point") {
node.setAttributeNS(null, "r", style.pointRadius); node.setAttributeNS(null, "r", style.pointRadius);
} }
@@ -152,6 +153,10 @@ OpenLayers.Renderer.SVG.prototype =
if (style.pointerEvents) { if (style.pointerEvents) {
node.setAttributeNS(null, "pointer-events", style.pointerEvents); node.setAttributeNS(null, "pointer-events", style.pointerEvents);
} }
if (style.cursor) {
node.setAttributeNS(null, "cursor", style.cursor);
}
}, },
/** /**

View File

@@ -174,6 +174,10 @@ OpenLayers.Renderer.VML.prototype =
} }
stroke.setAttribute("opacity", style.strokeOpacity); stroke.setAttribute("opacity", style.strokeOpacity);
} }
if (style.cursor) {
node.style.cursor = style.cursor;
}
}, },