การติดตั้ง Google Map บน GCMS เวอร์ชั่น 2.0

การติดตั้ง Google Map เริ่มต้นก็ ดาวน์โหลดโมดูล map ไปติดตั้งครับ

หลังจากนั้นต้องไปขอ Key จาก Google กันก่อนครับ ที่ http://code.google.com/apis/maps/signup.html โดยคุณต้องมี บัญชี Google อยู่แล้วด้วย

หลังจากนั้นคุณก็จะได้ Key มา อันที่จริงมันจะมีตัวอย่างโค้ดให้ด้วย ไม่ต้องไปสนใจมันครับ ให้นำ เฉพาะ Key มาใช้ (Your key is:)

เมื่อได้ Key มาแล้ว ให้มากำหนดในส่วน $head ของ GCMS ที่หน้า index.php ครับ

$head .= '<script src = "counter/counter.js.php?ref='.rawurlencode( $_SERVER[HTTP_REFERER] )."\" type=\"text/javascript\"></script>\n";
$head .= '<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAb3BfWl-SpqZ8R1emGxDqCBRJG_4nEn8VOqa27csaKFcrhc9nFRTfD4P00Gfm3Her0PWher8Owe22yw" type="text/javascript"></script>';
$head .= "\n<script type=\"text/javascript\">\n";

แล้วก็แก้ไข bin/config.php ให้ GCMS รู้จัก โมดูล map ที่ติดตั้งเพิ่ม

// รายการโมดูลที่ติดตั้ง เรียงลำดับตาม TOP MENU
// โดยใช้ชื่อโฟลเดอร์ของโมดูลนั้นๆ

$config[modules][] = 'main';
$config[modules][] = 'webboard';
$config[modules][] = 'gallary';
$config[modules][] = 'history';
$config[modules][] = 'about';
$config[modules][] = 'members';
$config[modules][] = 'rss';
$config[modules][] = 'article';
$config[modules][] = 'poll';

$config[modules][] = 'map';

เพียงแค่นี้ เราก็จะได้ Google Map มาใช้งานบน GCMS แล้วครับ

11 สค. 2552 08:22 | 0 | ดู 343 | การติดตั้ง Google Map บน GCMS เวอร์ชั่น 2.0