【发布时间】:2016-02-21 12:19:54
【问题描述】:
我是 Angular 和 uiGmapGoogleMapApi 的新手,我正在尝试重写:
<ui-gmap-google-map center="search.map.center" zoom="search.map.zoom" bounds="search.map.bounds" options="{ overviewMapControl: true, streetViewControl: false, mapTypeControl: false }">
<locations ng-if="! search.isLoading" ng-repeat="player in search.results track by $index">
<ui-gmap-marker ng-repeat="item in player.l track by $index" ng-if="item.g" idKey="$index" coords="{ latitude: item.g[0], longitude: item.g[1] }" options="{ labelContent: item.n }">
<ui-gmap-window>
<div>
<a ng-href="{[{ search.getplayerUrl(player) }]}">{[{ player.n }]}</a>
<p>{[{ player.s }]}</p>
</div>
</ui-gmap-window>
</ui-gmap-marker>
</locations>
</ui-gmap-google-map>
到 ui-gmap-markers。 因为 ui-gmap-marker 和 ng-repeat 的性能很差。 我没有从这一点上取得进展。我没有收到任何错误。
<ui-gmap-google-map center="search.map.center" zoom="search.map.zoom" bounds="search.map.bounds" options="{ overviewMapControl: true, streetViewControl: false, mapTypeControl: false }">
<locations ng-if="! search.isLoading" ng-repeat="player in search.results track by $index">
<ui-gmap-markers models="player.l" idKey="id" coords="{ latitude: g[0], longitude: g[1] }" options="{ labelContent: n }" />
<ui-gmap-window>
<div>
<a ng-href="{[{ search.getplayerUrl(player) }]}">{[{ player.n }]}</a>
<p>{[{ player.s }]}</p>
</div>
</ui-gmap-window>
</locations>
</ui-gmap-google-map>
有谁知道我做错了什么?
【问题讨论】:
标签: angularjs google-maps-markers angular-google-maps