Axe Layer

In this example below you will see how to do a Axe Layer with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by fpape, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright fpape ©

Technologies

  • HTML
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>Axe Layer</title>
  
  
  
  
  
</head>

<body>

  <html lang="en">
  <head>
    <link rel="stylesheet" href="https://openlayers.org/en/v3.18.2/css/ol.css" type="text/css">
    <style>
      .map {
        height: 100%;
        width: 100%;
      }
    </style>
    <script src="https://openlayers.org/en/v3.18.2/build/ol.js" type="text/javascript"></script>
   </head>
  <body>
     <div id="map" class="map"></div>  
  </body>
</html>
  
  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/fpape/axe-layer-yaXKyG */

var url = 'http://axe.geodab.eu/geodab-gi-axe/services/wms?protocol=urn:ogc:serviceType:WebMapService:1.1.1:HTTP&linkage=http://disc1.sci.gsfc.nasa.gov/daac-bin/wms_airs&name=AIRX3STD_SURFSKINTEMP_D&';
var name = 'AIRX3STD_SURFSKINTEMP_D';

var params = {
  'LAYERS': name,
  'TRANSPARENT': 'true'
};

var map = new ol.Map({
   target: 'map',
   
   layers: [
     
     new ol.layer.Group({
             'title' : 'Base maps',
             layers : [
               
               new ol.layer.Tile({
                 title : 'Water color',
                 type : 'base', 
                 visible : false,
                 source : new ol.source.Stamen({
                     layer : 'watercolor'
                 }),
                 wrapX : false
             }), new ol.layer.Tile({
                 title : 'OSM',
                 type : 'base',
                 visible : true,
                 source : new ol.source.OSM(),
                 wrapX : false
             })]
         }),
     
     new ol.layer.Tile({      
       title: name,
       source: new ol.source.TileWMS({
         url: url,
         ratio: 1,
         params: params
       })    
     })
     
     
   ],
   
   view: new ol.View({
     center: ol.proj.fromLonLat([37.41, 8.82]),
     zoom: 1
   })
 });

Comments