studio
This commit is contained in:
parent
b4b6e4d474
commit
8cad260eee
2 changed files with 37 additions and 4 deletions
|
@ -4,12 +4,12 @@ from bottle import route, run,template
|
|||
@route('/myapp')
|
||||
@route('/myapp/')
|
||||
def myApp():
|
||||
return '<b style="color:green">Hello Sandeep .Bottle Framework demonstration route.</b>'
|
||||
return template('map_template', item=item)
|
||||
|
||||
|
||||
@route('/myapp/<name>')
|
||||
def myName(name):
|
||||
return template('<b style="color:green">Hello <b style="color:red"> {{name}}</b>. Bottle Framework demonstration route with template string.', name=name)
|
||||
@route('/myapp/<item>')
|
||||
def myName(item):
|
||||
return template('map_template', item=item)
|
||||
|
||||
|
||||
@route('/myapp/favourite/')
|
||||
|
|
33
views/map_template.tpl
Normal file
33
views/map_template.tpl
Normal file
|
@ -0,0 +1,33 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Quick Start - 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.0.3/dist/leaflet.css" />
|
||||
<script src="https://unpkg.com/leaflet@1.0.3/dist/leaflet.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="mapid" style="width: 600px; height: 400px;"></div>
|
||||
<script>
|
||||
|
||||
var mymap = L.map('mapid').setView([44.4936714,11.3430347], 13);
|
||||
|
||||
L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpandmbXliNDBjZWd2M2x6bDk3c2ZtOTkifQ._QA7i5Mpkd_m30IGElHziw', {
|
||||
maxZoom: 18,
|
||||
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(mymap);
|
||||
var marker = L.marker([44.5038497,11.3139989]).addTo(mymap);
|
||||
marker.bindPopup("<b>Ospedale Maggiore</b><br>{{item}} barbone").openPopup();
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in a new issue