Back to Home -> All Cate -> บทความดีๆ ที่เกี่ยวกับเรื่อง IT
การสมัครใช้งาน Google Maps API
การสมัครใช้งาน Google Maps API
การจะนำ Google Maps มาพัฒนาต่อยอดได้นั้น ผู้พัฒนาจะต้องสมัครเพื่อขอใช้งาน Google Maps API ก่อน ซึ่งมีรายละเอียดปลีกย่อยบางอย่างที่ควรจะรู้ดังนี้
Google Maps API มีบริการ 2 รูปแบบ คือแบบฟรีสำหรับผู้ใช้ทั่วไป ซึ่งผู้ใช้อินเทอร์เน็ตทั่วโลกสามารถเรียกดู ได้ และแบบ Premier สำหรับลูกค้าองค์กรที่ต้องการนำ Google Maps ไปใช้ใน Intranet ของบริษัท
การสมัครใช้ Google Maps API คุณจะต้องมี Google Account และมีเว็บไซต์อยู่แล้ว โดยจะต้องระบุชื่อเว็บไซต์ของคุณทันทีที่สมัคร
ถ้าสมัครด้วยชื่อเว็บ http://www.googlemaps.in.th/ API Key ที่ได้รับจะใช้งานได้กับ
- http://www.googlemaps.in.th/
- http://www.googlemaps.in.th/path/
แต่จะใช้งานไม่ได้กับ
- http://googlemaps.in.th/
- http://subdomain1.googlemaps.in.th/
- http://subdomain2.googlemaps.in.th/path/
หากต้องการให้ใช้งานได้กับเว็บที่ระบุมาทั้งหมดนี้ จะต้องสมัครด้วย http://googlemaps.in.th/
หลังจากที่สมัครแล้ว Google Maps จะแสดงตัวอย่างโค้ดสำหรับแสดงแผนที่บนเว็บไซต์ของคุณ คุณสามารถนำไปใส่ไว้ในเว็บเพื่อตรวจสอบว่าแผนที่แสดงผลถูกต้องหรือไม่…ได้ ทันที
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Maps JavaScript API Example</title>
<script src="http://maps.google.com/maps?file=api&v=2&key=abcdefg"
type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
}
}
//]]>
</script>
</head>
<body onload="load()" onunload="GUnload()">
<div id="map_canvas" style="width:500px;height:300px"></div>
</body>
</html>
สมัครใช้งาน Google Maps API ได้ที่ Sign Up for the Google Maps API

yuranun
Post on : 2011-04-11 ip : 115.87.18xxx [ แจ้งลบ ]