I am trying to add wms layer over osm using openlayers 3.my code for simple osm layer is :
Now where and how to add the code for adding wms layerShall be the code like this:
var myLayer = new ol.layer.Tile({ extent: [76.62294921875,23.169921875,78.62294921875,25.169921875], preload: Infinity, visible: true, source: new ol.source.TileWMS(({url: 'http://127.0.0.1:8080/geoserver/bhuvan/wms',params: {'LAYERS': 'WORKSPACE:bhuvan', 'TILED': true, 'VERSION': '1.1.0', 'FORMAT': 'image/png', 'WIDTH': 768, 'HEIGHT': 768, 'CRS': 'EPSG:4326'},serverType: 'geoserver'})) }); map.addLayer(myLayer);I am a total newbie to this. How to fix it? How the code should look like?
أكثر...
Now where and how to add the code for adding wms layerShall be the code like this:
var myLayer = new ol.layer.Tile({ extent: [76.62294921875,23.169921875,78.62294921875,25.169921875], preload: Infinity, visible: true, source: new ol.source.TileWMS(({url: 'http://127.0.0.1:8080/geoserver/bhuvan/wms',params: {'LAYERS': 'WORKSPACE:bhuvan', 'TILED': true, 'VERSION': '1.1.0', 'FORMAT': 'image/png', 'WIDTH': 768, 'HEIGHT': 768, 'CRS': 'EPSG:4326'},serverType: 'geoserver'})) }); map.addLayer(myLayer);I am a total newbie to this. How to fix it? How the code should look like?
أكثر...