[OpenLayers-Users] Canvas renderer causing fill in style, map, to be ignored

Robert Hicks robhyx at gmail.com
Mon Aug 6 16:01:29 PDT 2012


Yeah, I understand that. What I need to be able to do is be able to change the renderer like with a setter. I tried vectorLayer.renderer = new OpenLayers.Renderer.Canvas(vectorLayer.renderer.container.id); but I get an error (this.container is null).

I stepped through the Canvas.js file and it appears that the fill color is there for each feature but for some reason style.fill is false for every feature after the first one. So I get one polygon filled in but the rest are empty. I don't know why this would happen, as I'm not even setting that boolean in my style map.

On Aug 6, 2012, at 3:27 PM, Mike Ryan wrote:

> Hi Rob,
> 
> When you specify that array of renderers, I believe you are specifying your *preference* of renderer. You put your first choice first, etc. If that choice is not available, then it tries the next one, etc. 
> 
> Does that help?
> 
> -Mike
> 
> On 8/1/2012 3:00 PM, openlayers-users-request at lists.osgeo.org wrote:
>> Message: 2
>> Date: Wed, 1 Aug 2012 09:30:42 -0400
>> From: Rob Hyx <robhyx at gmail.com>
>> To: openlayers-users at lists.osgeo.org
>> Subject: Re: [OpenLayers-Users] Canvas renderer causing fill in style,
>> 	map,	to be ignored
>> Message-ID:
>> 	<CAF-PjvzhYiE-MwmxX+OaVzwPB+E4gqs4WHYPBHpyXZ-QS+QN4Q at mail.gmail.com>
>> Content-Type: text/plain; charset=ISO-8859-1
>> 
>> Okay, let me take back what I said last. Adding the additional
>> renderers ['SVG,'VML,'Canvas'], does fix my problem, but now when I go
>> to use the Canvas renderer it's not vectorLayer.renderer. Instead I
>> get the SVG renderer. I see an array vectorLayer.renderers but that's
>> just an array of Strings. I'm looking at the API and it is not obvious
>> to me how you can pick your renderer of choice. It seems you must be
>> able to do it otherwise why would you be able to specify more than
>> one.
>> 
>> Any ideas?
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20120806/8a45ee55/attachment.html>


More information about the Users mailing list