我刚刚遇到了同样的问题 - 决定进行快速而肮脏的转换并在 github 上托管。
https://github.com/nathan-muir/fontawesome-markers https://github.com/nathan-muir/fontawesome-markers
您可以手动包含 JS 文件,或使用npm install fontawesome-markers
or bower install fontawesome-markers
.
只需包含 javascript 文件fontawesome-markers.min.js
你可以像这样使用它们:
new google.maps.Marker({
map: map,
icon: {
path: fontawesome.markers.EXCLAMATION,
scale: 0.5,
strokeWeight: 0.2,
strokeColor: 'black',
strokeOpacity: 1,
fillColor: '#f8ae5f',
fillOpacity: 0.7
},
clickable: false,
position: new google.maps.LatLng(lat, lng)
});
编辑(2016 年 4 月):现在有 v4.2 -> v4.6.1 的软件包