OL_3_WMS
Base on http://openlayers.org/en/v3.12.1/doc/quickstart.html
HTTP only !
by Thibault Coupin
HTML
<link rel="stylesheet" href="http://openlayers.org/en/v3.12.1/css/ol.css">
<script src="http://openlayers.org/en/v3.12.1/build/ol.js"></script>
<script src="https://getfirebug.com/firebug-lite.js"></script>
<div id="map" class="map"></div>
CSS
.map {
height: 80%;
width: 100%;
border: solid;
}
JavaScript
var sourceWMSAddress = new ol.source.ImageWMS({
url: "http://wxs.ign.fr/wnow33wqimoktpt0unhgwo0m/inspire/v/wms",
params: {
LAYERS: "BU.Building,TN.RoadTransportNetwork,TN.RailTransportNetwork,AD.Address"
}
})
var mLayer = new ol.layer.Image({
source: sourceWMSAddress
}) ;
var map = new ol.Map({
target: 'map',
layers: [
/* new ol.layer.Tile({
source: new ol.source.MapQuest({
layer: 'sat'
})
}),*/
mLayer
],
view: new ol.View({
center: ol.proj.fromLonLat([2.424, 48.845]),
zoom: 10
})
});