<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Google Map</title>
<script src="https://maps.google.com/maps/api/js?language=ja&key=YOUR_KEY"></script>
</head>
<body>
地図の表示例
<div id="map" style="width:480px; height:320px"></div>
<script>
var mapOptions = {
zoom: 15, // 地図の縮尺値
center:new google.maps.LatLng(35.681, 139.767), // 地図中心緯度と経度
mapTypeId: 'roadmap' // 地図の種類
};
// 地図を複数表示する場合は,表示要素(場所)を変えてオプションで緯度,経度を設定
var map = new google.maps.Map(document.getElementById('map'), mapOptions);
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Google Map</title>
</head>
<body>
<img src="https://maps.googleapis.com/maps/api/staticmap?
size=480x320¢er=35.681, 139.767&zoom=15&key=YOUR_KEY">
</body>
</html>
implementation
uses
UrlMon,
PNGImage,
GIFImg,
jpeg;
{$R *.dfm}
//=============================================================================
// ダウンロードと TImage への画像表示
//=============================================================================
procedure TForm1.Button1Click(Sender: TObject);
var
LMapSrc : string;
LSavePath : string;
begin
LMapSrc := 'https://maps.googleapis.com/maps/api/staticmap'
+ '?center=35.681, 139.767'
+ '&size=480x320'
+ '&zoom=14'
+ '&sensor=false'
+ '&language=ja'
+ '&key=YOUR_KEY';
LSavePath := ExtractFilePath(Application.ExeName) + 'staticmap.png';
URLDownloadToFile(nil, PChar(LMapSrc), PChar(LSavePath), 0, nil);
Image1.Picture.LoadFromFile(LSavePath);
end;