Skip to content

Instantly share code, notes, and snippets.

@DanielJWood
Created December 11, 2013 18:08
Show Gist options
  • Save DanielJWood/7915463 to your computer and use it in GitHub Desktop.
Save DanielJWood/7915463 to your computer and use it in GitHub Desktop.
Movetip with gridControl.setTemplate
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>A MapBox Map</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
<script src='//api.tiles.mapbox.com/mapbox.js/v1.5.0/mapbox.js'></script>
<link href='//api.tiles.mapbox.com/mapbox.js/v1.5.0/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
#map { position:absolute; top:0; bottom:0; width:100%; }
</style>
</head>
<body>
<div id='map' class='dark'></div>
<script>
// Visit https://www.mapbox.com/mapbox.js/overview/ for documentation and examples
var map = L.mapbox.map('map', 'energy.ggnnl2il', {
detectRetina: true,
zoomControl: false,
// gridControl: false, //turns off automatic tooltips ??
scrollWheelZoom:false
}).setView([38.39, -98.40], 4);
map.addControl( L.control.zoom({position: 'topright'}) );
map.gridControl.options.follow = true;
map.gridControl.setTemplate(
'<h1>Temperature:</h1> {{CLASS}}'
);
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment