Skip to content

Client-side portion of the webmap, rewritten with Leaflet and Vue

License

Notifications You must be signed in to change notification settings

TeamJM/webmap-client

Repository files navigation

JourneyMap Webmap Client

Website Discord API Docs

This repository contains the rewritten client portion of the JourneyMap Webmap. This is now available in JourneyMap as of version 5.7.0!

Screenshot

Due to some technical debt we encountered while working with the Google Maps API, we decided to rebuild the webmap using Vue and Leaflet. We believe that these frameworks will eventually result in something easier to work with (and therefore more maintainable) in comparison to the old webmap.

Please note: This is a development repository. If you're a JourneyMap user, you do not need anything in this repo - everything you need will be included with the JourneyMap mod itself when we make a release.

Contributing

We're huge fans of the open source community, and we're happy to accept pull requests. That said, we would prefer that you join the discord server and have a chat with us about it first. This allows us to cooperate with you and ensure that your PR makes sense, and isn't stepping on anyone else's toes.

Please also take a look at the Code of Conduct before posting an issue, PR or comment.

Working with this project

In order to work with the webmap client, you'll need to set up a few things.

  • OpenJDK 1.8 or later
  • NodeJS 13.1 or later
  • NPM 6.12 or later

In addition, we make use of IntelliJ IDEA - so the project will be geared around that. Feel free to use whatever IDE or editor suits you, we just can't help you with editor-specific issues.

Setting Up

New to Git? Check out the Pro Git book

  1. If you have direct access to the repository, then clone it. If you don't (or you don't know what that means), then click the "Fork" button at the top right to create a fork under your own GitHub account, and clone that.
  2. Create a branch for the changes you're making. Do not push directly to master, even if you're on a fork!
  3. Install the project dependencies using npm install --save.
  4. Install yarn for building npm install -g yarn.

Building

To build a JAR containing a Webpack bundle of the project's assets, simply run gradlew build. Use ./gradlew build on Linux.

Testing

You will need JourneyMap 5.7.0 or later in order to test your changes.

Once you've made your changes, you can tell JourneyMap to load the webmap's static assets from a directory on your filesystem. This will allow you to make changes to the webmap client and simply reload your browser tab to test changes, instead of having to repack everything and restart Minecraft.

In your Minecraft launcher, find the setting that allows you to supply extra arguments and add the following to it, assuming that you've cloned the webmap client to /home/username/webmap-client:

-Djourneymap.webmap.assets_root="/home/username/webmap-client/src/main/resources/assets/journeymap/web"

Note: If you're on Windows, you'll need to use two backslashes in your path instead of one.

Once you've started Minecraft with this argument applied, you should see the following in the console output:

Detected 'journeymap.webmap.assets_root' property, serving static files from: /home/username/webmap-client/src/main/resources/assets/journeymap/web

That's all you need to do. Just head to the full screen map and enable the webmap as usual, and you're good to go!

Testing polygon support

If you need to test polygon support, you can set the journeymap.map_testing property in a similar manner to any value you like, and a button will be added to the full-screen map which will add polygons denoting Minecraft regions to the map. If it doesn't show up, move the map a little and toggle the option a couple times.

-Djourneymap.map_testing="brother, may i have some loops?"

API Documentation

Our REST API has been fully documented! Instead of finding it in this README, you can find the documentation over at Apiary.