You still have two map divs:

<div id="map"></div>

It is invalid HTML to have more than one element with id=map". This will 
confuse OpenLayers. And where is the script to load ol3-layerswitcher.js?

The html+javascript from the GeoServer page has a lot of complex 
features. Perhaps start with a simpler page and add functionality 
incrementally?

Kind regards,
Ben.

On 28/12/15 11:02, epyks23 wrote:
> Like this?  index2.html
> <http://osgeo-org.1560.x6.nabble.com/file/n5243038/index2.html>
>
> I am using only one script that loads ol.js
>
> And the layerswitcher.js is defer and inside the body.
>
>
>
>
> --
> View this message in context: 
> http://osgeo-org.1560.x6.nabble.com/Creating-a-legend-in-Geoserver-tp5242993p5243038.html
> Sent from the GeoServer - User mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>

-- 
Ben Caradoc-Davies <[email protected]>
Director
Transient Software Limited <http://transient.nz/>
New Zealand

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to