Skip to content
/ maps Public

UK Ordance Survey maps, supporting multiple styles and points of interest.

License

Notifications You must be signed in to change notification settings

rm-hull/maps

Repository files navigation

UK Ordnance Survey Maps

This is a web application that displays UK Ordnance Survey (OS) maps, supporting multiple map styles, points of interest, and GPS track integration.

By default, the map will center on Ambleside. You can specify a starting location by adding a town name or postcode to the URL, for example:

Leisure Map Leisure Map Style

Roads Map Roads Map Style

Features

  • Multiple Map Styles: Switch between different OS map styles, including Leisure and Roads.
  • Location Search: Search for towns and postcodes across the UK.
  • Points of Interest: Display photos from Geograph as points of interest on the map.
  • GPS Tracking: Show your current location on the map.
  • GPS Route Display: Load and display GPS tracks from GPX and KML files.
  • Measurement Tool: Measure distances on the map.

Key Technologies

  • Framework: React
  • Language: TypeScript
  • Build Tool: Vite
  • Mapping: Leaflet.js, React-Leaflet, maplibre-gl
  • UI: Chakra UI
  • State Management: Jotai
  • Data Fetching: React Query

Running Locally

To run the application locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/r-hull/maps.git
    cd maps
  2. Create an environment file:

    Create a .env file in the root of the project with the following content:

    VITE_OS_DATAHUB_API_KEY=<your OS Datahub API key here>
    VITE_GEOGRAPH_API_KEY=<your Geograph API key here>

    You will need to sign up for free accounts on the OS DataHub and Geograph UK to obtain these API keys.

  3. Install dependencies:

    yarn install
  4. Run the development server:

    yarn dev

    The application will be available at http://localhost:5173 (or the next available port).

Hosting Yourself

This project includes a GitHub Actions workflow to automatically deploy the application to GitHub Pages.

  1. Fork the repository.
  2. Enable GitHub Pages: In your repository settings, under "Pages", set the source to "GitHub Actions".
  3. Create repository secrets: In your repository settings, under "Secrets and variables" > "Actions", create the following secrets:
    • VITE_OS_DATAHUB_API_KEY: Your OS Datahub API key.
    • VITE_GEOGRAPH_API_KEY: Your Geograph API key.

The workflow will then build and deploy the application automatically.

Attribution

License

This project is licensed under the MIT License. See the LICENSE.md file for details.

About

UK Ordance Survey maps, supporting multiple styles and points of interest.

Topics

Resources

License

Stars

Watchers

Forks

Contributors