[OpenLayers-Users] OpenLayers with 900913 projection and drupal OpenLayers module

Gery . gamejihou at hotmail.com
Wed Jan 9 15:14:20 PST 2013



>                  "Peru WMS",

cool =)
__________________________________________________________________________________________
Piensa en el medio ambiente - mantenlo en la pantalla. NO lo imprimas si NO es necesario.
Think green - keep it on the screen. Do NOT print if it is NOT necessary.
Denken Sie an die Umwelt - bewahren Sie es auf dem Bildschirm. Drucken Sie NICHT, wenn es NICHT notwendig ist.


> Date: Wed, 9 Jan 2013 17:57:53 -0500
> From: woodbri at swoodbridge.com
> To: openlayers-users at lists.osgeo.org
> Subject: Re: [OpenLayers-Users] OpenLayers with 900913 projection and drupal OpenLayers module
> 
> On 1/9/2013 5:49 PM, Alexander Kocisky wrote:
> > Hi all,
> >
> > I've set up a Geoserver/PostGIS infrastructure in order to render a
> > database of GIS information. Initially i was working with the projection
> > 4326 but when i've installed Drupal + OpenLayers i've realized that
> > there are almost no tiles with this projection, the way to go seems the
> > projection 900913.
> >
> > So i've converted all my gis objects to 900913, verified that i could
> > see the rendered points in the geoserver Layer Preview with OpenLayer
> > and tried to add the WMS layer to my map created with Drupal Openlayer
> > module.
> >
> > It apparently works but it fetches a bound box that is wrong, in fact if
> > i modify manually the request urls (from the browser) i get the correct
> > data. I need to understand better how this bounded box works, how is it
> > initially set? i guess that for each png image downloaded there is a
> > specific BBOX parameter, is this done by the Openlayers library?
> >
> > I've also explained the issue on the drupal openlayers module but
> > apparently it was never really tested with WMS 900931 (weird right?) .
> > The module works well with the same configuration and the 4326
> > projection (http://drupal.org/node/1884422).
> >
> > Please let me know if you have any suggestion.
> > Thanks!!
> >
> > Alex
> 
> Alex,
> 
> I think you need to post how the OL map and layer objects are defined or 
> post a link to your site if it is public.
> 
> More than likely you have left off something like: SphericalMercator: true
> 
> 
> Here is what I use:
> 
>              map = new OpenLayers.Map('map', {
>                  maxResolution: 156543.0339/2,
>                  numZoomLevels: 18,
>                  units: 'm',
>                  maxExtent: new OpenLayers.Bounds(-20037508.34, 
> -20037508.34, 20037508.34, 20037508.34),
>                  sphericalMercator: true,
>                  projection: epsg900913,
>                  displayProjection: epsg4326,
>                  controls:[
>                      new OpenLayers.Control.LayerSwitcher(),
>                      // new OpenLayers.Control.OverviewMap(),
>                      new OpenLayers.Control.Permalink('permalink'),
>                      new OpenLayers.Control.MouseToolbar(),
>                      new OpenLayers.Control.MousePosition(),
>                      new OpenLayers.Control.PanZoomBar(),
>                      new OpenLayers.Control.Scale(),
>                      new OpenLayers.Control.ScaleLine()
>                  ]
>                  });
> 
>              var wms = new OpenLayers.Layer.WMS(
>                  "Peru WMS",
>                  "http://server/cgi-bin/mapserv?",
>                  { map: "/u/data/mydata/peru4.map",
>                    format: "image/png",
>                    layers: "Peru4_4326_WMS"
>                  },
>                  {
>                    sphericalMercator: true,
>                    transitionEffect: 'resize',
>                    singleTile: true,
>                    ratio: 1.0
>                  });
>              wms.addOptions({isBaseLayer: true});
>              wms.setVisibility(false);
>              map.addLayer(wms);
> 
> -Steve
> _______________________________________________
> Users mailing list
> Users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/openlayers-users
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130109/68d696b5/attachment.html>


More information about the Users mailing list