[OpenLayers-Users] How to change style['select'] in OL 2.6

Arnd Wippermann arnd.wippermann at web.de
Sat Apr 5 13:13:31 EDT 2008


Hi,

First, a great compliment to all the developers of OL. And best, only some
easy changes needed to update own applications from 2.5 to 2.6.

But some behaviour I'm used to in 2.5, I could not solve for 2.6.

In OL 2.5 I do this to draw red features and draw select features in yellow:

    OpenLayers.Feature.Vector.style['select']['fillColor']    = 'yellow';
    OpenLayers.Feature.Vector.style['select']['strokeColor']  = 'yellow';

    var layer_style = OpenLayers.Util.extend({},
OpenLayers.Feature.Vector.style['default']);

    style_red = OpenLayers.Util.extend({}, layer_style);
    style_red.strokeColor = "red";
    style_red.fillColor   = "red";

    vector = new OpenLayers.Layer.Vector("Editable Vectors", {style:
style_red});


With OL 2.6 I have no luck. The features will drawn in red, but the selected
features are also in red.

How can I change the default style for selected features in OL 2.6?


With OL 2.6 the SelectFeatureControl allows to edit the vertices. I would
like the previous behaviour. 

Is there a way to disable the edit function for the SelectFeatureControl?


And last. Also a compliment for solving the problem with the flickering of
the Google layers, but is there a reason that OL sticks to only 19
zoomlevels for the Google layer? Google have 22 zoomlevels and especially
for where I come from (Wuppertal), it's possible to get images for
zoomlevels > 19. I use this patch to get all levels:

OpenLayers.Layer.Google.prototype.RESOLUTIONS =
[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.0219726562
5,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,0.000686
6455078125,0.00034332275390625,0.000171661376953125,0.0000858306884765625,0.
0000429153442382812,0.0000214576721191406,0.0000107288360595703,0.0000053644
1802978516,0.00000268220901489258,0.00000134110450744629,6.70552253723145e-7
,3.35276126861572e-7];
OpenLayers.Layer.Google.prototype.MAX_ZOOM_LEVEL = 22;


Mit freundlichen Grüssen

Arnd Wippermann
http://gis.ibbeck.de/ginfo/





More information about the Users mailing list