[OpenLayers-Users] Hoe to set aerial layer and OpenStreemMaps ?

Neil Sonaron neil.sonaron at gmail.com
Mon Jul 20 09:36:55 EDT 2009


Hi everybody,

I'm trying to create a map using some aerial content (like VirtualEarth
layer, worldWind or any WMS layers) and put OpenStreetMaps on top.
My code is:

                map = new OpenLayers.Map( 'map',
                {
                    maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90),
                    numZoomLevels: 16,
                    units: "degrees",
                    projection: new OpenLayers.Projection("EPSG:4326"),
                    displayProjection: new
OpenLayers.Projection("EPSG:4326")
                });

                aerial = new OpenLayers.Layer.VirtualEarth("Aerial", {
                    type: VEMapStyle.Aerial
                });
                aerial.setIsBaseLayer(true);

                sclayer = new OpenLayers.Layer.OSM("OSM",
                "http://tile.openstreetmap.org/", {});
                sclayer.setOpacity(0.5);
                sclayer.setIsBaseLayer(false);

                map.addLayer(aerial);
                map.addLayer(sclayer);


The problem is my OSM layer appears disabled. I can avoid this using put in
the VE layer 'sphericalMercator: true' but seems the tiles positions isn't
the same between the layers.

Any help will be appreciated.


-- 
|-----------------------------------------------------------
| http://www.astracanada.net
| http://acuriousanimal.orggeo.net
|-----------------------------------------------------------
| http://acuriousanimal.blogspot.com
| http://theballoonproject.blogspot.com
|-----------------------------------------------------------
|  _      __
| /_|    (  _  _/'_ _
|(  |.  __)(//)//(/(/()
|                   _/
|-----------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090720/3db81d7a/attachment.html


More information about the Users mailing list