Advertisement
tungSfer

Untitled

Apr 3rd, 2022
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { latitude, longitude } from './Locations';
  2. var truck = L.icon({
  3.     iconUrl:
  4.         'https://s...content-available-to-author-only...n.net/v/t1.15752-9/274303140_486217459624427_7423855428849770381_n.png?_nc_cat=110&ccb=1-5&_nc_sid=ae9488&_nc_ohc=_BNcEq5HufwAX9HmVP9&_nc_ht=scontent.fhan5-8.fna&oh=03_AVKiHJ03VXmQP5i3Q9QGG_Y0WtAOgdPtO5SJGIHM5UAr3w&oe=626416CF',
  5.     iconSize: [30, 40],
  6. });
  7. var greenBin = L.icon({
  8.     iconUrl:
  9.         'https://s...content-available-to-author-only...n.net/v/t1.15752-9/274180814_2024737961027798_4029408788282239182_n.png?_nc_cat=110&ccb=1-5&_nc_sid=ae9488&_nc_ohc=dwuFAVSD6EwAX_WEMSs&tn=UIEpDxDqmkxUKWpR&_nc_ht=scontent.fhan5-8.fna&oh=03_AVK_zwH2nMDeiJjIIbqWtQXZWcTxz1KXbsYig1dy1IEpvg&oe=62610860',
  10.     iconSize: [30, 40],
  11. });
  12. var yellowBin = L.icon({
  13.     iconUrl:
  14.         'https://s...content-available-to-author-only...n.net/v/t1.15752-9/274728106_651673209125563_3080891151811528082_n.png?_nc_cat=107&ccb=1-5&_nc_sid=ae9488&_nc_ohc=UkYDs-1nnm0AX8WERnk&_nc_ht=scontent.fhan5-6.fna&oh=03_AVJXQsoVHTL2CrvvhpvPk6VkDa0ukZ59FnQKNnurOndsng&oe=6264515B',
  15.     iconSize: [30, 40],
  16. });
  17. var redBin = L.icon({
  18.     iconUrl:
  19.         'https://s...content-available-to-author-only...n.net/v/t1.15752-9/274681202_1354205045055853_5026569908981328898_n.png?_nc_cat=106&ccb=1-5&_nc_sid=ae9488&_nc_ohc=R6bVEAYhUrEAX9pMz7m&_nc_ht=scontent.fhan5-3.fna&oh=03_AVLtGZlWQo2uKa_M0tUX43QCjznWz-IQ_Jcb7gnMWJ25Rg&oe=62623A3A',
  20.     iconSize: [30, 40],
  21. });
  22. const dataBin = [
  23.     { lat: 20.987526381534117, long: 105.73999171331396, status: 1 },
  24.     { lat: 20.930963734979255, long: 105.71729415333051, status: 2 },
  25.     { lat: 20.949091602509764, long: 105.75703004499327, status: 3 },
  26.     { lat: 20.93735915800732, long: 105.7832296926063, status: 1 },
  27.     { lat: 20.99087066391052, long: 105.7963953771713, status: 2 },
  28. ];
  29. let i = 0;
  30. var bin;
  31. const html_script = `
  32. <!DOCTYPE html>
  33. <html lang="en">
  34.     <head>
  35.         <meta charset="UTF-8" />
  36.         <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  37.         <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  38.         <title>Document</title>
  39.  
  40.         <link
  41.             rel="stylesheet"
  42.             href="https://u...content-available-to-author-only...g.com/leaflet@1.7.1/dist/leaflet.css"
  43.             integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A=="
  44.             crossorigin=""
  45.         />
  46.  
  47.         <link
  48.             rel="stylesheet"
  49.             href="https://u...content-available-to-author-only...g.com/leaflet-routing-machine@latest/dist/leaflet-routing-machine.css"
  50.         />
  51.  
  52.         <link
  53.             rel="stylesheet"
  54.             type="text/css"
  55.             href="https://c...content-available-to-author-only...s.com/esri-leaflet-geocoder/0.0.1-beta.5/esri-leaflet-geocoder.css"
  56.         />
  57.     </head>
  58.     <body>
  59.         <div id="map"></div>
  60.  
  61.         <div class="pointer"></div>
  62.  
  63.         <script
  64.             src="https://u...content-available-to-author-only...g.com/leaflet@1.7.1/dist/leaflet.js"
  65.             integrity="sha512-XQoYMqMTK8LvdxXYG3nZ448hOEQiglfqkJs1NOQV44cWnUrBc8PkAOcXy20w0vlaXaVUearIOBhiXZ5V3ynxwA=="
  66.             crossorigin=""
  67.         ></script>
  68.  
  69.         <script src="https://u...content-available-to-author-only...g.com/leaflet-routing-machine@latest/dist/leaflet-routing-machine.js"></script>
  70.  
  71.         <script src="https://c...content-available-to-author-only...s.com/esri-leaflet/0.0.1-beta.5/esri-leaflet.js"></script>
  72.         <script src="https://c...content-available-to-author-only...s.com/esri-leaflet-geocoder/0.0.1-beta.5/esri-leaflet-geocoder.js"></script>
  73.  
  74.         <!-- <script src="main.js"></script> -->
  75.         <style>
  76.             body,
  77.             html {
  78.                 height: 100%;
  79.                 font-family: Arial;
  80.             }
  81.  
  82.             #map {
  83.                 width: 100%;
  84.                 height: 100%;
  85.                 z-index: 100;
  86.             }
  87.  
  88.             .pointer {
  89.                 position: absolute;
  90.                 top: 86px;
  91.                 left: 60px;
  92.                 z-index: 99999;
  93.             }
  94.             .leaflet-control-zoom {
  95.                 display: none;
  96.             }
  97.  
  98.             .leaflet-touch .geocoder-control {
  99.                 width: 275px;
  100.                 height: 30px;
  101.                 /* border-radius: 30%; */
  102.             }
  103.             /* .leaflet-control-layers .leaflet-control .leaflet-control-layers-expanded{
  104.         bottom: 0;
  105.       } */
  106.         </style>
  107.     </body>
  108. </html>
  109.  
  110. <script>
  111.     var map = L.map('map', {
  112.         center: [20.980519225977506, 105.78792801627205],
  113.         zoom: 12,
  114.     });
  115.     var mylayers = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
  116.         attribution:
  117.             '&copy; <a href="http://o...content-available-to-author-only...m.org/copyright">OpenStreetMap</a> contributors',
  118.     }).addTo(map);
  119. </script>
  120. `;
  121. export default html_script;
  122.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement