我正在搞乱谷歌地图API,我似乎无法弄清楚如何在有人点击我添加的自定义地图图标后在地图中添加弹出信息.我正在使用的代码如下,示例在littlemarketbrasserie.com上
任何帮助将不胜感激.
<script type="text/javascript">
function initialize() {
var mapOptions = {
zoom: 15,
panControl: false,
mapTypeControl: false,
center: new google.maps.LatLng(41.89924, -87.62756),
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById('map_canvas'),
mapOptions);
var image = 'img/lm-logo-maps1.png';
var myLatLng = new google.maps.LatLng(41.89924, -87.62756);
var marker = new google.maps.Marker({
position: myLatLng,
map: map,
animation: google.maps.Animation.DROP,
icon: image,
});
var styles = [
{
stylers: [
{ hue: "#ff9f67" },
{ saturation: -20 },
{ gamma: 1.50 }
]
},{
featureType: "road",
elementType: "geometry",
stylers: …Run Code Online (Sandbox Code Playgroud) 我加载Angular App时收到错误.-
"TypeError: undefined is not a function"
Run Code Online (Sandbox Code Playgroud)
我已经将问题缩小到与在控制器中声明ngAnimate以及首先在第504行的Angular Animate文件中抛出的错误有关的事情 -
var hasClass = angular.$$hasClass(element[0], className);
Run Code Online (Sandbox Code Playgroud)
这是我的控制器.即使包含ngAnimate,一切都按照我想要的方式工作.
var tdfapp = angular.module('tdfapp', ['ngAnimate']);
tdfapp.controller('UserCtrl', function($scope, $http) {
$scope.users = [];
$http.get('user.json').success(function(data) {
angular.copy(data, $scope.users );
});
});
Run Code Online (Sandbox Code Playgroud)
任何帮助,将不胜感激.