Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c793dffa93
Fetching contributors…

Cannot retrieve contributors at this time

63 lines (54 sloc) 2.859 kb
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Open Street Maps</title>
<meta name="description" content="Open Street Maps">
<meta name="viewport" content="width=device-width, initial-scacle=1.0"/>
<link rel="app-manifest" href="http://mozilla.github.com/WebApp-OpenStreetMap/manifest.webapp" />
<link rel="stylesheet" type="text/css" href="css/leaflet.css">
<link rel="stylesheet" type="text/css" href="css/main.css">
<script type="text/javascript">
var path = document.location.pathname;
var L_ROOT_URL = path.substr(0, path.indexOf('index.html', 1));
</script>
<script type="text/javascript" src="js/leaflet-src.js"></script>
<script type="text/javascript" src="js/mozapps.js"></script>
<script type="text/javascript" src="js/app.js"></script>
</head>
<body>
<div id='buttons'>
<input type="text" id="txtSearch"/><button id="btnSearch">Find</button>
<button id='btnLocation'>location</button>
</div>
<div id="map"></div>
<script type="text/javascript">
var settings = {
lat: localStorage.getItem('lastLat') || 37.37779161,
lng: localStorage.getItem('lastLng') || -122.08110809,
zoom: localStorage.getItem('lastZoom') || 12 // this should be changed after zoom on the map will be changed
}
var map = new L.Map('map');
// create a CloudMade tile layer (or use other provider of your choice)
var cloudmade = new L.TileLayer('http://{s}.tile.cloudmade.com/c59737139dc84cc0b03f9c0b9f57e586/997/256/{z}/{x}/{y}.png', {
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://cloudmade.com">CloudMade</a>',
maxZoom: 18
});
// add the CloudMade layer to the map set the view to a given center and zoom
map.addLayer(cloudmade).setView(new L.LatLng(settings.lat, settings.lng), settings.zoom);
// keep track of the viewport the user last viewed
map.on('moveend', function(e) {
var pos = map.getBounds().getCenter();
localStorage.setItem('lastLat', pos.lat);
localStorage.setItem('lastLng', pos.lng);
});
map.on('zoomend', function(zoom) {
var zoom = map.getZoom();
localStorage.setItem('lastZoom', zoom);
settings.zoom = zoom;
});
// attach a given HTML content to the marker and immediately open it
// marker.bindPopup("A pretty CSS3 popup.<br />Easily customizable.").openPopup();
</script>
</body>
</html>
Jump to Line
Something went wrong with that request. Please try again.