Class: Juli::Macro::Jmap
- Inherits:
-
TemplateBase
- Object
- Base
- TemplateBase
- Juli::Macro::Jmap
- Defined in:
- lib/juli/macro/jmap.rb
Overview
generate Map HTML.
The purpose of this macro is to provide I/F for map. When map-site(like google) service is discontinued, or URL is changed, it is enough to change:
-
.juli/config jmap entry or
-
this macro implementation.
There is no need to modify all of wiki pages which use ‘jmap’ macro.
‘J’ of jmap stands for Juli. it is because ‘map’ in ruby is quite common method so that necessary to avoid name confusion.
Currently, Google map is used.
Constant Summary collapse
- DEFAULT_TEMPLATE =
Thank you, mapki.com/wiki/Google_Map_Parameters !!
'<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?q=loc:%{coord}&num=1&ie=UTF8&t=m&z=14&output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?q=loc:%{coord}&num=1&ie=UTF8&t=m&z=14&source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small>'
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from TemplateBase
#conf_key, #run, #set_conf_default
Methods inherited from Base
#after_root, #initialize, #on_root, #run, #set_conf_default
Methods included from Util
#camelize, conf, find_template, in_filename, juli_repo, mkdir, out_filename, str_limit, str_trim, to_wikiname, underscore, usage, visitor, visitor_list
Constructor Details
This class inherits a constructor from Juli::Macro::Base
Class Method Details
.conf_template ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/juli/macro/jmap.rb', line 25 def self.conf_template <<EOM # HTML template to draw map. If not set, default defined at # Juli::Macro::Jmap::DEFAULT_TEMPLATE is used. # %{coord} in the template wiil be replaced to the actual 1st parameter. # #jmap: '#{DEFAULT_TEMPLATE}' EOM end |
Instance Method Details
#place_holder ⇒ Object
35 |
# File 'lib/juli/macro/jmap.rb', line 35 def place_holder; 'coord'; end |