Skip to main content

use of osm or mapbox in leaflet

http://bl.ocks.org/mapsam/6175692




    <!DOCTYPE html>
<html>
<head>

    <title>Layers Control Tutorial - Leaflet</title>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="shortcut icon" type="image/x-icon" href="docs/images/favicon.ico" />

    <link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css"
          integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ=="
          crossorigin=""/>
    <script src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"
            integrity="sha512-/Nsx9X4HebavoBvEBuyp3I7od5tA0UzAxs+j83KgC8PU0kgB4XiK4Lfe4y4cgBtaRJQEIFCW+oC506aPT2L1zw=="
            crossorigin=""></script>

     <style>
           html, body {
               height: 100%;
               padding: 20px;
           }
           #map {
               width: 600px;
               height: 400px;
           }
              #firstdiv
      {
        text-align: center;
        border-radius: 5px;
        /*background-color: grey;*/

      }
       </style>



</head>
<body>

  <div class="content" id="map" style="height:500px">
        </div>

<script>
    var lat=27.7172;
    var long=85.3240;
    var zoom=15;
    var title="Title here";
    var message="this is message section of teh issue";
    var status="this is status";
    var contentString ='<div id="firstdiv"><h1>'+title+'</h1>'
        +'<h4>'+message+'</h4>'
        +'<label>'+status+'</label>'
        +'</div>';

    var map = L.map('map').setView([lat,long], zoom);

   /* L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
        maxZoom: 18,
        minZoom:12,
        attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
        '<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' +
        'Imagery © <a href="http://mapbox.com">Mapbox</a>',
        id: 'mapbox.streets'

    }).addTo(map);*/

    L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
    maxZoom: 18,    minZoom:12,}).addTo(map);

    var marker = L.marker([lat,long]).addTo(map);

    marker.bindPopup(contentString).openPopup();


</script>



</body>
</html>



// used in ciaa

var map = L.map('map').setView([27.95591,84.111328],7);
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', {
maxZoom: 9,
minZoom: 7,
attribution: 'Code for Core Innovation',
id: 'mapbox.light'
}).addTo(map);




Comments

Popular posts from this blog

laravel file manager sorting by time default

Ref :  https://github.com/UniSharp/laravel-filemanager/issues/337 To load files order by "time DESC" you can change the code in vendor/unisharp/laravel-filemanager/src/traits/LfmHelpers.php public function sortFilesAndDirectories($arr_items, $sort_type) { if ($sort_type == 'time') { $key_to_sort = 'updated'; } elseif ($sort_type == 'alphabetic') { $key_to_sort = 'name'; } else { $key_to_sort = 'updated'; } return strcmp($a->{$key_to_sort}, $b->{$key_to_sort}); }); return $arr_items; } with public function sortFilesAndDirectories($arr_items, $sort_type) { if ($sort_type == 'time') { $key_to_sort = 'updated'; } elseif ($sort_type == 'alphabetic') { $key_to_sort = 'name'; } else { $key_to_sort = 'updated'; ...

creating subdomain and upload

step 1: create subdomain step 2: create database step 3: set username and passwore to database step 4: change php version from multiphp manager to 7.1 or 7.2 step 5: open subdomain from file manager and remane public step 6: upload zip project file step 7: unzip and move all file outside of the projct name folder i.e subdomain vitra siddhai sabai files and folder rakhdini step 8: edit env file db name, user name, and password