【发布时间】:2019-08-22 22:27:51
【问题描述】:
我正在使用 ionic 4 并使用 google maps api。我有几个标记是这样建立的:
setRestaurantMarkers() {
const markers = [];
this.singletonService.restaurants.results.map(restaurant => {
const restaurantPosition = {lat: restaurant['Restaurant'].Lat, lng: restaurant['Restaurant'].Long};
this.markerOptions = new Marker({
position: restaurantPosition,
title: restaurant['Restaurant'].Name,
category: restaurant['RestaurantCategory'].Name,
map: this.map
});
this.marker = new google.maps.Marker(this.markerOptions);
this.marker.addListener('click', (marker) => {
// Set destination for navigate button
this.destination = [marker.latLng.lat(), marker.latLng.lng()];
console.log(marker.latLng.lat(), marker.markerOptions);
this.markerClicked = true;
});
});
}
但是当我单击标记时,我无法获得markerOptions 的详细信息。我想要这个markerOptions 当点击标记时我可能找不到任何关于它的信息。
【问题讨论】:
标签: angular ionic3 google-maps-markers ionic4