| Class | Ym4r::GmPlugin::GTileLayer |
| In: |
lib/gm_plugin/layer.rb
|
| Parent: | Object |
Abstract Tile layer. Subclasses must implement a get_tile_url method.
| copyright | [RW] | |
| format | [RW] | |
| opacity | [RW] | |
| zoom_range | [RW] |
Options are the following, with default values: :zoom_range (0..17), :copyright ({‘prefix’ => ’’, ‘copyright_texts’ => [""]}), :opacity (1.0), :format ("png")
# File lib/gm_plugin/layer.rb, line 53
53: def initialize(options = {})
54: @opacity = options[:opacity] || 1.0
55: @zoom_range = options[:zoom_range] || (0..17)
56: @copyright = options[:copyright] || {'prefix' => '', 'copyright_texts' => [""]}
57: @format = (options[:format] || "png").to_s
58: end
# File lib/gm_plugin/layer.rb, line 60
60: def create
61: "addPropertiesToLayer(new GTileLayer(new GCopyrightCollection(\"\"),#{zoom_range.begin},#{zoom_range.end}),#{get_tile_url},function(a,b) {return #{MappingObject.javascriptify_variable(@copyright)};}\n,function() {return #{@opacity};},function(){return #{@format == "png"};})"
62: end