[OpenLayers-Users] Bounding Box and Orthographic projection "AUTO2:42003,1,-75.,0."

Joaquín Rodriguez-Guerra Urcelay jrguerra at gmv.com
Wed Mar 2 13:34:51 EST 2011


Hello, 

I dont really know how I solve it, but I start from scratch following the openlayers test page in geoserver, and this code did the trick:

		var map;
            var untiled;
            function init(){

                format = 'image/png';
            
                var bounds = new OpenLayers.Bounds(
                    -7800000, -7800000,
                    7800000, 7800000
                );
                var options = {
                    controls: [],
                    maxExtent: bounds,
                    maxResolution: 60937.5,
                    projection: "AUTO2:42003,1,-75.,0.",
                    units: 'm'
                };
                map = new OpenLayers.Map('map', options);

                // setup single tiled layer
                untiled = new OpenLayers.Layer.WMS(
                    "raster", "http://localhost:8080/cgi-bin/mapserv", 
                    {	
			map: '/opt/fgs/www/htdocs/esfericas/data/esfericas.map',
                        width: '660',
                        crs: 'AUTO2:42003,1,-75.,0.',
                        layers: 'mars_orbital',
                        height: '330',
			version: '1.3.0',
                        styles: '',
                        format: format
                    },
                    {singleTile: true, ratio: 1, isbase: true} 
                );

      
                map.addLayers([untiled,tiled]);
                 map.zoomToExtent(bounds);

}

Regards

Joaquín Rodríguez-Guerra Urcelay

Unidad de Sistemas de Procesamiento de Ciencia y de Observación de la Tierra / Science and Earth Observing Processing Systems Unit

GMV AEROSPACE AND DEFENCE, S.A.
Isaac Newton, 11
P.T.M. Tres Cantos
E-28760 Madrid
Tel. +34 91 807 21 00 / 7695
Fax +34 91 807 21 99
www.gmv.com

________________________________________
De: openlayers-users-bounces at lists.osgeo.org [openlayers-users-bounces at lists.osgeo.org] En nombre de Joaquín Rodriguez-Guerra Urcelay [jrguerra at gmv.com]
Enviado el: miércoles, 02 de marzo de 2011 11:13
Para: users at openlayers.org
Asunto: [OpenLayers-Users] Bounding Box and Orthographic projection     "AUTO2:42003,1,-75.,0."

Dear list,

I am having a bit of troube trying to set the bbox parameter in a wms request.

I want openlayers to request the following url (which works) (image in orthographic projection similar to the ones in http://glmapserver.sourceforge.net/test/layer_test.html)

http://localhost:8080/cgi-bin/mywms?LAYERS=mars_orbital&VERSION=1.3.0&EXCEPTIONS=INIMAGE&SERVICE=WMS&REQUEST=GetMap&STYLES=&FORMAT=image%2Fjpeg&CRS=AUTO2%3A42003%2C1%2C-75.%2C0.&BBOX=-7800000.,-7800000.,7800000.,7800000.&WIDTH=512&HEIGHT=256

But all I can get is this (which does not work)

http://localhost:8080/cgi-bin/mywms?LAYERS=mars_orbital&VERSION=1.3.0&EXCEPTIONS=INIMAGE&SERVICE=WMS&REQUEST=GetMap&STYLES=&FORMAT=image%2Fjpeg&CRS=AUTO2%3A42003%2C1%2C-75.%2C0.&BBOX=-360,-180,360,180&WIDTH=512&HEIGHT=256

The only difference is the bbox parameter. Openlayers keeps requesting BBOX=-360,-180,360,180 when I need BBOX=-7800000.,-7800000.,7800000.,7800000

I dont know how to set the extent, this is what I tried :

        function init(){
            var options = {
                projection: new OpenLayers.Projection("AUTO2:42003,1,-75.,0."),
                units: "m",
                maxExtent: new OpenLayers.Bounds(-7800000,-7800000,7800000,7800000)
            };
            map = new OpenLayers.Map('map',options);
            var ol_wms = new OpenLayers.Layer.WMS(
                "OpenLayers WMS",
                "http://localhost:8080/cgi-bin/mywms",
                {layers: 'mars_orbital',VERSION: "1.3.0"},
                {singleTile: true, ratio: 1});
            map.addLayer(ol_wms);
            map.addControl(new OpenLayers.Control.LayerSwitcher());
            map.zoomToMaxExtent();

Thanks in advance!!

Best regards,

Joaquín Rodríguez-Guerra Urcelay

Unidad de Sistemas de Procesamiento de Ciencia y de Observación de la Tierra / Science and Earth Observing Processing Systems Unit

GMV AEROSPACE AND DEFENCE, S.A.
Isaac Newton, 11
P.T.M. Tres Cantos
E-28760 Madrid
Tel. +34 91 807 21 00 / 7695
Fax +34 91 807 21 99
www.gmv.com

______________________
This message including any attachments may contain confidential
information, according to our Information Security Management System,
 and intended solely for a specific individual to whom they are addressed.
 Any unauthorised copy, disclosure or distribution of this message
 is strictly forbidden. If you have received this transmission in error,
 please notify the sender immediately and delete it.

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
 puede contener informacion clasificada por su emisor como confidencial
 en el marco de su Sistema de Gestion de Seguridad de la
Informacion siendo para uso exclusivo del destinatario, quedando
prohibida su divulgacion copia o distribucion a terceros sin la
autorizacion expresa del remitente. Si Vd. ha recibido este mensaje
 erroneamente, se ruega lo notifique al remitente y proceda a su borrado.
Gracias por su colaboracion.

______________________

_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users

______________________
This message including any attachments may contain confidential 
information, according to our Information Security Management System,
 and intended solely for a specific individual to whom they are addressed.
 Any unauthorised copy, disclosure or distribution of this message
 is strictly forbidden. If you have received this transmission in error,
 please notify the sender immediately and delete it.

______________________
Este mensaje, y en su caso, cualquier fichero anexo al mismo,
 puede contener informacion clasificada por su emisor como confidencial
 en el marco de su Sistema de Gestion de Seguridad de la 
Informacion siendo para uso exclusivo del destinatario, quedando 
prohibida su divulgacion copia o distribucion a terceros sin la 
autorizacion expresa del remitente. Si Vd. ha recibido este mensaje 
 erroneamente, se ruega lo notifique al remitente y proceda a su borrado. 
Gracias por su colaboracion.

______________________



More information about the Users mailing list