Giter Site home page Giter Site logo

gsc-sos.js's Introduction

gsc-sos.js

gsc-sos.js is a JavaScript library that encapsulates calls to a web service with SOS 2.0 implementation. Communication messages are XML formatted. The code is agnostic JavaScript, with no dependencies on other javascript libraries and it has the same 52North SOS client front-end to facilitate integration and evolutive development.

All functions handled the request to capabilities, so it is not necessary call it before any request like "getOffering", "getFeatureOfInterest" or "getObservation”.

gsc-sos.js usage instructions

<!-- minified -->
<script src="../gsc-sos/gsc-sos.min.js"></script>

<!-- debug -->
<script src="../gsc-sos/gsc-sos.debug.js"></script>
var urlService = 'http://server:8080/sosws/service';
var sos = new SOS({ url: urlService, bindingType: SOS.bindingType.XML });
sos.foiFormatter.getFeatureOfInterest({
            spatial: {
                srs: 4326,
                lowerCorner: [-180, -90],
                upperCorner: [180, 90]
            }
        }).then(function (foi) {            
            if (sos.foiFormatter.allowedFOIs.length > 0) {
                var foiID = sos.foiFormatter.allowedFOIs[0].idFOI;
                sos.getOfferingsForFeatureOfInterestId(foiID).then(function (offering) {
                    console.log(offering.length);
                });
            }
        });
sos.getCapabilities().then(function (caps) {
  console.log('caps are in SOS.Capabilities[urlService]');
  sos.getOfferings().then(function (data) {
    console.log('offerings OK');
  });
});
sos.foiFormatter.getFeatureOfInterestByPoint(4326, [42.843, -1.5804], 0.01)
  .then(function (foi) {
    foi = foi || [];
    console.log('getFeatureOfInterestByPoint: ' + fois.length);
  });

Status

The library is under development. Release 0.3.0-beta

To contribute

Please read the contributors' guide.

License

gsc-sos.js is under the GNU GPL version 2.

gsc-sos.js's People

Contributors

glacunza avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.