PHP 透過 Google Map Geocode取得地址的經緯度

[php]
$address = $_GET["address"];
$url = "http://maps.google.com/maps/api/geocode/json?address=$address&sensor=false";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXYPORT, 3128);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$response = curl_exec($ch);
curl_close($ch);
$response_a = json_decode($response);
echo "您的地址:".$address."<br/>";
echo "所在的經度(latitude):".$lat = $response_a->results[0]->geometry->location->lat;
echo "<br />";
echo "所在的緯度(longitude):".$long = $response_a->results[0]->geometry->location->lng;
[/php]

Google Map panto試做

[javascript]
function Move2NextMarker1(){
var marker=markers1[tempMarker1];
map.panTo(markers1[tempMarker1].getPosition());
scontent = ‘<div id="iw-container">’ +
‘<div class="iw-title">’+markers[tempMarker1].title+'</div>’ +
‘<div class="iw-content">’ +markers[tempMarker1].description+
‘</div>’ +
‘<div class="iw-bottom-gradient"></div>’ +
‘</div>’;
infoWindow.setContent(scontent);
infoWindow.open(map,markers1[tempMarker1]);
setTimeout(Move2NextMarker1,5600);
tempMarker1=(tempMarker1+1)%(markers.length);

}
[/javascript]

Delphi路徑規劃函數

把上次Delphi結合簡易PHP路徑規劃,搬到XE3來用。
主要運用在
1) 餐飲系統的外送服務
2) 物流系統的地圖服務
發現Delphi XE3不用像上次D7一樣用到urlencode XD
[pascal]
uses IdURI,Vcl.OleCtrls, SHDocVw;
procedure TForm1.RoutePlan(sFrom, sTo: String; wb: TWebBrowser);
var str:String;
begin
str := ‘http://superlevin.ifengyuan.tw/mapapi.php?FROM=’+TIdURI.ParamsEncode(sFrom)+’&TO=’+TIdURI.ParamsEncode(sTo);
wb.Navigate(str);
end;
[/pascal]