Skip to content

Instantly share code, notes, and snippets.

@adoueb
Created February 10, 2014 17:06
Show Gist options
  • Save adoueb/8920005 to your computer and use it in GitHub Desktop.
Save adoueb/8920005 to your computer and use it in GitHub Desktop.
.angular-google-map-container { height: 400px; }
<!DOCTYPE html>
<html ng-app="myapp">
<head>
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script src="http://underscorejs.org/underscore-min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.8/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.8/angular-route.min.js"></script>
<script src="https://rawgithub.com/nlaplante/angular-google-maps/1.0.4/dist/angular-google-maps.min.js"></script>
<meta charset="utf-8">
<title>Toggle Google Maps Default UI</title>
</head>
<body ng-controller="app">
<google-map center="map.center" zoom="map.zoom" options="map.options" events="map.events">
</google-map>
<pre>map.options: {{ map.options | json }}</pre>
</body>
</html>
angular
.module('myapp', ['ngRoute','google-maps'])
.controller("app", ['$scope', function($scope){
$scope.map = {
zoom: 8,
center: {
latitude: 45,
longitude: -73
},
options: {
disableDefaultUI :true
},
events: {
tilesloaded: function (map) {
alert("yes");
$scope.$apply(function () {
$scope.mapInstance = map;
});
},
"mouseover" : function () {
$scope.$apply(function(){
$scope.map.options.disableDefaultUI = false;
});
},
"mouseout" : function () {
$scope.$apply(function(){
$scope.map.options.disableDefaultUI = true;
});
}
}
};
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment