Name Last modified Size Description
Parent Directory -
README.html 08-Apr-2008 10:58 4.2K
lib/ 08-Apr-2008 10:58 -
| Path: | README |
| Last Update: | Thu Apr 26 17:46:18 +0900 2007 |
MapSimpleApi Version 0.0.1
Version 0.0.1 - 2007/04/26 Initial Release
by Junya Ishihara <blog.champierre.com>
This plugin is a library to use Map Simple API on Ruby on Rails.
Run
script/plugin install http://rails-workshop-tokyo.googlecode.com/svn/trunk/plugins/map_simple_api
or checkout the source into your plugins folder.
svn checkout http://rails-workshop-tokyo.googlecode.com/svn/trunk/plugins/map_simple_api
class StationController < ApplicationController
def list_by_coordinates
begin
map_simple_api = MapSimpleApi::StationApi.new
@stations = map_simple_api.get_stations_by_coordinates(139.8025, 35.6657)
render :action => 'list'
rescue MapSimpleApiError => e
render :text => "API 呼び出し失敗 : #{e}"
end
end
def list_by_address
begin
map_simple_api = MapSimpleApi::StationApi.new
@stations = map_simple_api.get_stations_by_address('中央区銀座6-4')
render :action => 'list'
rescue MapSimpleApiError => e
render :text => "API 呼び出し失敗 : #{e}"
end
end
end
<%- @stations.each do |station| -%>
Name: <%=station.name%><br>
Line: <%=station.line%><br>
Prefecture: <%=station.prefecture%><br>
TravelTime: <%=station.traveltime%><br>
<hr>
<%- end -%>
You can create the documentation by running:
rake rdoc
open-uri rexml/document
Map Simple API map.simpleapi.net/
This plugin is released under the MIT license. See MIT-LICENSE for details.
Please leave a comment or send a trackback to