Skip to content

Building from Source

This guide explains how to rebuild the map application and documentation.

Map Application

The map application is a static website with no build step required. Simply edit the source files and refresh your browser.

File Modifications

To Change... Edit This File
Map appearance css/style.css
Map behavior (Leaflet) js/app-leaflet.js
Map behavior (MapLibre) js/app.js
HTML structure index-leaflet.html or index.html
Unit boundaries data/units.geojson
Office locations data/offices.geojson

Adding New Units

To add a new unit to the map:

For Polygon Units (National Forests, Parks, etc.)

Edit data/units.geojson:

{
  "type": "Feature",
  "properties": {
    "name": "New National Forest",
    "agency": "USFS",
    "type": "National Forest",
    "website": "https://www.fs.usda.gov/...",
    "phone": "(555) 123-4567",
    "address": "123 Forest Road, City, ST 12345"
  },
  "geometry": {
    "type": "Polygon",
    "coordinates": [[[lng1, lat1], [lng2, lat2], ...]]
  }
}

For Point Units (Offices, Facilities)

Edit data/offices.geojson:

{
  "type": "Feature",
  "properties": {
    "name": "New District Office",
    "agency": "BLM",
    "type": "District Office",
    "website": "https://www.blm.gov/...",
    "phone": "(555) 123-4567",
    "address": "456 Office St, City, ST 12345"
  },
  "geometry": {
    "type": "Point",
    "coordinates": [longitude, latitude]
  }
}

Coordinate Order

GeoJSON uses [longitude, latitude] order, not [latitude, longitude].

Documentation

Local Preview

# Install dependencies (first time only)
pip install mkdocs mkdocs-material mkdocs-minify-plugin

# Start local server with live reload
mkdocs serve

Open http://localhost:8000 to preview changes.

Build Static Files

mkdocs build

This creates a site/ directory with static HTML files.

Deploy to GitHub Pages

# Build and deploy in one command
mkdocs gh-deploy

This will:

  1. Build the documentation
  2. Push to the gh-pages branch
  3. GitHub Pages will serve from that branch

GitHub Actions (Optional)

You can automate deployment with GitHub Actions. Create .github/workflows/docs.yml:

name: Deploy Documentation

on:
  push:
    branches:
      - main
    paths:
      - 'docs/**'
      - 'mkdocs.yml'

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: '3.x'
      - run: pip install mkdocs mkdocs-material mkdocs-minify-plugin
      - run: mkdocs gh-deploy --force

Updating Data

From Official Sources

Unit boundaries can be obtained from:

Data Processing

Large GeoJSON files can be simplified using:

# Using mapshaper (npm install -g mapshaper)
mapshaper input.geojson -simplify 10% -o output.geojson

# Or using ogr2ogr
ogr2ogr -f GeoJSON -simplify 0.001 output.geojson input.geojson