Skip to content
View loremaps's full-sized avatar

Block or report loremaps

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
loremaps/README.md

LoreMaps

LoreMaps is an attempt to help organize information on fantasy maps.

Interactive atlases for fantasy worlds: pan and zoom across tiled map images, search for places, measure travel distances, overlay a hex or square grid — and open the lore behind every marker, fetched live from the community wikis.

This is a from-scratch rewrite of the original ASP.NET MVC site (aspnet-mvc-live branch) as a fully static site.

Stack

  • Astro — static site generation, zero JS outside the map runtime
  • Leaflet 1.9 — the only runtime dependency; every plugin the old site used (draw, search, sidebar, rastercoords, turf hexgrid) has been replaced with small dependency-free TypeScript modules in src/lib/
  • Map tiles are gdal2tiles XYZ pyramids served from GitHub Pages (same tiles as the old site)
  • POI content is fetched at runtime from MediaWiki APIs via CORS (origin=*) — no JSONP

Develop

npm install
npm run dev       # http://localhost:4321
npm run build     # static output in dist/
npm run preview   # serve dist/
npx astro check   # typecheck

Architecture

Everything is driven by MapDefinition (see src/lib/types.ts): a JSON-serializable description of a map — image size, tile URL, meters-per-pixel scale, POI layers, and a content source. The Leaflet runtime (src/lib/fantasy-map.ts) is map-agnostic and only consumes that shape.

src/maps/          map registry: one MapDefinition per map (faerun, got)
src/lib/           map runtime: raster coords, search, measure, grid, panel, scale, units
src/lib/content/   pluggable content providers (MediaWiki adapter + sanitizer)
public/data/       POI GeoJSON per map; Point coordinates are image pixels [x, y]
src/pages/         landing page + /maps/[id] generated from the registry

Adding a map

  1. Generate an XYZ tile pyramid from your map image (gdal2tiles.py --xyz -p raster ...) and host it anywhere with CORS.
  2. Drop POI GeoJSON files under public/data/<id>/ (Point features, pixel coordinates, a name property per feature).
  3. Add a MapDefinition in src/maps/ and register it in src/maps/index.ts.

Extensibility notes (future work)

  • User-uploaded mapsMapDefinition is plain JSON, so uploaded maps are just stored definitions + tiles; the runtime already renders any definition it is handed.
  • POI content authoring / offline snapshots — implement the ContentProvider interface (src/lib/content/provider.ts) and register the new source type; the wiki adapter is one such provider, a static or user-authored source slots in beside it.
  • Fog of war — the grid overlay shows the pattern: self-contained Leaflet control + layer modules attached in fantasy-map.ts; a fog overlay would be another such module.

Credits

Pinned Loading

  1. loremaps loremaps Public

    LoreMaps source code

    TypeScript 21 8

  2. lhci-cloud-run lhci-cloud-run Public template

    lighthouse ci server on cloud run with litestream

    Dockerfile 8

  3. LoreMaps-Faerun-Tiles LoreMaps-Faerun-Tiles Public

    Faerun map tiles repository

    9 9

  4. minio-js minio-js Public

    Forked from minio/minio-js

    Minio Client SDK for Javascript

    JavaScript

  5. DefinitelyTyped/DefinitelyTyped DefinitelyTyped/DefinitelyTyped Public

    The repository for high quality TypeScript type definitions.

    TypeScript 51.4k 30.4k

  6. realms2vec realms2vec Public

    Forked from YuriyGuts/thrones2vec

    Using Word2Vec to explore semantic similarities between the entities of Forgotten Realms novels

    Jupyter Notebook 1