  | 
              
	              
	                
  
    
	 
        ช่วยด้วยค่ะ รูปใน infoWindows ไม่ขึ้นค่ะ ลองแก้ตามที่เคยมีคนโพสก็ไม่ได้     | 
   
  
    |   | 
   
 
 
 
	
		
			  | 
	   | 
	    | 
		
			  | 
	 
	
		
			  | 
		 		   | 
	  	    
          
            
			
	
			
			 
                Code (PHP) 
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps</title>
    <script src="http://maps.google.com/maps/api/js?sensor=false"
            type="text/javascript"></script>
    <script type="text/javascript">
    //<![CDATA[
    var customIcons = {
      temple: {
        icon: 'http://localhost/TeawThai/admin/fileupload/252852671.002.png',
        shadow: 'http://localhost/TeawThai/admin/fileupload/1178568428.76.png'
      },
      museum: {
        icon: 'http://localhost/TeawThai/admin/fileupload/256473356.723.png',
        shadow: 'http://localhost/TeawThai/admin/fileupload/1181292061.29.png'
      },
	  market: {
        icon: 'http://localhost/TeawThai/admin/fileupload/259190224.035.png',
        shadow: 'http://localhost/TeawThai/admin/fileupload/1183804622.45.png'
      },
      park: {
        icon: 'http://localhost/TeawThai/admin/fileupload/262130339.907.png',
        shadow: 'http://localhost/TeawThai/admin/fileupload/1185931572.44.png'
      },
	  waterfall: {
        icon: 'http://localhost/TeawThai/admin/fileupload/264572543.841.png',
        shadow: 'http://localhost/TeawThai/admin/fileupload/1190139469.7.png'
      },
      sea: {
        icon: 'http://localhost/TeawThai/admin/fileupload/266665668.21.png',
        shadow: 'http://localhost/TeawThai/admin/fileupload/1192597909.99.png'
      },
	  place: {
        icon: 'http://localhost/TeawThai/admin/fileupload/269501601.42.png',
        shadow: 'http://localhost/TeawThai/admin/fileupload/1195075292.58.png'
      }
    };
    function load() {
      var map = new google.maps.Map(document.getElementById("map"), {
        center: new google.maps.LatLng(13.761728449950002,100.6527900695800),
        zoom: 10,
        mapTypeId: 'roadmap'
      });
      var infoWindow = new google.maps.InfoWindow;
      // Change this depending on the name of your PHP file
      downloadUrl("phpsqlajax_genxml3.php", function(data) {
        var xml = data.responseXML;
        var tbl_place = xml.documentElement.getElementsByTagName("marker");
        for (var i = 0; i < tbl_place.length; i++) {
		  var image = tbl_place[i].getAttribute("Image");
          var PlaceName = tbl_place[i].getAttribute("PlaceName");
          var address = tbl_place[i].getAttribute("address");
          var type = tbl_place[i].getAttribute("type");
          var point = new google.maps.LatLng(
              parseFloat(tbl_place[i].getAttribute("lat")),
              parseFloat(tbl_place[i].getAttribute("lng")));
		  
          var html = "<img src='../image/place"
+ image + "'><br/><b>" + PlaceName + "</b><br/>" + address + "";
          var icon = customIcons[type] || {};
          var marker = new google.maps.Marker({
            map: map,
            position: point,
            icon: icon.icon,
            shadow: icon.shadow
          });
          bindInfoWindow(marker, map, infoWindow, html);
        }
      });
    }
    function bindInfoWindow(marker, map, infoWindow, html) {
      google.maps.event.addListener(marker, 'click', function() {
        infoWindow.setContent(html);
        infoWindow.open(map, marker);
      });
    }
    function downloadUrl(url, callback) {
      var request = window.ActiveXObject ?
          new ActiveXObject('Microsoft.XMLHTTP') :
          new XMLHttpRequest;
      request.onreadystatechange = function() {
        if (request.readyState == 4) {
          request.onreadystatechange = doNothing;
          callback(request, request.status);
        }
      };
      request.open('GET', url, true);
      request.send(null);
    }
    function doNothing() {}
    //]]>
  </script>
  </head>
  <body onLoad="load()">
    <div id="map" style="width: 500px; height: 300px"></div>
  </body>
</html>
 
 
ส่วนอันนี้คือโค้ด xml นะค่ะ 
 
