source: RebuMKReact/src/Components/Drive/routineMachine.js

Last change on this file was 364f27d, checked in by MetodiMladenovski <meto.18@…>, 14 months ago

added projects and db scripts

  • Property mode set to 100644
File size: 935 bytes
RevLine 
[364f27d]1import React from 'react';
2import L from "leaflet";
3import { createControlComponent } from "@react-leaflet/core";
4import "leaflet-routing-machine";
5
6const createRoutineMachineLayer = (props) => {
7 const instance = L.Routing.control({
8 waypoints: [
9 L.latLng(props.latitudes.startLat, props.latitudes.startLng),
10 L.latLng(props.latitudes.destLat, props.latitudes.destLng)
11 ],
12 lineOptions: {
13 styles: [{ color: "#6FA1EC", weight: 4 }]
14 },
15 createMarker: function() { return null; },
16 show: false,
17 addWaypoints: false,
18 routeWhileDragging: false,
19 draggableWaypoints: false,
20 fitSelectedRoutes: true,
21 showAlternatives: false
22 }).on('routesfound', function(e) {
23 e.sourceTarget._container.outerHTML = "None";
24 });
25 return instance;
26};
27
28
29const RoutingMachine = createControlComponent(createRoutineMachineLayer);
30
31export default RoutingMachine;
Note: See TracBrowser for help on using the repository browser.