AW: [OpenLayers-Users] Using a vector style with polygon breaks map

Sarah Schuessler sarah_flip at yahoo.de
Wed Apr 6 16:25:15 EDT 2011


Hi Robert,

I looked at your solarenergie tab and I can see all polygons, map isn`t broken. 
Or did I misunderstood your issue?

best regards
Sarah




________________________________
Von: Robert Buckley <robertdbuckley at yahoo.com>
An: users at openlayers.org
Gesendet: Mittwoch, den 6. April 2011, 21:36:06 Uhr
Betreff: [OpenLayers-Users] Using a  vector style with polygon breaks map


Hi,

In my app I have a polygon vector layer which won´t take on a simple style.  
If I leave the styleMap config in the mappanel empty the default style is 
applied without a problem.

This is the only polygon vector layer in the app and the other point styles work 
fine.

http://maps.zgb.de:8080/geoserver/www/testing/wea.html

In the solarenergie tab when the style is activated the whole map is broken.

Code for the simple style:

var style_solar = OpenLayers.Util.extend({}, 
OpenLayers.Feature.Vector.style['default']);
                    style_solar.fillOpacity = 0.2;
                     style_solar.graphicOpacity = 1;


Layer code:

var layer_solar = new OpenLayers.Layer.Vector("Solarenergie", {
                    styleMap: 'style_solar',
                    projection: "EPSG:4326",
                    strategies: [new OpenLayers.Strategy.Fixed()],
                    protocol: new  OpenLayers.Protocol.WFS({
                        url: "http://maps.zgb.de:8080/geoserver/wfs?",
                        version: "1.1.0",
                        featureType: "SG_gen_solarkopf_wgs84",
                        featureNS: "http://www.zgb.de/postgis",
                        srsName: "EPSG:4326"
                    }),
                    eventListeners: {
                        featuresadded: function(){
                            var extent_solar = layer_solar.getDataExtent()
                              mapPanel_solar.map.zoomToExtent(extent_solar);
                            
                        }
                    }
                });


cheers,

Rob



can anyone point me in the right direction?

yours,

Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110406/0c82ded0/attachment-0001.html


More information about the Users mailing list