I have connected my GeoServer to my OpenLayers website and it seems like something is wrong about the connection.

I added a WMS layer in JavaScript like this:

actual code

But when I load the page the result is this:


When I use layer switcher, when I turn this layer on(visible) everything else goes white.

When I turn this layer's visibility off I get all the other layers according to plan.

Supposing that I use everywhere else in the map projection 900913, what could be my mistake?

What is wrong is that I can't see my other layers, the base layers etc?

Please if you need any additional information I will provide as soon as possible.

  • 1
    I think your 'layers' parameter specifies to only show the 1 'linestring' layer, isn't that right? Oct 6, 2014 at 22:06
  • 2
    I notice in some code of mine I have 'transparent': 'true'. A fellow developer advised me to put quotes around 'transparent'. Alternatively you might be able to leave the property out all together as I think it's the default value. Oct 6, 2014 at 23:50
  • @mapBaker My friend thanks for your answer. The thing is I am pretty new to coding and I don't know this specific thing you are talking about. I tried to use layer without quotes and the same thing happens.Projection is all good it is exactly where is supposed to be, just the other tiles will go white.
    – drizo
    Oct 7, 2014 at 5:51
  • @drunkenwagoner My friend, thanks for answering. So you are suggesting that I use quotes around transparent? If that is so, I have already done that and nothing changes.
    – drizo
    Oct 7, 2014 at 5:52

3 Answers 3


Check your coordinates in these layers. Maybe they don't match on each other and you are switching from one system to another with layer switching...

I am not sure what are your WMS made of. Is that blue line a vector? If it is raster it can cover all other layers (it has no transparency) with white border we see around line (maybe it has defined boundaries same as projection boundingbox).

Try to lower opacity of that one layer - maybe you will see layers behind. Or try to flip places of your layers to the "3rd 2nd 1st" - if it acts like a layer group, its order can be important.

  • my friend thanks for answering. It seems like changing the order won't affect it at all, it stays the same with white tiles everywhere. I ahve checked the defined boundaries and they are the same as projection bounding box, you think that this is the problem ? How should I change them?
    – drizo
    Oct 7, 2014 at 5:56

Check your Geoserver Layer Setup.

Open the WMS layer and go to the Publishing Tab ..

There is a check box under WMS Settings labeled Opaque, make sure that this is unchecked.

  • Thanks for your answer. I checked it out and opaque is unchecked. So I don't think that this is the problem.
    – drizo
    Oct 7, 2014 at 5:48
  • I would remove the quotes from true on the transparency, it is supposed to be evaluated as a boolean, and may look like a string value .. Oct 7, 2014 at 6:41

OK, so I figured out what is wrong!

I needed to change the position of the transparent statement like this:


Notice that transparent statement has gone in the above bracket.

Thanks everybody for participating!

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.