[OpenLayers-Users] spherical-mercator

Linda Rawson linda.rawson at gmail.com
Tue Oct 2 14:20:02 EDT 2007


I have the following example partially taken from the
spherical-mercator.html:

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <style type="text/css">
        #map {
            width: 800px;
            height: 475px;
            border: 1px solid black;
        }
    </style>
    <script src="
http://api.maps.yahoo.com/ajaxymap?v=3.0&appid=euzuro-openlayers"></script>
    <script src="../lib/OpenLayers.js"></script>
    <script type="text/javascript">
        var map, layer;

        function init(){

            var options = {
                projection: "EPSG:26919",
                units: "m",
                maxResolution: 156543.0339,
                maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
                                                 20037508, 20037508.34)
            };
            map = new OpenLayers.Map('map', options);

            // create Yahoo layer
            // create Yahoo layer
            var yahoosat = new OpenLayers.Layer.Yahoo(
                "Yahoo Sattelite",
                {'type': YAHOO_MAP_SAT, 'sphericalMercator': true}
            );

            // create WMS layer
            var wms = new OpenLayers.Layer.WMS(
                "World Map",
                "http://world.freemap.in/tiles/",
                {'layers': 'factbook-overlay', 'format':'png'},
                {
                    'reproject': false, 'opacity': 0.4,
                    'isBaseLayer': false,'wrapDateLine': true
                }
            );

map.addLayers([yahoosat, wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
            map.zoomToMaxExtent()
        }

    </script>
  </head>
  <body onload="init()">
    <div id="map"></div>
  </body>
</html>

Notice I changed the projection from EPSG:900913 to EPSG:26919.

When I view the rendered source I see the following line for the WMS layer.

<IMG class=olTileImage id=OpenLayersDiv106 style="FILTER: alpha(opacity=40);
WIDTH: 256px; POSITION: relative; HEIGHT: 256px; alt: OpenLayersDiv106;
opacity: 0.4" src="
http://world.freemap.in/tiles/?LAYERS=factbook-overlay&amp;FORMAT=png&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;STYLES=&amp;EXCEPTIONS=application%2Fvnd.ogc.se_inimage&amp
;SRS=EPSG%3A900913&amp;BBOX=-0.3391999900341034,-20037508.000000003,
20037508.00000001,0.339199997484684&amp;WIDTH=256&amp;HEIGHT=256"
_eventCacheID="OpenLayersDiv106_eventCacheID_107" galleryImg="no"
viewRequestID="2">

How do i get the projection to change for the WMS layer?

Thanks,
Linda Rawson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20071002/22ac1a4b/attachment.html


More information about the Users mailing list