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 © <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', {
var marker = L.marker([lat,long]).addTo(map);
marker.bindPopup(contentString).openPopup();
</script>
</body>
</html>
// used in ciaa
<!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 © <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
Post a Comment