Giter Site home page Giter Site logo

raineydavid / os-data-hub-api-demos Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ordnancesurvey/os-data-hub-api-demos

0.0 0.0 0.0 281 KB

OS Data Hub demos and code examples

License: Apache License 2.0

HTML 26.45% JavaScript 63.54% CSS 10.01%

os-data-hub-api-demos's Introduction

OS Data Hub API Demos

This repo contains working examples of how to use some of the products provided by the OS Data Hub. The OS Data Hub is a service providing access to Ordnance Survey data as part of the Open MasterMap Implementation Programme.

Please note that the OS Maps API provided by the OS Data Hub is separate from the OS Maps API for Enterprise. For help with OS Maps API for Enterprise see the separate API docs and demos.

Software requirements

All of the examples work with current web browsers. Internet Explorer is not supported.

The airports example also requires Node.JS.

Using the demos

Each of the demos needs an API key to access the OS Data Hub APIs.

Register for API keys using the OS Data Hub:

  • Sign up to the OS Data Hub, and create a project
  • Add both the OS Maps API and OS Features API to your project
  • Copy the API key from the project page

OS Features API, OS Maps API and OS Vector Tile API examples

These examples are relatively simple, and are a good place to start understanding how to integrate the OS Data Hub APIs into a web application.

These examples use plain HTML, CSS and JavaScript. You can run them by opening the index.html in each folder, or you can serve the examples using a web server, for example live-server.

Airports example

The airports example is a little more complex. It displays a map provided by the OS Maps API, and overlays the map with features loaded from the OS Features API. We search for features that are airports within the current extent of the map, and draw the feature geometry on top of the map. Each airport is clickable, allowing you to see the additional feature properties that were returned from the WFS query.

The airports example uses a small server to serve the web application and to act as a proxy for the OS Data Hub APIs. This proxy allows you to embed an API key into the server without exposing the API key to the end users of the application. To run the sample, install Node.JS and then run the following commands from the Airports directory:

npm install
npm start <API key>

Note: A production application would need to add extra protection to the server, to ensure that the only people able to make API calls through the proxy are legitimate users of your application. Failure to do so would allow malicious users to make API requests with your API key, even though they do not have direct access to it.

License

These demos are released under the Apache 2.0 License

os-data-hub-api-demos's People

Contributors

mattlovett avatar michaelgordon avatar gussmith21 avatar emeliaszor avatar afrazer-os avatar pjgeng avatar jameslmilner avatar nmeys avatar u12910 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.