Java Script Map Direction LP2MARAY
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps API v3 Directions Example</title>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key=AIzaSyBhSg6I2JvHNU_jLqIpvc5MEwc_xi3Ttvg&sensor=true"></script>
</head>
<body style="font-family: Arial; font-size: 12px;">
<div style="width: 1020px;">
<div id="map" style="width: 280px; height: 400px; float: left;"></div>
<div id="panel" style="width: 300px; float: right;"></div>
</div>
<script type="text/javascript">
var directionsService = new google.maps.DirectionsService();
var directionsDisplay = new google.maps.DirectionsRenderer();
var map = new google.maps.Map(document.getElementById('map'), {zoom:7,mapTypeId: google.maps.MapTypeId.ROADMAP
});
directionsDisplay.setMap(map);
directionsDisplay.setPanel(document.getElementById('panel'));
var Asal = new google.maps.LatLng(-6.353394, 106.832300);
var Tujuan= new google.maps.LatLng(-6.331501, 106.846371);
var request = {
origin: Asal,
destination: Tujuan,
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
}
});
</script>
</body>
</html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>Google Maps API v3 Directions Example</title>
<script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key=AIzaSyBhSg6I2JvHNU_jLqIpvc5MEwc_xi3Ttvg&sensor=true"></script>
</head>
<body style="font-family: Arial; font-size: 12px;">
<div style="width: 1020px;">
<div id="map" style="width: 280px; height: 400px; float: left;"></div>
<div id="panel" style="width: 300px; float: right;"></div>
</div>
<script type="text/javascript">
var directionsService = new google.maps.DirectionsService();
var directionsDisplay = new google.maps.DirectionsRenderer();
var map = new google.maps.Map(document.getElementById('map'), {zoom:7,mapTypeId: google.maps.MapTypeId.ROADMAP
});
directionsDisplay.setMap(map);
directionsDisplay.setPanel(document.getElementById('panel'));
var Asal = new google.maps.LatLng(-6.353394, 106.832300);
var Tujuan= new google.maps.LatLng(-6.331501, 106.846371);
var request = {
origin: Asal,
destination: Tujuan,
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
}
});
</script>
</body>
</html>

Komentar
Posting Komentar