Time for action – using Leaflet with GeoServer layers
Check out the sample code folder for a quick example of Leaflet:
Open
chapter7/index.html
in your favorite browser.Click on the Leaflet basic map example.
Open
/chapter7/leaflet/index.html
and/chapter7/leaflet/map.js
.Review the
map.js
file:var map; function mapinitialize() { counties = new L.TileLayer.WMS(GEOSERVERBASE + "/geoserver/tiger/wms", { layers: "tiger:tl_2011_us_county", format: 'image/png', transparent: true, attribution: "" }); rivers = new L.TileLayer.WMS(GEOSERVERBASE + "/geoserver/NaturalEarth/wms", { layers: "NaturalEarth:50m-rivers-lake-centerlines", format: 'image/png', transparent: true, attribution: "" }); populatedplaces = new L.TileLayer.WMS(GEOSERVERBASE + "/geoserver/NaturalEarth/wms", { layers: "NaturalEarth:ne_50m_populated_places", format: 'image/png', transparent: true, attribution...