Advertisement
Guest User

mapbox favicon

a guest
Jul 20th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 1.30 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html style="width: 100%; height: 100%;" lang="en">
  3.  
  4. <head>
  5.  
  6.   <link rel="shortcut icon" href="https://www.pngfind.com/pngs/m/114-1147878_location-poi-pin-marker-position-red-map-google.png">
  7.  
  8.   <script src='https://api.mapbox.com/mapbox-gl-js/v1.1.1/mapbox-gl.js'></script>
  9.   <link href='https://api.mapbox.com/mapbox-gl-js/v1.1.1/mapbox-gl.css' rel='stylesheet' />
  10.  
  11.   <style>
  12.     .marker {
  13.       background-size: cover;
  14.       width: 40px;
  15.       height: 40px;
  16.       border-radius: 50%;
  17.       cursor: pointer;
  18.       background-image: url('https://www.pngfind.com/pngs/m/114-1147878_location-poi-pin-marker-position-red-map-google.png');
  19.     }
  20.   </style>
  21. </head>
  22.  
  23. <body style="width: 100%; height: 100%; margin: 0;">
  24.  
  25.   <div id='map' style='width: 100%; height: 100%;'></div>
  26.   <script>
  27.     mapboxgl.accessToken = 'pk.eyJ1IjoiYWJsaW5kbWFuIiwiYSI6ImNqcmY1ZDd6cDBydWQ0M3A4OHJ4b2czZGwifQ.brwgWx9jn2ut0PAOqEookQ';
  28.     const map = new mapboxgl.Map({
  29.       container: 'map',
  30.       style: 'mapbox://styles/mapbox/light-v10',
  31.       center: [-3.953423, 54.312727],
  32.       zoom: 5,
  33.     });
  34.     let el = document.createElement('div');
  35.     el.classList.add('marker');
  36.     new mapboxgl.Marker(el)
  37.       .setLngLat([-0.46541700, 53.82652100])
  38.       .addTo(map);
  39.   </script>
  40.  
  41. </body>
  42.  
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement