|
|
|
สอบถามปัญหาเมื่อ data เกิน 500 google api v3 heatmaps ไม่แสดงผลครับ |
|
|
|
|
|
|
|
เอาโค้ดมาดูครับ
|
|
|
|
|
Date :
2013-07-16 15:27:46 |
By :
deawx |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ยังงมไม่ออกเลย ช่วยทีครับพี่
Code (PHP)
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>heatmap</title>
<link href="default.css" rel="stylesheet">
<script src="http://maps.google.com/maps/api/js?v=3.exp&libraries=visualization&sensor=true"
type="text/javascript"></script>
</head>
<body>
<div id = "map" ></div>
<?php
require("login_info.php");
$objConnect = mysql_connect($host,$username,$password);
$objDB = mysql_select_db("$database");
$strSQL= "SELECT * FROM a WHERE member LIKE '%Ta%' " ;
$objQuery = mysql_query($strSQL) or die (mysql_error());
mysql_close($objConnect);
?>
<script type="text/javascript">
var locations = [ <?php while($objResult = mysql_fetch_array($objQuery))
{
?>
['data',<?=$objResult["LATITUDE"];?>,<?=$objResult["LONGITUDE"]; ?>,<?=$objResult["Data"];?>],
<?php } ?>
];
// map google
var map = new google.maps.Map(document.getElementById('map'),
{
zoom: 5,
center: new google.maps.LatLng(13.719374,100.581207),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
//data google map
var infowindow = new google.maps.InfoWindow();
//heatmap
var heatmap;
var heatmap1 ;
var y;
var heatmapData = [];
var heatmapData1 = [];
for ( var y = 0; y < locations.length; y++)
{
var d = locations[y][3];
var gradient;
if (d <= 300)
{
heatmapData1.push(new google.maps.LatLng(locations[y][1],locations[y][2]));
}
else{
heatmapData.push(new google.maps.LatLng(locations[y][1],locations[y][2]));
}
}
heatmap = new google.maps.visualization.HeatmapLayer
({
data: heatmapData,
gradient:[
'rgba(0, 255, 255, 0)',
'rgba(255, 0, 0, 1)',
],
map:map
});
heatmap1 = new google.maps.visualization.HeatmapLayer
({
data: heatmapData1,
gradient:[
'rgba(0, 255, 255, 0)',
'rgba(0, 255, 255, 1)',
'rgba(0, 191, 255, 1)',
'rgba(0, 127, 255, 1)',
'rgba(0, 63, 255, 1)',
'rgba(0, 0, 255, 1)',
'rgba(0, 0, 223, 1)',
'rgba(0, 0, 191, 1)',
'rgba(0, 0, 159, 1)',
'rgba(0, 0, 127, 1)',
'rgba(63, 0, 91, 1)',
'rgba(127, 0, 63, 1)',
'rgba(191, 0, 31, 1)',
'rgba(255, 0, 0, 1)' ],
map:map
});
</script>
</body>
</html>
|
ประวัติการแก้ไข 2013-08-13 14:49:32
|
|
|
|
Date :
2013-08-13 14:40:41 |
By :
zxperiaz |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|