|
 |
|
ผมต้องการดึงข้อมูลมาโชว์ใน map api 3 ทำยังไงครับ......... |
|
 |
|
|
 |
 |
|
Code (PHP)
<!DOCTYPE html>
<html>
<?php
$str_server = "localhost";
$str_username = "art62";
$str_password = "vunsan142637";
$str_dbname = "V40";
$obj_con = mysql_connect($str_server,$str_username,$str_password);
mysql_select_db($str_dbname,$obj_con);
mysql_query("SET NAMES UTF8");
$str_sql = "Select * From im_dataschool ";
$rs_student = mysql_query($str_sql,$obj_con);
?>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="utf-8">
<title>Info windows</title>
<style>
html, body, #map-canvas {
height: 100%;
margin: 0px;
padding: 0px
}
</style>
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>
<script>
// This example displays a marker at the center of Australia.
// When the user clicks the marker, an info window opens.
function initialize() {
var myLatlng = new google.maps.LatLng(14.5421875562,104.675747644);
var mapOptions = {
zoom: 10,
center: myLatlng
};
var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
var contentString = 'dddddddd'
var infowindow = new google.maps.InfoWindow({
content: contentString
});
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Uluru (Ayers Rock)'
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874"></head>
<body>
<div id="map-canvas"></div>
</body>
</html><?php mysql_close($obj_con); ?>
Tag : JavaScript, JAVA

|
|
 |
 |
 |
 |
Date :
2014-07-04 18:50:02 |
By :
phuttawat |
View :
783 |
Reply :
2 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มาเขียน Google Map V3 แบบใช้ PHP กับ MySql กันมั่ง
ลอง Copy แล้วมารันดูครับ
|
 |
 |
 |
 |
Date :
2014-07-07 08:57:02 |
By :
mr.win |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับ
|
 |
 |
 |
 |
Date :
2014-07-07 20:38:45 |
By :
phuttawat |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|