[OpenLayers-Dev] Background Layer in EPSG:900913 causes WMS overlays to fail

Felipe Alcacibar falcacibar at gmail.com
Thu Mar 17 10:53:34 EDT 2011


of course, if have the whole world in, comes in 900913 (is the agreement).
900913 is just ah sphere with wgs84 datum (shortly explanation).

900913 have an alias like 3857

to use the 3857, after you load proj4js, you need to add the following line:
Proj4js.defs["EPSG:3857"]=Proj4js.defs["GOOGLE"];

in the server you don't have nothing to do, EPSG:3857 comes with proj4

Of you have any projection in another srs (as i think) you need to
reproject, you need to reproject (dont misunderstood reproject with
change the srs) the overlay that you are tryng to get to 900913/3857.
i was use mapserver's reprojection on-the-fly, and for measures i
reproject with proj4js with OpenLayers.Projection, you could found lot
of documents of reprojection on the fly with mapserevr,

For the vector layers, you could reproject with OpenLayers.

- Client OpenLayers reprojection example
http://openlayers.org/dev/examples/wfs-reprojection.html

- here appears some of mapserver reprojection
http://docs.openlayers.org/library/spherical_mercator.html

- more info
http://trac.osgeo.org/openlayers/wiki/SphericalMercator


cheers!

Felipe Alcacibar Buccioni


On 17 March 2011 11:24,  <ubalslev at gmail.com> wrote:
> Hi Felipe,
>
> Thank you for the reply.
>
> As far as I know OpenStreetMaps only comes in 900913 as a base layer......
>
> Could you explain in more detail how you managed to solve the problem? How
> does the constructors for the basemap and the WMS over lay look?
>
> regs.
>
> Ulrik
>
> Den 17/03/2011 14.49 skrev Felipe Alcacibar <falcacibar at gmail.com>:
>> when i was starting with google maps, was a annoying issue with the
>>
>> EPSG:900913 srs. but searching i found the EPSG:3857 srs and is the
>>
>> same of 900913 (you should comprobe in your proj4 epsg file if you aer
>>
>> unsure) is the best and transparent solution and all gis that supports
>>
>> epsg srs have it.
>>
>>
>>
>> hope this helps, have a nice day.
>>
>>
>>
>>
>>
>> Felipe Alcacibar Buccioni
>>
>>
>>
>> On 17 March 2011 06:18, Ulrik Balslev ubalslev at gmail.com> wrote:
>>
>> > Hi List,
>>
>> >
>>
>> > I have a problem with an overlay WMS layer not being shown when zooming
>> > in
>>
>> > on the map.
>>
>> >
>>
>> > The problem seem to only occur when using a background WMS Layer in
>>
>> > EPSG:900913.
>>
>> >
>>
>> > I have created a demonstration page available here:
>>
>> >
>>
>> > andarki.dk/Stackoverflow/OpenLayers/WMS.html
>>
>> >
>>
>> > Both maps are identical, except for the background map.
>>
>> >
>>
>> > The left map is using a Background map in EPSG:4326, while the 2nd
>>
>> > background map is using EPSG:900913.
>>
>> >
>>
>> > If you zoom in, you will notice that the Nexrad layer only stays visible
>> > at
>>
>> > the left map.
>>
>> >
>>
>> > There is also a 3rd map, which explicitly sets the map object to use
>>
>> > EPSG:900913, but otherwise is similar to the 2nd map.
>>
>> >
>>
>> > If you look at the two requests being sent to the Nexrad server for the
>>
>> > second map, the BBOX is wrong:
>>
>> >
>>
>> > Request1:
>> > BBOX=-5009557.0848,-90.000000001863,-179.99999999814,5009287.0848
>>
>> >
>>
>> > Request2:
>> > BBOX=-179.99999999814,-90.000000001863,5009197.0848,5009287.0848
>>
>> >
>>
>> > These coordinates (in EPSG:900913) corresponds to Africa, not North
>> > America
>>
>> > as expected.
>>
>> >
>>
>> > Thanks for any input
>>
>> >
>>
>> > Best regards
>>
>> >
>>
>> >
>>
>> > Ulrik Balslev,
>>
>> > breakoutimage, Denmark
>>
>> > _______________________________________________
>>
>> > Dev mailing list
>>
>> > Dev at lists.osgeo.org
>>
>> > http://lists.osgeo.org/mailman/listinfo/openlayers-dev
>>
>> >
>>
>> >
>>
>>


More information about the Dev mailing list