Google Maps API V3中的Font Awesome图标作为标记 [英] Font Awesome icon as marker in Google Maps API V3

查看:108
本文介绍了Google Maps API V3中的Font Awesome图标作为标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用谷歌地图标记的字体真棒图标。
这是我的代码:

I want to use a font awesome icon as Google Maps marker. Here is my code:

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
});

我看了这个问题,但不幸的是这不适合我。
我想知道是否有另一种方法可以做到这一点。

I've looked at this question, but unfortunately this is not working properly for me. I was wondering if there's another way to do this.

推荐答案

是的。您可以使用 RichMarker

示例:

Example:

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>'
        });
}

这篇关于Google Maps API V3中的Font Awesome图标作为标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