openlayers - Wrong projection for vector layer with http protocol -


i'm using openlayer geoserver.

i want create vector layer sends viewparams geoserver layer, done wms .

however :

           var newlayer = new openlayers.layer.vector('layer',                 {                strategies: [new openlayers.strategy.fixed({preload: true})]                , projection: new openlayers.projection("epsg:4326")                 ,protocol: new openlayers.protocol.http({                url:"/geoserver/ows?service=wfs&version=2.4.0&request=getfeature&typename=wg:layer&maxfeatures=50&outputformat=json&viewparams=uid:"+id,     format: new openlayers.format.geojson()   }),                stylemap: new openlayers.stylemap({                     'default': new openlayers.style(null, {                         rules: [                             new openlayers.rule({                                 symbolizer: {                                     graphic: false,                                     label: "name",                                     labelselect: true,                                     fontstyle: 'italic'                                 }                             })                         ]                     })                 })});  

this work problem feature projection wrong .!

while use same projection on other wms layers. problem :

1- openlayers.protocol.http

or

2-openlayers.projection("epsg:4326")

and there way send param without using http protcol ?


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -