From 0379e028ba411704f2adcee31c3f13501fb75c77 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Tue, 3 Mar 2009 23:56:09 +0000 Subject: [PATCH] Adding support for backgroundWidth and backgroundHeight properties on symbolizers. If not provided, background graphics are rendered with graphicWidth and graphicHeight values (or pointRadius if not provided). r=ahocevar (closes #1968) git-svn-id: http://svn.openlayers.org/trunk/openlayers@8947 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Feature/Vector.js | 2 ++ lib/OpenLayers/Renderer/Elements.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/OpenLayers/Feature/Vector.js b/lib/OpenLayers/Feature/Vector.js index 16bc662efc..d148d5eded 100644 --- a/lib/OpenLayers/Feature/Vector.js +++ b/lib/OpenLayers/Feature/Vector.js @@ -336,6 +336,8 @@ OpenLayers.Feature.Vector = OpenLayers.Class(OpenLayers.Feature, { * backgroundGraphicZIndex - {Number} The integer z-index value to use in rendering the background graphic. * backgroundXOffset - {Number} The x offset (in pixels) for the background graphic. * backgroundYOffset - {Number} The y offset (in pixels) for the background graphic. + * backgroundHeight - {Number} The height of the background graphic. If not provided, the graphicHeight will be used. + * backgroundWidth - {Number} The width of the background width. If not provided, the graphicWidth will be used. * display - {String} Symbolizers will have no effect if display is set to "none". All other values have no effect. */ OpenLayers.Feature.Vector.style = { diff --git a/lib/OpenLayers/Renderer/Elements.js b/lib/OpenLayers/Renderer/Elements.js index 39eb4fa10f..2914b5cc0d 100644 --- a/lib/OpenLayers/Renderer/Elements.js +++ b/lib/OpenLayers/Renderer/Elements.js @@ -573,6 +573,8 @@ OpenLayers.Renderer.Elements = OpenLayers.Class(OpenLayers.Renderer, { backgroundStyle.graphicXOffset = backgroundStyle.backgroundXOffset; backgroundStyle.graphicYOffset = backgroundStyle.backgroundYOffset; backgroundStyle.graphicZIndex = backgroundStyle.backgroundGraphicZIndex; + backgroundStyle.graphicWidth = backgroundStyle.backgroundWidth || backgroundStyle.graphicWidth; + backgroundStyle.graphicHeight = backgroundStyle.backgroundHeight || backgroundStyle.graphicHeight; // Erase background styles. backgroundStyle.backgroundGraphic = null;