[Plugin] Google Maps Plugin for WordPress

剛剛在「ijliao」那看到了「Google Maps Plugin for WordPress」這個實用的 Plugin, 可以很方便的在 Blog 上面秀出「Google Maps」的地圖, 以後要講地點再也不會描述不清了!

趕快來試一下, 標示出新莊最機車、最容易塞車的路口:

中正路和大漢橋交叉口

注意: 本站目前已停用這個 Plugin, 改用 UrMap, 所以看不出效果。

對於 FancyTooltips 不相容的問題, 我已經弄出一個改良版了, 詳見這篇文章

注意: 本 plugin 和 FancyTooltips 相衝, 得修正一下程式碼才行。我說說我的改法, 由於它會和 FancyTooltips 抓取連結的「title」屬性相衝, 因此我將它由抓取「title」屬性改為抓取「rel」屬性, 所以修改後原本使用時指定在「title」必須改成指定在「rel」, 程式碼如下(字體色彩不同的是我改的地方, 請自行比對 plugin 的原始碼):

function googlemaps_anchorTagSearchReplace() {
    var thekey = "$googlemaps_googleMapsKey";
    var hrefs = document.getElementsByTagName("a");

    for (x=0; x<hrefs.length; x++) {
        var thehref = hrefs[x];
        var theloc = thehref.href;

        var relAttribute = String(thehref.getAttribute('rel'));

        if ((theloc.indexOf('http://maps.google.')!=-1) &&
            (relAttribute.indexOf('googlemap')!=-1) ) {

            var pcnt = 0;

            mapname = 'googlemap-'+x;
            ginfo = relAttribute;

[tags]WordPress, plugins, Google Maps[/tags]

7 Comments Add yours

  1. Robbin says:

    這個好像還挺好玩的,話說這個路口也是我這幾年最討厭的一個路口啊,總是在上下班時間塞到天荒地老的…..

  2. goston says:

    我最近觀察了三個星期, 下班時間週一到週五每天塞, 而且… 完全沒有警察在指揮交通… 實在很扯…

  3. Robbin says:

    Goston兄可能離我不會很遠啊,基本上那裡也是我每天必經之地,小弟在湯城工作..

  4. goston says:

    @Robbin
    我是住在那附近啦… 我在新店工作… @_@

  5. Avi Alkalay says:

    I just updated the plugin with the “rel” ideas we discussed here, plus some tons of code cleanup and reorganization.

Leave a Reply to gostonCancel reply