Skip to content

Instantly share code, notes, and snippets.

@Teino1978-Corp
Created November 10, 2015 04:58
Show Gist options
  • Save Teino1978-Corp/4505f40ae9a88209a0fa to your computer and use it in GitHub Desktop.
Save Teino1978-Corp/4505f40ae9a88209a0fa to your computer and use it in GitHub Desktop.
intel xdk application with leaflet.js
<!DOCTYPE html>
<html>
<head>
<title>AppFramework leafletJS</title>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0;" />
<link rel="stylesheet" type="text/css" href="http://cdn.app-framework-software.intel.com/2.0/af.ui.css" />
<link rel="stylesheet" type="text/css" href="http://cdn.app-framework-software.intel.com/2.0/icons.css" />
<script type="text/javascript" charset="utf-8" src="http://cdn.app-framework-software.intel.com/2.0/appframework.ui.min.js"></script>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.1/leaflet.css" />
<script src="http://cdn.leafletjs.com/leaflet-0.7.1/leaflet.js?2"></script>
<script>
$.ui.ready(function(){
leaflet();
});
function leaflet(){
// create a map in the "map" div, set the view to a given place and zoom
var map = L.map('map').setView([51.505, -0.09], 13);
// add an OpenStreetMap tile layer
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
// add a marker in the given location, attach some popup content to it and open the popup
L.marker([51.5, -0.09]).addTo(map)
.bindPopup('A pretty CSS3 popup. <br> Easily customizable.')
.openPopup();
}
</script>
<style>
body {font-family:arial;background-color:white}
#map {height:400px;margin:0 -10px}
</style>
</head>
<body>
<div id="afui">
<div id="content" style="">
<div class="panel" title="LeafletJS" id="page1" data-footer="none" selected="true">
<div id="map"></div>
</div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment