BrookJeynes / slime-rancher-2-interactive-map

An interactive map for Slime Rancher 2.
https://sr2interactivemap.com
24 stars 7 forks source link

[Enhancement] Add teleporter lines / mark teleporter locations #8

Closed BrookJeynes closed 2 years ago

Clearmist commented 2 years ago

I was just reading a few days ago about how to add a polyline. I love the idea of adding the teleporter lines and will try to start figuring it out tomorrow unless @danhannigan knows what I'm talking about and wants to work on it before I get time. :)

Remember to set debug = true (I forgot in which file) so that leaflet console logs a coordinate wherever you double-click and you can use those to build the array of coordinates below.

Looks like we can use:

import { Polyline } from 'react-leaflet';

// Fill this array with as many coordinates as you can.
// More coordinates means a smoother curve!
const polyline = [
  [51.505, -0.09],
  [51.51, -0.1],
  [51.51, -0.12],
];
// Replace "lime" with the hsv or hex representation of the color used in-game.
const lineOptions = { color: 'lime' }';

...

    <Polyline pathOptions={lineOptions} positions={polyline} />
danhannigan commented 2 years ago

Seems straightforward enough; I'd be happy to tinker with it today! Do we have assets for teleporters (for marking the locations)?

danhannigan commented 2 years ago
Screenshot 2022-10-06 at 10 07 26 AM

Used the x marker for now, but check it out - we've got some lines