Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <body>
		<textarea id="outDiv" wrap="off" style="margin-top: 5px; width:100%; height: 850px"></textarea>    
</body>
              
            
!

CSS

              
                
              
            
!

JS

              
                

    // creates a new DAB instance with the given endpoint
    var dab =  GIAPI.DAB('http://test.geodab.org/gi-cat-StP','v28daf7005b0640088ff0723c15bed7b9');

    // defines discover response callback function
    var onResponse = function(response){

      // retrieves the result set
      // only one result set is expected (discover not expanded)     
      var resultSet = response[0];

      if(resultSet.error){

        $('#outDiv').append("Error occurred: "+resultSet.error); 
        return;
      }

      // retrieves the paginator   
      var paginator = resultSet.paginator;

      // prints the result set
      $('#outDiv').append("--- Result set ---\n\n");
      $('#outDiv').append("start:"+resultSet.start+"\n"); 
      $('#outDiv').append("size:"+resultSet.size+"\n"); 
      $('#outDiv').append("pageCount:"+resultSet.pageCount+"\n"); 
      $('#outDiv').append("pageIndex:"+resultSet.pageIndex+"\n"); 
      $('#outDiv').append("pageSize:"+resultSet.pageSize+"\n"); 

      // the current paginator page (the first of the result set)    
      var page = paginator.page();

      // printing page nodes
      $('#outDiv').append("\n--- Nodes of first result set page ---\n\n"); 
      $('#outDiv').append("<pre>"); 

      while(page.hasNext()){

        // retrieving the next page node
        var node = page.next();

        // retrieving the node report
        var report = node.report();     

        $('#outDiv').append(JSON.stringify(report,null,4));
      }
      $('#outDiv').append("</pre>");
    };

    // discover constraints
    var constraints = {

      "where": {
        "south": 0,
        "west": -103,
        "north": 35,
        "east": -35
      },

      "when": {
        "from": "2000-01-01",
        "to": "2014-12-12"
      },

      "what": "temperature"               
    };

    constraints = {};

    // setting maximum page size
    var options = {

      "pageSize": 5,
      "spatialRelation" : GIAPI.SpatialRelation.OVERLAPS           
    };

    var onStatus = function(statusList) {

      if(statusList){

        for (var i = 0; i < statusList.length; i++) {
          var s = statusList[i];
          var title = s.title();

          console.log("Title: " + s.title());
          console.log("Message: " + s.message());
          console.log("Phase: " + s.phase());
          console.log("Progress: " + s.progress());
        }
      }
    };

    // start discover
    dab.discover(onResponse, constraints, options, onStatus);


              
            
!
999px

Console