關於部落格
「 相本、程式....Not worth a rap 。」
  • 16680

    累積人氣

  • 0

    今日人氣

    0

    訂閱人氣

Demo_map create side_bar

<tr>
   <td width="20%">
       <div id="side_bar" valign="top" style="width: 100%; height: 100%; background-color:#F4F4F4; color: #4444ff;"></div>
   </td>    
   <td colspan="2" >    
     <script src="http://maps.google.com/maps?file=api&v=2.s&key=$apikey" type="text/javascript"></script>
     <div id="map" style="width: 100%; height: 100%; color:black"></div ><br />

--------------------------------------------------------------------------------------------------------------------------

     var side_bar_html = "";
     var gmarkers = [];
     var i = 0;

      function createMarker(point, html, style, name, time, start, end)
     {
      // FF 1.5 fix
      html = '<div align="left" style="white-space:nowrap;"><font color="#BF0000">' + html + '</font></div>';
        icon.image = 'images/map/' + style + '.gif';              
      var marker = new GMarker(point, icon);
      GEvent.addListener(marker, "click", function() {marker.openInfoWindowHtml(html);});
      gmarkers[i] = marker;
      side_bar_html += '<p>&#8211;<a href="javascript:myclick(' + i + ')"><font color="#BF0000">' + name + '&nbsp;&nbsp;' + time + '</font><br>&nbsp;&nbsp;&nbsp;'+ start + '&#8211;' + end + '</a></p>';
            i++;          
          return marker;
          }
          
    function myclick(i) {
              GEvent.trigger(gmarkers[i], "click");
        }
          

--------------------------------------------------------------------------------------------------------------------------
      $sql = "SELECT username, user_avatar, user_id, user_regdate, user_from, user_icq, user_aim, user_yim, useridentity, user_posts, user_avatar_type, user_latitude, user_longitude FROM ".$prefix."_users where name > "0" order by user_lastvisit desc LIMIT 0,10";
      if( !($result = $db->sql_query($sql)) )
      {
<<<  省略  >>>
         echo "var marker = createMarker(point,'$markertext','$iconstyle', '$username', 'time', '$usericq', '$useraim');";
         echo "map.addOverlay(marker);";
         echo "document.getElementById("side_bar").innerHTML = side_bar_html;";

目前time還沒有對應上,之後再補



眼尖的話應該發現到下方的 var marker 後頭那些變數是照著前面 function createMarker 括弧裡的 point, html, style .....  一路依順序寫下來的。

 ←  完整範例檔
相簿設定
標籤設定
相簿狀態