我的地圖api顯示錯誤的地點類型,我找不到原因。 Se代碼波紋管,我要求:地圖類型在地圖API上顯示錯誤的地點類型
類型:['store','school','church','park','university','cafe','gym','bakery']
在這裏看到整個代碼:
<script>
var map;
var infowindow;
function initMap() {
var image = 'http://www.vittoriagardens.com/wp-content/uploads/2016/04/pin.png';
var myLatLng = {lat: 25.5244191, lng: -80.4063932};
map = new google.maps.Map(document.getElementById('map'), {
zoom: 15,
scrollwheel: false,
center: myLatLng
});
var principal = new google.maps.Marker({
position: myLatLng,
map: map,
title: 'Vittoria',
icon: image
});
infowindow = new google.maps.InfoWindow();
/*lojas*/
var placestore = new google.maps.places.PlacesService(map);
placestore.nearbySearch({
location: myLatLng,
radius: 2500,
type: ['store', 'school', 'church', 'park', 'university', 'cafe', 'gym', 'bakery']
}, callback);
}
function callback(results, status) {
if (status === google.maps.places.PlacesServiceStatus.OK) {
for (var i = 0; i < results.length; i++) {
createMarker(results[i]);
}
}
}
function createMarker(place) {
var placeLoc = place.geometry.location;
var iconType = {};
iconType['school'] = "http://www.vittoriagardens.com/wp-content/uploads/2016/04/categoria_school.png";
iconType['church'] = "http://www.vittoriagardens.com/wp-content/uploads/2016/04/categoria_church.png";
iconType['park'] = "http://www.vittoriagardens.com/wp-content/uploads/2016/04/categoria_park.png";
iconType['university'] = "http://www.vittoriagardens.com/wp-content/uploads/2016/04/categoria_school.png";
iconType['store'] = "http://www.vittoriagardens.com/wp-content/uploads/2016/04/categoria_shopping_mall.png";
iconType['cafe'] = "http://www.vittoriagardens.com/wp-content/uploads/2016/04/categoria_bakery.png";
iconType['bakery'] = "http://www.vittoriagardens.com/wp-content/uploads/2016/04/categoria_bakery.png";
iconType['gym'] = "http://www.vittoriagardens.com/wp-content/uploads/2016/04/categoria_gym.png";
var marker = new google.maps.Marker({
map: map,
icon: iconType[place.types[0]],
position: place.geometry.location
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.setContent(place.name);
infowindow.open(map, this);
});
}
</script>
我不知道爲什麼,但你可以在這裏看到地圖的更多信息:Vittoria Gardens或波紋管這個形象:Print of the map on the website,例如,它顯示一個墨西哥餐廳和一個UPS客戶服務中心,我沒有要求這種類型的地方。
有誰知道爲什麼會發生這種情況? 謝謝