2

I want to show the below link in a web page created asp.net. Please answer me in detail how to do this using OpenLayers latest version 3.7.1.

http://192.168.0.123:8080/geoserver/MilkywayWS/wms?service=WMS&version=1.1.0&request=GetMap&layers=MilkywayWS:ISG2&styles=&bbox=8759192.0,1209982.125,8759198.0,1209993.25&width=414&height=768&srs=EPSG:4326&format=application/openlayers&

I am using the code mentioned below to show the WMS Layer using OpenLayers 3

var layers = [ 
  new ol.layer.Tile({ 
    source: new ol.source.MapQuest({ 
      layer: 'sat' }) 
    }), 
  new ol.layer.Image({ 
    extent: [8759192.0, 1209982.125, 8759198.0, 1209993.25], 
    source: new ol.source.ImageWMS({ 
      url: '192.168.0.123:8080/geoserver/MilkywayWS/wms';, 
      params: {'LAYERS': 'MilkywayWS:ISG2'}, 
      serverType: 'geoserver' })
    })
  ];
var map = new ol.Map({ 
  layers: layers, 
  target: 'map', 
  view: new ol.View({ 
    center: [8759195.0, 1209988.175], 
    zoom: 4 
  })
});
  • var layers = [ new ol.layer.Tile({ source: new ol.source.MapQuest({ layer: 'sat' }) }), new ol.layer.Image({ extent: [8759192.0, 1209982.125, 8759198.0, 1209993.25], source: new ol.source.ImageWMS({ url: '192.168.0.123:8080/geoserver/MilkywayWS/wms', params: { 'LAYERS': 'MilkywayWS:ISG2' }, serverType: 'geoserver' }) }) ]; var map = new ol.Map({ layers: layers, target: 'map', view: new ol.View({ center: [8759195.0, 1209988.175], zoom: 4 }) }); – Balakrishnan Aug 6 '15 at 13:05
  • I am using the above script for showing my geoserver WMS layer in a asp.net webpage.but it not works.Please help me. – Balakrishnan Aug 6 '15 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.