掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
GoogleMapのStaticmapを使用してMap表示するには (ID:149674)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
[Window10,Delphi10.3 Delphi Community Edition]で、下記動作を、すると、 エラー[Exception:HTTp/1.1 403 Forbidden]がでる URL:'http://maps.googleapis.com/map/api/staticmap?パラメータ' パラメータ:'center=35.0,135.0&size=640x320&scale=1&zoom=1&key=apikey' keyの設定:apikey:13桁-18桁_6桁、アプリケーションの制限:HTTPリファラー、APIの制限:キーを制限 で設定し、Google Maps Patform API Checker:緑色表示で確認OK ----------------------------- [A]formに、[Buttutton1][idhttp1][ImageMap(Timage)]を配置し [B]procedure TForm1.Button1Click(Sender) var StreamData :TMemoryStream; JPEGImage : TJPEGImage; Apikey,build,Url:string; begin buildUrl:=URL; StreamData := TMemoryStream.Create; JPEGImage := TJPEGImage.Create; try try idhttp1.Get(BuildURL, StreamData); //Send the request and get the image StreamData.Seek(0,soFromBeginning); JPEGImage.LoadFromStream(StreamData);//load the image in a Stream ImageMap.Picture.Assign(JPEGImage);//Load the image Except On E : Exception Do MessageDlg('Exception: '+E.Message,mtError, [mbOK], 0); End; finally StreamData.free; JPEGImage.Free; end; end; [C]コンパイルすると、エラー[EXceptinException HTTP/1.1 403 Forbidden] [D]Exception HTTP/1.1 403 forbiddenを、検索し、検討しましたが、原因不明:Google側? 宜しくご指導願います。
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.