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 ?