【发布时间】:2015-12-03 12:32:51
【问题描述】:
我正在使用 Angular Google 地图,我想使用自定义标记。我不希望它成为图像。我想要这样的东西:
icon: {
path: google.maps.SymbolPath.CIRCLE,
scale: 12,
fillColor: '#2677FF',
fillOpacity: 1,
strokeColor: '#ffffff',
strokeOpacity: 1,
strokeWeight: 6
}
但我收到google is not defined 的错误。我如何获得该对象?
这是我的看法:
<ui-gmap-google-map center='map.center' zoom='map.zoom' pan='true' refresh='true'>
<ui-gmap-marker coords="map.currentPos.coords" options="map.currentPos.options" events="map.currentPos.events" idKey="map.currentPos.id" icon="map.currentPos.icon">
</ui-gmap-marker>
</ui-gmap-google-map>
这是我的地图:
$scope.map = {
center: { latitude: $scope.position.lat, longitude: $scope.position.lng },
zoom: 10,
options: { scrollwheel: false, disableDefaultUI: true, draggable: true, scrollwheel: false },
events: {
},
markers: [],
bounds: {},
polylines: [],
currentPos: {
id: 'currentpos',
coords: {
latitude: $scope.position.lat,
longitude: $scope.position.lng
},
options: { draggable: false, clickable: false, zIndex: 1000 },
events: {
},
icon: '',
},
control: {
refresh: function(){
}
}
};
【问题讨论】:
标签: javascript angularjs google-maps angular-google-maps