Index of /wp-content/uploads/2007/04/map_simple_api/rdoc/files

Icon  Name                    Last modified      Size  Description
[DIR] Parent Directory - [TXT] README.html 08-Apr-2008 10:58 4.2K [DIR] lib/ 08-Apr-2008 10:58 -
File: README

README

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>

Overview

This plugin is a library to use Map Simple API on Ruby on Rails.

Installing

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

Example Usage

Controller(station_controller.rb)

  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

View(list.rhtml)

  <%- @stations.each do |station| -%>
    Name: <%=station.name%><br>
    Line: <%=station.line%><br>
    Prefecture: <%=station.prefecture%><br>
    TravelTime: <%=station.traveltime%><br>
    <hr>
  <%- end -%>

Documentation

You can create the documentation by running:

  rake rdoc

Required files

open-uri rexml/document

Links

Map Simple API map.simpleapi.net/

License

This plugin is released under the MIT license. See MIT-LICENSE for details.

Feedback

Please leave a comment or send a trackback to

blog.champierre.com/archives/510

[Validate]