Skip to content
Permalink
Browse files

add santas route

  • Loading branch information
colbyfayock committed Dec 11, 2019
1 parent 1b63610 commit 3b0c08f066212ff32c82d3df2a13d1419da8ac41
Showing with 22 additions and 0 deletions.
  1. +22 −0 src/pages/index.js
@@ -56,6 +56,28 @@ const IndexPage = () => {
// Add Santa to the map!

santaMarker.addTo(leafletElement);

// Create a set of LatLng coordinates that make up Santa's route

const santasRouteLatLngs = destinationsWithPresents.map(destination => {
const { location } = destination;
const { lat, lng } = location;
return new L.LatLng( lat, lng );
});

// Utilize Leaflet's Polyline to add the route to the map

const santasRoute = new L.Polyline( santasRouteLatLngs, {
weight: 2,
color: 'green',
opacity: 1,
fillColor: 'green',
fillOpacity: 0.5
});

// Add Santa to the map!

santasRoute.addTo(leafletElement);
}

const mapSettings = {

0 comments on commit 3b0c08f

Please sign in to comment.
You can’t perform that action at this time.