Re: [OpenLayers-Users] Help with changing the color of drawn features ?

2010-07-27 Thread Rossko
> return selectedColor; > vector.redraw(); You can't return AND then execute some more code. -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Help-with-changing-the-color

Re: [OpenLayers-Users] Help with changing the color of drawn features ?

2010-07-27 Thread koveras vehcna
Oh I forgot, kamap is the base layer and color selection is called in HTML part. purple blue yellow red orange green -- View thi

Re: [OpenLayers-Users] Help with changing the color of drawn features ?

2010-07-27 Thread koveras vehcna
I fumbled with the controls for a while and then managed to do it the way you proposed, adding the vector.redraw() made it work. But now, when it draws the polygons with the colors I select, now I can't draw polygons -the ones without specifying the number of sides-, lines and points. I can only d

Re: [OpenLayers-Users] Help with changing the color of drawn features ?

2010-07-23 Thread koveras vehcna
I suppose going into the jQuery might turn things around. I'll see if I can do it that way. Again many thanks :) -- View this message in context: http://osgeo-org.1803224.n2.nabble.com/Help-with-changing-the-color-of-drawn-features-tp5328663p5328793.html Sent from the OpenLayers Users mailing li

Re: [OpenLayers-Users] Help with changing the color of drawn features ?

2010-07-23 Thread Piero Campa
But what if the HTML sets it user-defined color, without caring about OpenLayers, and instead is OL itself going to read the color in the HTML div? I mean, from the function inside the context of the style, you read the color. ? With JQuery for example you can do it simply. I just don't know i

Re: [OpenLayers-Users] Help with changing the color of drawn features ?

2010-07-23 Thread koveras vehcna
Hello Piero, many thanks for your reply. I implemented the code you gave me -only applied the styles so far, leaving the strategy for the defaults- however, the HTML part can't reach the function since it is wrenched in the init() part that sets up the map. And when I move the vector and the styli

Re: [OpenLayers-Users] Help with changing the color of drawn features ?

2010-07-23 Thread Piero Campa
Hi Koveras, have you tried: var myFeatures = new OpenLayers.Layer.Vector("myVectors", { styleMap: myStyleMap, strategies: [myStrategy], protocol: etc. } Then: var myStyleMap = new OpenLayers.StyleMap({

[OpenLayers-Users] Help with changing the color of drawn features ?

2010-07-23 Thread koveras vehcna
Hello everyone, I am currently teaching myself OpenLayers and managed to draw Polygons, dots and lines so far. -Along with styling- What I have a hard time figuring out is, is there a way to select the color we want to draw these figures in ? I mean, I have set an HTML Option menu that has some co