BlueMap-Minecraft / BlueMap

A Minecraft mapping tool that creates 3D models of your Minecraft worlds and displays them in a web viewer.
https://bluecolo.red/bluemap
MIT License
1.87k stars 128 forks source link

Feature request: Messure distances between points #523

Closed KvaGram closed 6 months ago

KvaGram commented 6 months ago

I'm thinking a feature like Google Maps have. On google maps, you may right-click on any point on the map, opening the context menu, and select "measure distance". Next you select another point, right click again, and can select "distance to here". Now you have a line and a distance between then on screen.

This is a useful tool to find the distance between places.

My usecase for this: I'm what some might call insane. I am building really long overworld roads on my server. I need good tools to plan them properly, and to calculate the distance in road from a given point, to a location of interest, in order to make accurate signs.

TechnicJelle commented 6 months ago

I actually made an addon like this a while ago! It's not as polished as what you're asking for, but it does work! Here's the link: https://gist.github.com/TechnicJelle/6ae16856e8060b3bd9142c6d6dcbe3d2 It's not a normal plugin or mod, so the installation process is a bit different: First, you need to download the file (or copy the code into a new text file manually) Then you need to put it inside BlueMap's web folder. You will find that in your server's root, in the bluemap folder. It should be the same place as the index.html file. Then you need to register the file with BlueMap, which you do by editing webapp.conf. Then find the scripts section and add it:

scripts: [
    "BlueMapDistanceMeasurer.js"
]

I hope this will be useful to you! Feel free to edit this script further to polish it up more! This was mostly just a proof of concept.

KvaGram commented 6 months ago

Nice, that tool is halfway there, judging by the video. Definitely wanna try it out. But before I do, I need to know: What are the controls, though? How do I activate or deactivate the feature on the front-end? I wouldn't want to install a proof of concept feature that overwrites normal left-right click behavior for the other users. If I did that, the other moderators might get mad at me :)

TechnicJelle commented 6 months ago

It's always active, but it doesn't override anything. It just adds a small white line between the last two places you left-clicked.

Activating and deactivating the feature is indeed one of the things I didn't bother adding, back then. It shouldn't be that hard to do, though. Well.. if you want an actual right-click menu, then it will be a bit harder.

But maybe you can change the controls from being "just left click any block" to a button in the (left-click) popup that appears when you click any block? Or maybe when you press the space bar, it toggles on/off?

Oh and what did you mean with "judging by the ."? Is that sentence unfinished? :p

KvaGram commented 6 months ago

The video, sorry.

TBlueF commented 6 months ago

Closing as Feature-Requests are meant to go into our Discord, not to GitHub. (See Contributing Guidelines) :)