google map หมุดขึ้นแค่จุดกึ่งกลางและก็อี1อัน ขึ้นไม่หมดครับ

ถาม-ตอบ แนะนำไอเดียว โค้ดตัวอย่าง แนวทาง วิธีแก้ปัญหา google map หมุดขึ้นแค่จุดกึ่งกลางและก็อี1อัน ขึ้นไม่หมดครับ

google map หมุดขึ้นแค่จุดกึ่งกลางและก็อี1อัน ขึ้นไม่หมดครับ
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=tis-620" />
<title>แผนที่หอพัก</title>
<style type="text/css">
html {
height: auto;
}
 
body {
height: auto;
margin: 0;
padding: 0;
}
#map {
    width:1000px;
    height:650px;
    margin:auto;
    margin-top:50px;
}
 
@media print {
#map {
height: 950px;
}
}
 
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript"
 
 
<script type="text/javascript">
google.load('earth', '1');
var map;
var googleEarth;
function init() {
map = new google.maps.Map(document.getElementById('map'), {
center: new google.maps.LatLng(14.85467, 103.48357),
zoom: 13,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
googleEarth = new GoogleEarth(map);
 
var locations = [
['มหาวิทยาลัยเทคโนโลยีราชมงคลอีสาน วิทยาเขตสุรินทร์', 14.85467, 103.48357],
<?php
include"connect.php";
 
$sql="SELECT id_prd,name_prd,lat_prd,lng_prd, ( 6371 * acos( cos( radians(14.85467) ) * cos( radians( lat_prd ) ) * cos( radians( lng_prd ) - radians(103.48357) ) + sin( radians(14.85467) ) * sin( radians( lat_prd ) ) ) ) AS distance FROM tb_product ";
$result=mysql_db_query($db_Name,$sql);
while($rs=mysql_fetch_array($result)){
$lat_prd=$rs[lat_prd];
$lng_prd=$rs[lng_prd];
$name_prd=$rs[name_prd];}
?>
['<?=$name_prd?>', <?=$lat_prd?>, <?=$lng_prd?>]
];
 
var infowindow = new google.maps.InfoWindow();
 
var marker, i; for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
draggable : false,
title : locations[i][0],
map: map
});
 
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})
(marker, i));
}
}
google.maps.event.addDomListener(window, 'load', init);
</script>
</head>
 
  <body onLoad="load()" onUnload="GUnload()">
   Radius:<input type="text" id="radiusSelect"/>
 
    <input type="button" onClick="searchLocations()" value="Search Locations"/>
    <br/>   
    <br/>
<div style="width:600px; font-family:Arial,
sans-serif; font-size:11px; border:1px solid black">
  <table>
    <tbody>
      <tr id="cm_mapTR">
 
        <td width="200" valign="top"> <div id="sidebar" style="overflow: auto; height: 400px; font-size: 11px; color: #000"></div>
 
        </td>
        <td> <div id="map" style="overflow: hidden; width:400px; height:400px"></div> </td>
 
      </tr>
    </tbody>
  </table>
</div>   
  </body>
</html>

 

 



Buraratn 30-06-2011 22:05:17

คำแนะนำ และการใช้งาน

สมาชิก กรุณา ล็อกอินเข้าระบบ เพื่อตั้งคำถามใหม่ หรือ ตอบคำถาม สมาชิกใหม่ สมัครสมาชิกได้ที่ สมัครสมาชิก


  • ถาม-ตอบ กรุณา ล็อกอินเข้าระบบ
  • เปลี่ยน


    ( หรือ เข้าใช้งานผ่าน Social Login )

 ความคิดเห็นที่ 1

ไม่รุ้ว่าวนลูบผิดตรงไหนครับ ออกมาแค่อันเดียวครับ



buraratn 30-06-2011 22:06






เว็บไซต์ของเราให้บริการเนื้อหาบทความสำหรับนักพัฒนา โดยพึ่งพารายได้เล็กน้อยจากการแสดงโฆษณา โปรดสนับสนุนเว็บไซต์ของเราด้วยการปิดการใช้งานตัวปิดกั้นโฆษณา (Disable Ads Blocker) ขอบคุณครับ