Created
February 10, 2014 17:06
-
-
Save adoueb/8920005 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.angular-google-map-container { height: 400px; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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