Code (PHP) 
<?php
require("dbinfo.php");
function parseToXML($htmlStr) 
{ 
$xmlStr=str_replace('<','<',$htmlStr); 
$xmlStr=str_replace('>','>',$xmlStr); 
$xmlStr=str_replace('"','"',$xmlStr); 
$xmlStr=str_replace("'",''',$xmlStr); 
$xmlStr=str_replace("&",'&',$xmlStr); 
return $xmlStr; 
} 
// Opens a connection to a MySQL server
$connection=mysql_connect ($hostname, $username, $password);
mysql_query("SET NAMES UTF8",$connection);
if (!$connection) {
  die('Not connected : ' . mysql_error());
}
// Set the active MySQL database
$db_selected = mysql_select_db($database, $connection);
if (!$db_selected) {
  die ('Can\'t use db : ' . mysql_error());
}
// Select all the rows in the markers table
// Select all the rows in the markers table
$query = "SELECT * FROM tbl_place WHERE 1";
$result = mysql_query($query);
if (!$result) {
  die('Invalid query: ' . mysql_error());
}
header("Content-type: text/xml");
// Start XML file, echo parent node
echo '<tbl_place>';
// Iterate through the rows, printing XML nodes for each
while ($row = @mysql_fetch_assoc($result)){
  // ADD TO XML DOCUMENT NODE
  $pImage = $data['Image'];
  
  echo '<marker ';
  echo 'PlaceName="' . parseToXML($row['PlaceName']) . '" ';
  echo 'address="' . parseToXML($row['address']) . '" ';
  echo 'lat="' . $row['lat'] . '" ';
  echo 'lng="' . $row['lng'] . '" ';
  echo 'type="' . $row['type'] . '" ';
  echo 'image="' . $row['Image'] . '" ';
  echo '/>';
}
// End XML file
echo '</tbl_place>';
?>
 
 
  
 
ต้องเพิ่มหรือแก้ตรงไหนบ้างอ่ะค่ะ 
path รูปอยู่ใน C:\AppServ\www\TeawThai\image\place เนี้ยค่ะ ลองเอาใส่ทั้ง หมดก็ไม่ได้ image/place ก็ยังไม่ขึ้น 
รบกวนผู้รู้ช่วยชี้แนะแนวทางด้วย แก้มาหลายวันแล้ว >_<"
 
 
  Tag : PHP, Ajax               
                        | 
           
          
            | 
			
                             | 
           
          
            
              
                   | 
                   | 
                   | 
               
              
                   | 
                
                    
                      | Date :
                          2012-11-21 21:27:25 | 
                      By :
                          mickijung | 
                      View :
                          1365 | 
                      Reply :
                          6 | 
                     
                  | 
                   | 
               
              
                   | 
                   | 
                   | 
               
              | 
           
          
            | 
			 | 
           
         
	    
		             | 
		
			  | 
	 
	
		
			  | 
		  | 
		
			  | 
		
			  | 
	 
 
              
  
          
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 icon: 'http://localhost/TeawThai/admin/fileupload/252852671.002.png', 
 
 
ถ้าเวลาใช้งานจริง ไม่ต้องอ้างแบบนี้ครับ 
ให้อ้าง Path รูป ไปเลย สมมุติไฟนี้อยู่ใน Folder ชื่อ TeawThai  ก็อ้างแค่ 
 
 
icon: 'admin/fileupload/252852671.002.png', 
 
 
แบบนี้น่าจะออกนะ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2012-11-21 22:07:46 | 
                        By :
                            deawx | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 อ๋อค่ะพี่ แต่ไอคอนก็ออกปกตินะค่ะ 
ติดตรงรูปที่มันไม่ยอมออก ต้องอ้างดาต้าเบสด้วยหรือเปล่าค่ะ ถึงจะมา                        
               
               | 
             
            
              
			                
  ประวัติการแก้ไข 2012-11-21 22:16:59              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2012-11-21 22:15:32 | 
                        By :
                            mickijung | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 <img src="imagesupload/<?=$rs[images]?>">  แบบนี้ไม๊ครับ เพราะไม่เห็น และไม่ทราบว่า อัปไว้ใหน  
ก็ต้องทำตามพาธที่เราอัปไว้ครับ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2012-11-21 22:32:12 | 
                        By :
                            deawx | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ลองแล้วก็ไม่ได้อ่ะค่ะ จนปัญญา 
ต้องไปเรียกใน xml ด้วยป่ะค่ะ หรือเรียกแค่ html 
 
Code (PHP) 
var html = "<img src='/image/place/<?=$rs[Image];?>'>" + "<br/><b>" + PlaceName + "</b><br/>" + address ;
                         
               
               | 
             
            
              
			                
  ประวัติการแก้ไข 2012-11-22 10:02:21 2012-11-22 10:04:43              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2012-11-22 09:57:19 | 
                        By :
                            mickijung | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ลองรันไฟล์ xml ดูซิครับว่าผลลัพธ์มันถูกไหม 
 
หรือว่าจะ viewsource เอากูได้นะว่า path ของรูปมันถูกต้องหรือเปล่า                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2012-11-24 23:01:08 | 
                        By :
                            ikikkok | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 เอากู ( ไม่เอาเฟร้ย )  
อากู  ( ไม่ใช่เฟร้ย พ่อไม่มีน้อง ) 
 
สุดท้าย Google กุ๊กเล่ กูเกิ้ล  โปรดใส่ english เพื่อความไม่สับสน                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2012-11-25 00:56:46 | 
                        By :
                            deawx | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
      		  
	
     | 
   
 
                 |