I have the following code to diplay a WMS layer (in Geoserver) with an OL basemap:
var extent3857 = [-6016334, -2369948, -5843698, -2271608];
var projection3857 = new ol.proj.Projection({
code: 'EPSG:3857',
extent: extent3857,
units: 'm'
});
var baselayer = new ol.layer.Tile({
source: new ol.source.OSM()
});
var wms = new ol.layer.Image({
extent: extent3857,
source: new ol.source.ImageWMS({
url: 'http://localhost:8080/geoserver/Prada/wms?',
params: {'LAYERS': 'Prada:Pradaria', 'STYLE': 'grass'},
serverType: 'geoserver'
})
});
var map = new ol.Map({
layers: [baselayer, wms],
target: 'map',
view: new ol.View({
center: [-5930030, -2316645],
zoom: 10
})
});
And it works fine, the thing is I want to change/replace the basemap for Googlemap. How can I configure the WMS or put the googlemaps as basemap?. There's multiple non-update info sadly (openlayers-2, googlemap-v2, etc.).