I am making a WebGIS application for a course and I am trying to integrate some nice base layers like OMS, Stamen, and Bing Maps with my overlay layers that are for Bolivia from a Bolivian map platform. The Bolivian layers are in EPSG:32719 but on geoserver I have reprojected them into EPSG:4326. The base layers are apparently in a different projection but whatever I have tried I cannot get the two to show up together. Using the Blue Marble base layer or the NASA global topography base layer works with the Bolivian layers but not with the nicer base layers that are apparently in EPSG:3857.

I have included the whole source code below.

Carte des risques La Paz, Bolivie

<img src="http://www.unige.ch/presse/charte/logos_unige/Centres/ise/ise70.gif"          width="150" height="88" align="right">

<h1>Risques naturels La Paz El Alto</h1>

    <script type="text/javascript" src="http://maps.stamen.com/js/tile.stamen.js?v1.3.0">
    <script src="http://cdnjs.cloudflare.com/ajax/libs/proj4js/1.1.0/proj4js-compressed.js">
<body style="height:73%;">
    <div style="width:100%; height:100%" id="map">
<div id="description"> Auteurs: Marina de Vasconcelos Pinheiro et Robert Marinkovic     </div>

<script defer="defer" type="text/javascript">
        var map = new OpenLayers.Map('map');
        map.projection = "EPSG:4326";
        map.displayProjection = new OpenLayers.Projection("EPSG:4326"); 

    var bingAPIKey = "AiaY10mQjAFg_MlOyEM0SXWReMtmE1IYA_fRx3d5y5iDNISFbMxxFSJ6r5k56pPR";

    var OSM = new OpenLayers.Layer.OSM("OSM");

    var bingAerialLayer = new OpenLayers.Layer.Bing({
                name: "bing Aerial",
                key: bingAPIKey,
                type: "Aerial"}, {layers: 'basic'}, {'displayInLayerSwitcher':true});       

    var Open_Layers = new OpenLayers.Layer.WMS(
        "OpenLayers WMS",
        {layers: 'basic'}, {'displayInLayerSwitcher':true});

    var Blue_Marble = new OpenLayers.Layer.WMS(
        "Blue Marble",
        {layers: 'basic'}, {'displayInLayerSwitcher':true});

    var Global_Topography = new OpenLayers.Layer.WMS(
        "Global Topography",
        {layers: 'basic'}, {'displayInLayerSwitcher':true});

    var Stamen_Toner = new OpenLayers.Layer.Stamen("toner", {layers: 'basic'}, {'displayInLayerSwitcher':true});    

    var BRGM = new OpenLayers.Layer.WMS("BRGM",
        {transparent:'true'}, {'displayInLayerSwitcher':true});

    var Amenazas_naturales = new OpenLayers.Layer.WMS("Risques Naturels",
        {transparent:'true'}, {'displayInLayerSwitcher':true}); 

    var Limites_Administratives = new OpenLayers.Layer.WMS("Limites Administratives",
        {transparent:'true'}, {'displayInLayerSwitcher':true}); 

    var Rios_La_Paz_El_Alto = new OpenLayers.Layer.WMS("Rivieres La Paz El Alto",
        {transparent:'true'}, {'displayInLayerSwitcher':true}); 

    var Eventos_por_zonas = new OpenLayers.Layer.WMS("Evenements par zone",
        {transparent:'true'}, {'displayInLayerSwitcher':true}); 

    var SAT = new OpenLayers.Layer.WMS("Stations de mesure",
        {transparent:'true'}, {'displayInLayerSwitcher':true});

    var kml = new OpenLayers.Layer.Vector("Université (kml)", {
            projection: map.displayProjection,   
            strategies: [new OpenLayers.Strategy.Fixed()],
            protocol: new OpenLayers.Protocol.HTTP({
                url: "/université.kml", 
                format: new OpenLayers.Format.KML({
                    extractStyles: false,
                    extractAttributes: true,
        visibility: true,
                    maxDepth: 2 

    var overview = new OpenLayers.Control.OverviewMap();

    var scaleline = new OpenLayers.Control.ScaleLine();

    var layer_switcher = new OpenLayers.Control.LayerSwitcher();

    var mouse_position = new OpenLayers.Control.MousePosition();

map.setCenter(new OpenLayers.LonLat(-68.2,-16.5).transform(new OpenLayers.Projection("EPSG:3857"), new OpenLayers.Projection("EPSG:4326")), 10);


1 Answer 1


For OSM and similar maps, the map.projection has to be

projection: new OpenLayers.Projection("EPSG:900913"),

or EPSG:3857 if you prefer.

Just changing the code number to 4326 does not reproject the tiles automatically, but places them into a wrong part of the world. Since Opnelayers can not perform the reprojection on its own, you have to follow the hints given at OpenLayers doesn't show an overlay with a different SRS than the base layer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.