Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > Client Script Forum > ช่วยหน่อยนะค่ะ โปรเจคใกล้จะต้องส่งแล้ว เกี่ยวgoogle maps ไม่แสดงผลบน chorm พอกดขอเส้นทางค่ะ



 

ช่วยหน่อยนะค่ะ โปรเจคใกล้จะต้องส่งแล้ว เกี่ยวgoogle maps ไม่แสดงผลบน chorm พอกดขอเส้นทางค่ะ

 



Topic : 092915



โพสกระทู้ ( 78 )
บทความ ( 0 )



สถานะออฟไลน์




[มันเป็นแบบนี้ค่ะ [เปิดใน chorm]
สสส

ความจริงมันจะต้องเป็นแบบนี้ค่ะ [อันนี้เปิดใน fire fox]
really

Code
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> var directionsDisplay; var directionsService = new google.maps.DirectionsService(); //Error var map; var oldDirections = []; var currentDirections = null; <? require("db.php"); $objConnect=mysql_connect ($hostname, $username, $password) or die("Error Connect to Database"); @mysql_query("SET character_set_results=UTF8"); @mysql_query("SET character_set_client='UTF8'"); @mysql_query("SET character_set_connection='UTF8'"); @mysql_query("collation_connection = utf8_unicode_ci"); @mysql_query("collation_database = utf8_unicode_ci"); @mysql_query("collation_server = utf8_unicode_ci"); $objDB = mysql_select_db("s52530315"); //Error $sql = "select * from place where name_place ='".$_GET['end']."' limit 0 , 1;"; $query = mysql_query($sql); while($row = mysql_fetch_assoc($query)){ $MLat = $row["latitude"]; $MLng = $row["longitude"]; } $sqlstart = "select * from place where name_place ='".$_GET['start']."' limit 0 , 1;"; $querystart = mysql_query($sqlstart); while($rowstart = mysql_fetch_assoc($querystart)){ $MLatstart = $rowstart["latitude"]; $MLngstart = $rowstart["longitude"]; } ?> var start = new google.maps.LatLng(<?=$MLatstart?>,<?=$MLngstart?>); var end = new google.maps.LatLng(<?=$MLat?>,<?=$MLng?>); if(start==""){ start = new google.maps.LatLng(13.754059,100.493317); } function initialize() { var myOptions = { zoom: 12, center:start, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); directionsDisplay = new google.maps.DirectionsRenderer({ 'map': map, 'preserveViewport': true, 'draggable': true }); directionsDisplay.setPanel(document.getElementById("directions_panel")); google.maps.event.addListener(directionsDisplay, 'directions_changed', function() { if (currentDirections) { oldDirections.push(currentDirections); } currentDirections = directionsDisplay.getDirections(); }); calcRoute("DRIVING"); } function calcRoute(mode) { if(mode=='WALKING') mode = google.maps.DirectionsTravelMode.WALKING else mode = google.maps.DirectionsTravelMode.DRIVING var request = { origin:start, destination:end, travelMode: mode }; directionsService.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); } }); } </script> </head> <body onLoad="initialize()"> <div id="map_canvas" style="float:left;width:70%;height:100%"></div> <div style="float:right;width:30%;height:100%;overflow:auto"> <div> <h2>การเดินทาง</h2> <input type="button" value="รถยนต์" id="ddrive" onClick="calcRoute('DRIVING')" /> <input type="button" value="เดินเท้า" id="dwalk" onClick="calcRoute('WALKING')"/> </div> <div id="directions_panel" style="width:100%"></div> </div> </body> </html>



ช่วยที่นะค่ะ ไม่รู้จะแก้ยังไงแล้วค่ะ ช่วยแกทีนะค่ะ T^T



Tag : HTML/CSS, jQuery









ประวัติการแก้ไข
2013-03-24 13:42:23
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-03-24 13:39:28 By : sweetwater View : 1418 Reply : 2
 

 

No. 1



โพสกระทู้ ( 27 )
บทความ ( 0 )



สถานะออฟไลน์


ลองอ่านนี่ดูครับ น่าจะช่วยได้นะ

http://stackoverflow.com/questions/14229695/google-maps-api-throws-uncaught-referenceerror-google-is-not-defined-only-whe







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-03-24 13:59:16 By : dottedes
 


 

No. 2



โพสกระทู้ ( 78 )
บทความ ( 0 )



สถานะออฟไลน์


ยังไม่ได้อยู่ดีอ่าค่ะ T^T
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-03-24 15:07:21 By : sweetwater
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ช่วยหน่อยนะค่ะ โปรเจคใกล้จะต้องส่งแล้ว เกี่ยวgoogle maps ไม่แสดงผลบน chorm พอกดขอเส้นทางค่ะ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 05
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่