【发布时间】:2018-06-24 22:17:38
【问题描述】:
我知道这个问题经常被问到,但我在 Google 地图上显示圆圈时遇到了问题。
实际上,我的地图上有标记。
import htmlTemplate from './activityDetails.html';
export default {
template: htmlTemplate,
require: {
parent: '^main'
},
bindings: {
activity: '<'
},
controller: function controller(MapsService, GeolocationService, NgMap, $log) {
'ngInject';
this.$onInit = () => {
// Load Google Maps API script
MapsService.loadGoogleApi().then(() => {
this.loaded = true;
NgMap.getMap().then((map) => {
this.map = map;
$log.info('activityDetails component init');
this.activity.lat = this.activity.location.coordinates[0];
this.activity.lng = this.activity.location.coordinates[1];
// Save each marker in its user object to facilitate hover
this.createMarkers();
// Set geolocation notification hook
this.setGeolocationHook();
});
});
};
}
};
<div class="block-map col m6">
<ng-map class="map" center="{{$ctrl.activity.lat}}, {{$ctrl.activity.lng}}" zoom="16">
<marker position="{{$ctrl.activity.lat}}, {{$ctrl.activity.lng}}"></marker>
</ng-map>
</div>
我的问题是: 如何用圆圈替换我的标记?
非常感谢!
【问题讨论】:
标签: javascript angularjs google-maps google-maps-markers