Openlayers设置ESPG900913作为影射算法

Geoserver默认的地图影射方式是EPSG:4326,但是对于常用的WebGIS来说,常用的影射方式是EPSG:900913,下边的代码用来设置openlayers,通知geoserver使用新的映射算法

 

 

var options = {
		projection: new OpenLayers.Projection("EPSG:900913"),
        maxResolution:156543.0339,
        maxExtent: new OpenLayers.Bounds(-20037508.3427892,-20037508.3427892,20037508.3427892,20037508.3427892),
	    units: "m",
        numZoomLevels: 17,
        displayProjection: new OpenLayers.Projection("EPSG:4326"),
	    controls: []
    }
	
	var map = new OpenLayers.Map('map', options);

你可能感兴趣的:(javascript,GIS)