我正在尝试使用 ui-google-maps 库在地图上显示多个标记,但它只显示一个标记。
<div id="map_canvas" ng-controller="mainCtrl">
<h1 align="center">Maps</h1>
<ui-gmap-google-map center="map.center" zoom="map.zoom" draggable="true" options="options">
<ui-gmap-markers models="rmarkers" coords="'self'" fit='true' icon="'icon'">
</ui-map-markers>
</ui-gmap-google-map>
</div>
<script>
angular.module('main', ['google-maps'.ns()])
.controller('mainCtrl', function($scope,$http) {
$scope.map = {center: {latitude: 42.3349940452867, longitude: -71.0353168884369 }, zoom: 14 };
//$scope.marker={id: 1, coords: {latitude: 42.3349940452867, longitude: -71.0353168884369 }};
$scope.options = {scrollwheel: false};
$scope.rmarkers=[{id: 101, latitude: 42.3349940452867, longitude: -71.0353168884369},
{id: 102,latitide: 42.35114190333,longitude: -71.0662789402048},
{id: 103,latitide: 43.35114190333,longitude: -72.0662789402048},
{id: 104,latitide: 44.35114190333,longitude: -73.0662789402048}];});