Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

So this seems like it should be super obvious, but I can't for the life of me figure out why I can't get any ESRI layers to show up on my map. I've tried different layers and messing around with the options, but all that happens is that both layer names show up in the layers panel, but only the Google layer actually shows up on the map. Here is the code I'm using:

function addOpenLayers() {
    var mapcenter = new OpenLayers.LonLat(-90.8, 46.45)
    var base = new OpenLayers.Layer.Google("Google Satellite", {type: google.maps.MapTypeId.SATELLITE, numZoomLevels:22});

    var olOptions = {
        controls: [new OpenLayers.Control.PanZoomBar, new OpenLayers.Control.LayerSwitcher, new OpenLayers.Control.Navigation],
    }
    var olMap = new OpenLayers.Map("map", olOptions);

    olMap.addLayer(base);

    olMap.setCenter(mapcenter.transform(
        new OpenLayers.Projection("EPSG:4326"),
        olMap.getProjectionObject()
    ), 10);

    //This is the part that doesn't work:
    var esriRoadsUrl = "http://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/export";
    var esriRoads = new OpenLayers.Layer.ArcGIS93Rest("Roads", esriRoadsUrl, {layers: "0"});
    esriRoads.isBaseLayer = false;

    olMap.addLayer(esriRoads);
};
share|improve this question
    
did u check out from firebug about the problem? –  Aragon Aug 1 '12 at 7:14
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.