Planet of NCCUCS
adobe photoshop 8.0 warez Adobe Premiere Pro CS5 can t reinstall adobe creative suite download adobe photoshop 8 0 cs Adobe Illustrator CS5 adobe premiere pro 1.5 serial key adobe acrobat reader 6.0 free Adobe Dreamweaver CS5 adobe course indesign software adobe photoshop free cursive fonts Adobe Photoshop CS5 Extended adobe photoshop elements 4 help sound adobe photoshop logos Adobe Creative Suite 5 Master Collection adobe creative suite torrents adobe photoshop and trial version Adobe Acrobat 9 Pro Extended adobe photoshop shape tools adobe photoshop free trial software Adobe Contribute CS5 wartz adobe acrobat adobe creative suite 2 academic Adobe Indesign CS5 adobe acrobat approval adobe premiere preview download Adobe Flash Catalyst CS5 602 acrobat adobe reader update adobe acrobat 7 reader update Adobe Flex Builder 3 Pro opening pps in adobe photoshop

[小範例] 使用 Yahoo!生活+ API 與 Google Map

作者:TaopaiC on 一月 24, 2008 Posted in RSS | | 觀看文章來源

小 YG 生活+ 的幕後…

上上篇講到Yahoo!生活+的API, 就拿來跟google map搞搞看, 弄了一個簡單的範例.
除了Y!生活+API以外, 還用到

我將現在的程式碼以CC by-NC-SA的授權公開, 提供下載. 現在的程式碼並不複雜, 以後一些功能加上去, 反而不易閱讀. 也沒用到奇怪的技巧與技術, 希望能當作一個學習的範例.

/* 本篇只大概說明以及給相關連結, 並不是 step-by-step 文件. 網路上有太多教學文件了, 沒必要再造一個輪子.. */

Yahoo!生活+的部份

  1. 首先要先申請 appid , 先到 應用程式帳號申請 填寫資料. 認證等級 (Authentication method) 選一般 (Generic) 即可. 接下來會獲得一組又臭又長的appid.
  2. 再使用 Auth.bootUp 註冊 appid. 就可以使用 api 了.
  3. AJAX讀的資料無法跨站使用, 一個方法是用JSON+callback function (有專有名詞嗎?) , Yahoo Pipes 提供輸出成 json 格式, 以及加上 callback function. 只要先過Yahoo Pipes (可以使用我做的), 就有這好用功能. 請參閱前篇.

Google Map 的部份

  1. Google Maps API Tutorial: 很棒的教學與範例.
  2. Google Earch Icons: 列出 Google Earth 提供的icon
  3. 列表上開啟marker: 有

    GEvent.trigger(marker, “click”);

    可以用, 雖然每個教學都教你用

    marker.openInfoWindowHtml(html[i]);

  4. Info視窗最大化: gmap官網提供的範例, 會有註冊複數個handler的問題, 我的方法是註冊一個, 每次查id . 請參閱程式碼.
  5. 最大化Info視窗的內容:官網的範例是用 GDownloadUrl , 我的作法是先塞特定class的
    進去, 再讓callback function去更改內容.
  6. Local Search Control for Google Maps

jQuery:

  1. 隱藏詳細資料.
  2. 處理url的query string: 用Query String Object這個plugin, 可以直接

    $.query.get(’classid’);

    取得 URL?classid=3 的classid的值.

  3. 判斷導覽列上的標籤, 用 getUrlParam 取得 classid 的值, 再與現在的 classid 比對.

程式碼

下載程式碼看吧…
程式碼 測試網站 目錄


Copyright © 2008. TaopaiC blog (Digital Fingerprint: ec0b2a1b149f89e960b3546e0be55189)

相關文章:

:, , , , , ,
No comments for this entry yet...

Comments are closed.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

最新文章

照片

R0012028R0012036R0013553R0013551R0013550R0013549R0013560R0013558R0013569R0013561R0013570R0013571R0013580R0013581R0013556R0013567R0013563R0013572R0011783R0012312