Changes between Version 6 and Version 7 of oid/WorkLog/08-09-19


Ignore:
Timestamp:
Sep 19, 2008, 3:06:41 PM (16 years ago)
Author:
jazz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • oid/WorkLog/08-09-19

    v6 v7  
    9191 * 繼續解析 http://deepsea.biodiv.tw/locamapd.asp (PART 4) - 自訂的 createMarkerWithLnk() 函數
    9292{{{
     93#!java
     94  // 自訂的 createMarkerWithLnk() 來產生一個具有連結的 Marker 物件
     95  // createMarkerWithLnk(中點座標位置,測站代號,自訂圖示,測站打撈深度)
    9396  function createMarkerWithLnk(point,id,icon,depth) {
    94     var urlstr= id + " Depth:" + depth;
    95     var url="species.asp?id=" + id;
    96     var marker = new GMarker(point,{icon:icon, clickable:true,title:urlstr});
     97    var urlstr= id + " Depth:" + depth;                   // 提示字串="測站代號 Depth:打撈深度"
     98    var url="species.asp?id=" + id;                       // 連結網址=http://deepsea.biodiv.tw/species.asp?id=測站代號
     99    // 產生一個 GMarker 物件
     100    // - 參考1 http://code.google.com/apis/maps/documentation/reference.html#GMarker
     101    // - 參考2 http://code.google.com/apis/maps/documentation/reference.html#GMarkerOptions
     102    // - GMarker(座標位置, GMarkerOptions)
     103    // - GMarkerOptions={icon:自訂圖示 GIcon 物件, clickable: 可點選(true), title: 顯示提示字串}
     104    var marker = new GMarker(point,{icon:icon, clickable:true, title:urlstr});
     105    // 用 GEvent.addListener 設定 GMarker 被點選時的事件處理函數
     106    // 這裡定義的是遇到 click 事件時把 URL 導向到 url 變數設定之連結網址
    97107    GEvent.addListener(marker, "click", function() {location.href=url});
     108    // 回傳 GMarker 物件
    98109    return marker;
    99110  }