Giter Site home page Giter Site logo

morb0 / space-station-14-map-viewer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juliangiebel/space-station-14-map-viewer

0.0 0.0 0.0 583 KB

A map viewer for Space Station 14

Home Page: https://maps14.tanukij.dev/

License: MIT License

JavaScript 82.34% CSS 4.38% HTML 12.65% Dockerfile 0.64%

space-station-14-map-viewer's Introduction

Space Station 14 map viewer

Requirements

Building

npm install
npm run build

Map Json format

Maps are provided as json files containing the image paths and settings for the different layers. The map selector is populated using the list.json file under maps/list.json The file structure needs to follow the following example:

  • maps
    • list.json
    • {mapid}
      • map.json
      • {image}.png
      • ...
    • {mapid}
    • ...

Example map.json:

{
    "id": "Saltern", //(Must be the same as the folder name)
    "name": "Saltern",
    "grids": [ //Maps can contain multiple grids
        {
            "gridId": "854", //The grid id is used for positioning markers relative to a grid
            "offset": { //Every grid other than the first one is positioned on the map accordng the their offset
                "x": 83.37305,
                "y": -861.07245
            },
            "tiled": false, //Whether the map uses tiles instead of one image (Not yet implemented!)
            "url": "Saltern\\Saltern-0.webp", //The url to the map image used. Can be an external url
            "extent": { //The size of the image in px
                "a": {
                    "x": 0.0,
                    "y": 0.0
                },
                "b": {
                  "x": 4032.0,
                  "y": 2368.0
                }
            }
        }
    ],
    "attributions": null,
    "parallaxLayers": [
        {
            "scale": {
                "x": 0.1,
                "y": 0.1
            },
            "offset": {
                "x": 0.0,
                "y": 0.0
            },
            "static": false, //If a parallax is marked as static it doesn't tile and doesn't use layers
            "minScale": null, //Defaults to 1
            "source": {
                "url": "https://i.imgur.com/3YO8KRd.png",
                "extent": {
                      //The size of the image in px
                      "a": {
                        "x": 0.0,
                        "y": 0.0
                      },
                      "b": {
                        "x": 4032.0,
                        "y": 2368.0
                      }
                }
            },
            "layers": [
                {
                    "url": "https://i.imgur.com/IannmmK.png",
                    "composition": "source-over", //see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/globalCompositeOperation
                    "parallaxScale": {
                        "x": 0.1,
                        "y": 0.1
                    }
                },
                ...
            ]
        }
		{ //A simple parallax layer
			 "scale": {
                "x": 0.1,
                "y": 0.1
            },
            "offset": {
                "X": 0.0,
                "Y": 0.0
            },
            "static": true,
            "minScale": null,
            "source": {
                "url": "https://i.imgur.com/3YO8KRd.png",
                "extent": {
                    //The size of the image in px
                    "a": {
                      "x": 0.0,
                      "y": 0.0
                    },
                    "b": {
                      "x": 4032.0,
                      "y": 2368.0
                    }
                }
            }
		}
    ]
}

list.json

{
	"maps": [
		{"name": "{map name}", "id": "{map id}"},
        ...
	]
}

space-station-14-map-viewer's People

Contributors

juliangiebel avatar morb0 avatar mm-juliangiebel 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.