Time for action – adding a GeoServer cached layer as overlay
Adding a GeoServer cached layer as an overlay is very similar to the other examples, but in this case we will use the GeoWebCache address as a base tile. We will also use the gmap
service:
Open
chapter7/index.html
in your favorite browser.Click on the GeoServer using GWC and the
gmap
service example.Open
/chapter7/google/geoserver_gwcgmap/index.html
and/chapter7/google/geoserver_gwcgmap/map.js
.Review the
map.js
file:var map; function mapinitialize() { //custom base layer options var maptypeOptions = { getTileUrl: function(coord, zoom) { return GEOSERVERBASE + "/geoserver/gwc/service/gmaps" + "?layers=" + CountyLayer + "&zoom=" + zoom + "&x=" + coord.x + "&y=" + coord.y + "&format=image/png"; }, tileSize: new google.maps.Size(256, 256), isPng: true, maxZoom: 15, minZoom: 4, alt: '' }; //Create a custom map with base layer...