Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
43 lines (37 sloc) 1.29 KB
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<link rel="stylesheet" href="http://yui.yahooapis.com/pure/0.1.0/pure-min.css">
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<title>wbyoko - Hello Maps</title>
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
.google-map{width:100%; height:100%;}
</style>
</head>
<body ng-app="mapComponentsApp">
<h1>Hello Maps</h1>
<div class="google-map" hello-maps="" latitude="43.074688" longitude="-89.384294"></div>
<script type="text/javascript">
var mapApp = angular.module('mapComponentsApp', []);
mapApp.directive('helloMaps', function () {
return function (scope, elem, attrs) {
var mapOptions,
latitude = attrs.latitude,
longitude = attrs.longitude,
map;
latitude = latitude && parseFloat(latitude, 10) || 43.074688;
longitude = longitude && parseFloat(longitude, 10) || -89.384294;
mapOptions = {
zoom: 8,
center: new google.maps.LatLng(latitude, longitude)
};
map = new google.maps.Map(elem[0], mapOptions);
};
});
</script>
</body>
</html>