-1
我使用下面的代码在我的页面上使用Google地方显示自定义标记。Google地方的自定义标记
var iconUrl;
if(place.types[0] == 'lodging'){ iconUrl = 'custom-markers/hotel_marker.png'; }
else
{
iconUrl = place.icon;
}
我如何更改上面的代码,以便我可以显示来自多个类别的自定义标记?
例如:
if(place.types[0] == 'bars'){ iconUrl = 'custom-markers/bar_marker.png'; }
否则,如果?或者可能是一个关联数组? – CharlesA