Tell me more ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am trying to create a simple openlayers + geoserver map project. And I have a simple code, as following. When I run the project, it works perfectly. But once I zoom in on the map, states wms layer disappears and I can see only Google maps layer. I also added some pictures for reference. Can someone please help?


 
 
Creating a simple map 
 
 
 
 
html, body { 
width: 100%; 
height: 100%; 
margin: 0; 
padding: 0; 
} 

.olLayerGooglePoweredBy.olLayerGoogleV3.gmnoprint {
visibility:hidden;
}
 
 


    function init() {

        var map = new OpenLayers.Map("rcp1_map");

        var wms = new OpenLayers.Layer.Google("Google Streets", {
            numZoomLevels: 20
        }, { isBaseLayer: true });

        var state = new OpenLayers.Layer.WMS("States WMS", "http://localhost:8080/geoserver/wms",
                { layers: "topp:states", format: "image/png", transparent: true },
        {
            isBaseLayer: false
        });

        map.addLayers([wms, state]);

        map.addControl(new OpenLayers.Control.LayerSwitcher());
        map.setCenter(new OpenLayers.LonLat(0, 0), 1);
    } 
 



 
 
 
 


enter image description here

enter image description here

share|improve this question

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.