[OpenLayers-Users] projections/resolution/extents

FCampos fcampos at efacec.pt
Thu Aug 7 08:41:48 EDT 2008


Hi Christopher .
I really need to understand this because i´m having troubles shownig a map,
and i think this maybe the problem.

I´ve a mapserver with 3 layers (2 oracle 1 shape).

With the following code, my oracle layers only show zoom 0 and 1.
The shape file show in every zooms.

I was thinking that is a mapserver, but i random try a resolution and
finnaly i see something in zoom 0 and 1.

in mapserver i´ve got EXTENT -180 -90 180 90
But with a export of qgis it gives me a 
EXTENT -448507.794215 -314818.265947 491449.524215 290499.415448

what unit is this ?? not lat/lon ?

i´m confused !



		  map = new OpenLayers.Map( 'map',  
											{
												controls: [
														 new OpenLayers.Control.Navigation(), 
							                             new OpenLayers.Control.PanZoomBar()], 
											} );
            var basemap = new OpenLayers.Layer.WMS.Untiled( "MS 4.10", 
                "http://172.18.210.67:8080/cgi-bin/mapserv.exe?",
                {map: '/ms4w/apps/wmssrvrefer/ora.map', layers:
'country,Cont_Freg_CAOP2008_HG73,streets', format: 'png', 'transparent':
'off'},
                {
					maxResolution: 10000 , 
					projection:"EPSG:4326" } 
				);
            map.addLayers([basemap]);
			map.setCenter(new OpenLayers.LonLat(-8, 39.5), 0);








Christopher Schmidt-4 wrote:
> 
> On Thu, Aug 07, 2008 at 05:12:10AM -0700, FCampos wrote:
>> 
>> Hi,
>> is there anywhere, a good tutorial for :
>> 
>> - what extents in mapserver, and what is the consequence in the
>> resolution /
>> extent/ scales of openlayers ? 
> 
> Resolution is "map units per pixel". By default, OpenLayers uses a
> maxExtent of: 
> 
>   -180,-90,180,90
> 
> It uses a default maxResolution of:
> 
>   1.40625
> 
> Which means that each tile is:
> 
>   1.40625 * 256 -> 360 map units (degrees)
> 
> Scales are never important to OpenLayers, but you can display them
> (using OpenLayers default DOTS_PER_INCH of 72) using the
> OpenLayers.Control.Scale(), which allows you to use those values in
> other tools like SLD or Mapfiles.
> 
> To pick a good maxResolution, generally taking your map extent and
> dividing by 256 or 512 is a good start. You can also set maxResolution
> "auto" -- this will divide the extent by the size of your map in the
> larger direction, fitting your map tiles exactly (at the cost of using
> different URLs for different map sizes, and therefore avoiding caches
> and not working with things like TileCache).  
> 
> Regards,
> -- 
> Christopher Schmidt
> MetaCarta
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
> 
> 

-- 
View this message in context: http://www.nabble.com/projections-resolution-extents-tp18869013p18869558.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list