[OpenLayers-Users] reproject error

Stephen Davies sdavies at sdc.com.au
Sat Aug 18 17:28:01 PDT 2012


Thanks Andreas.
I didn't find that in the doco and many examples and how-to's still include it.
Removing it leaves me with a working map.

Why is the reproject function still in OpenLayers.js - particularly in a form 
that doesn't work?

Cheers,
Stephen

On Sunday, August 19, 2012 06:46:56 AM Andreas Hocevar wrote:
> The reproject option is deprecated. I strongly recommend to not use
> it. If you still want to, you have to include deprecated.js in your
> build.
> 
> Andreas.
> 
> On Sat, Aug 18, 2012 at 8:03 AM, Stephen Davies <sdavies at sdc.com.au> wrote:
> > I have a layer defined with reproject:true (see below).
> > 
> > This generates a javascript error:
> > 
> > getBoundsFromBaseLayer is not a function.
> > 
> > Openlayers 2.12 stored locally.
> > 
> >               var trk = new OpenLayers.Layer.WMS( "TRK",
> >               
> >                       "http://www.agua.com.au/cgi-bin/mapserv?",
> >                       {map: '/var/www/unit.map',
> >                       
> >                         layers: 'unit',
> >                         format: 'png',
> >                         transparent: 'true',
> >                        
> >                        srs: 'EPSG:4326',
> >                        isBaselayer:false
> >                        },
> >                        {'reproject':true}
> >               
> >               );
> > 
> > Looking in OpenLayers.js I see:
> > 
> > draw:function(){var
> > a=OpenLayers.Tile.prototype.draw.apply(this,arguments);a?
> > (this.layer!=this.layer.map.baseLayer&&
> > this.layer.reproject&&(this.bounds=this.getBoundsFromBaseLayer(this.posit
> > ion)),this.isLoading?this._loadEvent="reload": (this.isLoading=!
> > 0,this._loadEvent="loadstart"),this.positionTile(),this.renderTile()):thi
> > s.unload();return a}
> > --
> > =========================================================================
> > ==== Stephen Davies Consulting P/L                           Phone:
> > 08-8177 1595 Adelaide, South Australia.                               
> > Mobile:040 304 0583 Records & Collections Management.
> > _______________________________________________
> > Users mailing list
> > Users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/openlayers-users

-- 
=============================================================================
Stephen Davies Consulting P/L                           Phone: 08-8177 1595
Adelaide, South Australia.                                Mobile:040 304 0583
Records & Collections Management.


More information about the Users mailing list