More Related Content
More from Boo' Noypeng (20)
Javascript & Python
- 20. การทาเกรด
<html>
<head>
</head>
<body>
<script>
var score = prompt("Please insertyourscore")
if((score >=80)&&(score <= 100))
{
alert("Youhave Grade A")
}
else if ((score >=75)&&(score <= 79))
{
alert("Youhave Grade B+")
}
else if ((score >=70)&&(score <= 74))
{
alert("Youhave Grade B")
}
else if ((score >=65)&&(score <= 69))
{
alert("Youhave Grade C+")
}
else if ((score >=60)&&(score <= 64))
{
alert("Youhave Grade C")
}
else if ((score >=55)&&(score <= 59))
{
- 27. TRY IT YOURSELF
<!DOCTYPE html>
<html>
<head>
<title>Simple Map</title>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<style>
/* Always set the map height explicitly to define the size of the
div
* element that contains the map. */
#map {
height: 100%;
}
/* Optional: Makes the sample page fill the window. */
html, body {
height: 100%;
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<div id="map"></div>
<script>
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: -34.397, lng: 150.644},
zoom: 8
});
}
</script>
<script
src="https://maps.googleapis.com/maps/api/js?key= YOUR_API_KEY &callback
=initMap"
async defer></script>
</body>
</html>
- 46. ใส่หมุด 2
var marker2 = newgoogle.maps.Marker({
position:{lat:13.296552, lng:100.913317},
map : map,
title :'SeansukTemple'
});
- 48. center:{lat:13.277605,lng:100.926524},
mapTypeId:'roadmap'
});
var iconBase = 'https://maps.google.com/mapfiles/kml/shapes/';
var icons= {
parking:{
icon:iconBase + 'parking_lot_maps.png'
},
library:{
icon:iconBase + 'library_maps.png'
},
info:{
icon:iconBase + 'info-i_maps.png'
}
};
functionaddMarker(feature){
var marker= new google.maps.Marker({
position:feature.position,
icon:icons[feature.type].icon,
map: map
});
}
var features= [
{
position:{lat:13.288134,lng:100.912272},
type:'info'
}, {
position:{lat:13.276648,lng:100.924912},
type:'parking'
}, {
- 62. <!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0">
<meta charset="utf-8">
<title>KML feature details</title>
<style>
html, body {
height:100%;
margin: 0;
padding: 0;
}
#map {
float: left;
height:100%;
width: 79%;
}
#content-window{
float: left;
font-family:'Roboto','sans-serif';
height:100%;
line-height:30px;
padding-left:10px;
width: 19%;
}
</style>
</head>
<body>
<div id="map"></div>
<div id="content-window"></div>
<script>
- 63. functioninitMap() {
var map = newgoogle.maps.Map(document.getElementById('map'),{
zoom: 12,
center:{lat: 13.277605, lng: 100.926524}
});
var kmlLayer = new google.maps.KmlLayer({
url: 'https://sites.google.com/site/notps015858170118/googlemap/HAll.kml?attredirects=0&d=1',
suppressInfoWindows:true,
map: map
});
kmlLayer.addListener('click',function(kmlEvent) {
var text= kmlEvent.featureData.description;
showInContentWindow(text);
});
functionshowInContentWindow(text) {
var sidediv= document.getElementById('content-window');
sidediv.innerHTML= text;
}
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCNFXauWf_NpL6zhFlYlo6ft8329k6YW
cU&callback=initMap">
</script>
</script>
</body>
</html>
- 82. <divid="map"></div>
<script>
functioninitMap(){
var map = newgoogle.maps.Map(document.getElementById('map'),{
center: {lat:24.886, lng: -70.268},
zoom: 5,
mapTypId: 'terrain'
})
}
</script>
<script
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBsF92R_TGBBGjc9rdR5In78A5fjXZVWuE
&callback=initMap"
async defer></script>
- 84. var triangleCoords=[
{lat:25.774, lng:-80.190},
{lat:18.466, lng:-66.118},
{lat:32.321, lng:-64.757},
{lat:25.774, lng:-80.190}
];
var bermuda= newgoogle.maps.Polygon({
paths: triangleCoords,
strokeColor:'#000000',
strokeOpacity:0.5,
strokeWeight:3,
fillColor:'#FF0101',
fillOpacity:0.8
});
bermuda.setMap(map);