epyks23, in Tile.html, your brackets do not match. You have an extra "}" after 'Marine:Great_Britain'. Please use an editor that matches brackets and turn on the JavaScript error console in your browser to tell you the location of syntax errors.
In GetFeature_example.html, you have a missing "," after "serverType: 'geoserver'" making the JavaScript syntactically invalid. Once this comma is added, clicking on the map makes a successful GeoFeatureInfo request with results written to <div id="info"> as expected. Kind regards, Ben. On 04/01/16 11:59, epyks23 wrote: > Hi, > > The L seems to be a variable that sets the basemap. When I remove the L, the > basemap disappears. > (I want to use the esri basemap but for now I am going to try and focus on > getting the layers to appear on the map). > > I used the map code from > http://openlayers.org/en/v3.12.1/examples/wms-tiled.html > <http://openlayers.org/en/v3.12.1/examples/wms-tiled.html> > > and I created this: Tile.html > <http://osgeo-org.1560.x6.nabble.com/file/n5243537/Tile.html> > (for now I am going to put the JavaScript inside the HTML to keep myself > organized). > I added a layer from Geoserver but it is not showing up. > > I tried the GetFeatureInfo with the topp:states but the layer does not show > up GetFeature_example.html > <http://osgeo-org.1560.x6.nabble.com/file/n5243537/GetFeature_example.html> > > > > -- > View this message in context: > http://osgeo-org.1560.x6.nabble.com/layerswitcher-js-and-adding-vector-data-from-Geoserver-tp5243249p5243537.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
