我有这个结构:
并在myApp设置中:
$scope.searchbox = {template: "searchbox.tpl.html"}
我正在使用此示例,但出现TypeError:无法读取undefined的属性“ SearchBox”,可能是什么?
您可以通过angular-google-maps
两种方式使用:
1)在之前加入API angular-google-maps
。
...在这种情况下,您需要通过places
以下方式包含库:
<script src='//maps.googleapis.com/maps/api/js?libraries=places&sensor=false&language=pt&v=3.17'></script>
^
see? there
2)通过使用.config
(推荐)。
...在这种情况下,您需要通过places
以下方式包含库:
angular.module('myApp').config(['uiGmapGoogleMapApiProvider', function(uiGmapGoogleMapApiProvider) {
uiGmapGoogleMapApiProvider.configure({
// key: 'your api key',
v: '3.20', //defaults to latest 3.X anyhow
libraries: 'places,geometry,visualization' // <--- see? there
});
}]);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句