我想使用字体很棒的图标作为 Google map 标记。 这是我的代码:
function addMarker(marker) {
marker1 = new google.maps.Marker({
position: new google.maps.LatLng(obj.geo_lat,obj.geo_lng),
category: obj.status,
map: map,
icon: // Font Awesome icon here
});
我看过this问题,但不幸的是,这对我来说不能正常工作。 我想知道是否有另一种方法可以做到这一点。
最佳答案
是的,有。您可以使用 RichMarker
示例:
function addMarker(marker) {
marker1 = new RichMarker({
position: new google.maps.LatLng(obj.geo_lat,obj.geo_lng),
category: obj.status,
map: map,
draggable: false,
flat:true,
anchor: RichMarkerPosition.MIDDLE,
content: '<i class="fa fa-map-marker fa-2x"></i>'
});
}
关于javascript - Font Awesome 图标作为 Google Maps API V3 中的标记,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36764519/