Sha256: ecf51123d71ae5e1bc18cb09d42a425ba732ecf396b73f46185b535494af76b5
Contents?: true
Size: 1.43 KB
Versions: 13
Compression:
Stored size: 1.43 KB
Contents
# coding: UTF-8 require 'juli/macro/template_base' module Juli module Macro # 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 # 1. 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. class Jmap < TemplateBase # Thank you, http://mapki.com/wiki/Google_Map_Parameters !! DEFAULT_TEMPLATE = '<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>' 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 def place_holder; 'coord'; end end end end
Version data entries
13 entries across 13 versions & 1 rubygems