Class: Juli::Macro::Jmap

Inherits:
TemplateBase show all
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:

  1. .juli/config jmap entry or

  2. 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 =
'<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?q=loc:%{coord}&amp;num=1&amp;ie=UTF8&amp;t=m&amp;z=14&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?q=loc:%{coord}&amp;num=1&amp;ie=UTF8&amp;t=m&amp;z=14&amp;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_templateObject



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_holderObject



35
# File 'lib/juli/macro/jmap.rb', line 35

def place_holder; 'coord'; end