[OpenLayers-Users] reproject error

Andreas Hocevar ahocevar at opengeo.org
Sun Aug 19 03:24:20 PDT 2012


Hey,

it does work if you really want to use it. All you need to do is load
deprecated.js in addition to OpenLayers.js. The reason why deprecated
things are still in the library is backwards compatibility, and since
2.12 you need to load deprecated.js for these things to still work.
You'll find further explanations in the release notes:
https://github.com/openlayers/openlayers/blob/master/notes/2.12.md#deprecated-components

Andreas.

On Sun, Aug 19, 2012 at 2:28 AM, Stephen Davies <sdavies at sdc.com.au> wrote:
> 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.



-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.


More information about the Users mailing list