Google Map route
Posted on : 22-10-2009 | By : saturngod | In : javascript
Tags: Google, Google Map, Map
0
Google Map ကို အသံုးျပဳျပီး ဘယ္လို route လုပ္လို့ရလဲဆိုတာ ေရးထားတာပါ။
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<title>Google Maps JavaScript API Example: Simple Directions</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<script src="jquery.js"></script>
<script src="http://maps.google.com/maps?file=api&v=2.x&key=ABQIAAAAx7usLuV6Sad32xMlAFXpHhQJCBv2UIT7jRqait5DVA72by8fFxTgDNiQIRVqhNTcxCLEibS36E-Q2A"
type="text/javascript"></script>
<script type="text/javascript">
// Create a directions object and register a map and DIV to hold the
// resulting computed directionsvar map;
var directionsPanel;
var directions;function initialize() {
map = new GMap2(document.getElementById("map_canvas"));
var geocoder = new GClientGeocoder();from="Blk 726,#03-346,Clementi West Street 2, Singapore 120729 ";
to="8 Prince George's Park Singapore 118407";// map.setCenter(new GLatLng(42.351505,-71.094455), 15);
directionsPanel = document.getElementById("route");
directions = new GDirections(map, directionsPanel);
directions.load("from: "+from+" to: "+to);
}
</script>
</head><body >
<div id="map_canvas" style="width: 70%; height: 480px; float:left; border: 1px solid black;"></div>
<div id="route" style="width: 25%; height:480px; float:right; border; 1px solid black;"></div><br/>
</body>
</html>




