住所文字列を受け取って緯度経度を取得し地図を表示するサンプル CGI 2008-05-07-2 [Programming] 入力として住所文字列(例:渋谷区恵比寿)が渡されると、 API経由で緯度経度を取得し、 それをもとに alpslab base の地図ページを表示するという サンプル CGI (perl) です。 #!/usr/bin/perl -T use strict; use warnings; use CGI; use URI::Escape; use LWP::Simple; my $q = new CGI; my $ek = URI::Escape::uri_escape($q->param('q') || ""); my $apiurl = "http://base.alpslab.jp/position.rb?adr=$ek"; my $rslt = get($api
![住所文字列を受け取って緯度経度を取得し地図を表示するサンプル CGI](https://cdn-ak-scissors.b.st-hatena.com/image/square/af37977ee866988286b95e74fff98500a190545c/height=288;version=1;width=512/https%3A%2F%2Fchalow.net%2Fimages%2Ftcl-logo-25.png)