[OpenLayers-Users] Overlays are displayed only in ESPG:4326 projection

Isus pss47 at yandex.ru
Sat Jun 20 22:48:54 EDT 2009



Isus wrote:
> 
> Hi all!
> When i am trying  to view my vector data from GeoServer with OpenLayers in
> not EPSG:4326 projection (EPSG:28482, EPSG:28483, EPSG:28484 ), only  base
> layer is displayed. In EPSG:4326 all layers are displayed ok. In not
> EPSG:4326, when i looking in Firebug on overlay layer object, there is
> empty innerHtml field. 
> Here is layer creation code:
> 		
> function CreateLayer(min, max, layerName, serverURL, isBase, singleTile)
> {
> 	var wmsParams, layerParams, bBox;
> 	bBox = new OpenLayers.Bounds(min.x, min.y, max.x, max.y);
> 	wmsParams = { 
> 		srs: projection,
> 		layers: layerName,
> 		format: format,
> 		styles: '',
> 		bbox: bBox, 
> 		transparent: true
> 	} ;
> 	if (isBase == true)
> 		layerParams = {
> 			isBaseLayer: true,
> 			singleTile: singleTile,
> 			maxExtent:bBox
> 		};
> 	else
> 		layerParams = {
> 			isBaseLayer: false,
> 			singleTile: singleTile,
> 			opacity:0.5,
> 		};
> 	return new OpenLayers.Layer.WMS(layerName, serverURL, wmsParams,
> layerParams);
> }
> 
> What i am doing wrong?
> 

I am use Proj4js, but it is not help. 
Here is code:

Proj4js.defs["EPSG:28482"] = "+proj=tmerc +lat_0=0 +lon_0=129 +k=1
+x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs
+towgs84=27,-135,-84.5,0,0,0.554,0.2263";

   Proj4js.defs["EPSG:28483"] = "+proj=tmerc +lat_0=0 +lon_0=135 +k=1
+x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs
+towgs84=27,-135,-84.5,0,0,0.554,0.2263";

   Proj4js.defs["EPSG:28484"] = "+proj=tmerc +lat_0=0 +lon_0=141 +k=1
+x_0=500000 +y_0=0 +ellps=krass +units=m +no_defs
+towgs84=27,-135,-84.5,0,0,0.554,0.2263";
 
// "projection" is one of the (EPSG:28482, EPSG:28483, EPSG:28484)
  DestProj = new OpenLayers.Projection(projection);
 
var MapOptions = {
    controls: [],
    maxResolution: 'auto',
    projection: DestProj
    };

map = new OpenLayers.Map( 'map',MapOptions);

It is interesting, that base layer is dislayed in right projection, but
displayed only base layer, all overlays are not displayed. There is no
matter which layer is baselayer, always dislayed only base layer. Only in
4326 all layers are displayed. All my data in geoserver support all my
projections.

May it be a bug?? Can anybody help me? Please

-- 
View this message in context: http://n2.nabble.com/Overlays-are-displayed-only-in-ESPG%3A4326-projection-tp3072387p3127128.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list