การใช้ Google Map Api หาเส้นทาง จากจุดสองจุด
15
Oct
Posted by: admin in: javascript, php
<?php
require('GoogleMapAPI.class.php');
$map = new GoogleMapAPI('map1');
$map->setAPIKey('ABQIAAAAPOHd09dXhJtbKHeZpxlh6BTdM_BGb_HRDyhTa-dAuFdRUQ382BTsqAFfGu_x3jaT_hgEvzyEiREMIg');
$map->setMapType('map');
$map->enableInfoWindow();
$map->enableDirections();
$map->setInfoWindowTrigger('mouseover');
$map->setWidth('400px');
$map->setHeight('400px');
$map->setFT('13.786987220018625,100.60581922531128','13.780276823001238,100.60309410095215');
?>
<html ">
<head>
<?php $map->printHeaderJS(); ?>
<?php $map->printMapJS(); ?>
<!-- necessary for google maps polyline drawing in IE -->
<style type="text/css">
v\:* {
behavior:url(#default#VML);
}
</style>
</head>
<body onload="onLoad()">
<table border=0>
<tr><td>
<?php $map->printMap(); ?>
</td>
<td>
<?php $map->printSidebar(); ?>
<div id="route"></div>
</td>
</tr>
</table>
</body>
</html>