| Class | Ym4r::GmPlugin::WMSLayer |
| In: |
lib/gm_plugin/layer.rb
|
| Parent: | GTileLayer |
Represents a TileLayer where the tiles are generated dynamically from a WMS server (MapServer, GeoServer,…) You need to include the JavaScript file wms-gs.js for this to work see docs.codehaus.org/display/GEOSDOC/Google+Maps
| base_url | [RW] | |
| layers | [RW] | |
| merc_proj | [RW] | |
| styles | [RW] | |
| use_geographic | [RW] |
Options are the same as with GTileLayer + :styles (""), :merc_proj (:mapserver), :use_geographic (false)
# File lib/gm_plugin/layer.rb, line 99
99: def initialize(base_url, layers, options = {})
100: super(options)
101: @base_url = base_url.gsub(/\?$/,"") #standardize the url
102: @layers = layers
103: @styles = options[:styles] || ""
104: merc_proj = options[:merc_proj] || :mapserver
105: @merc_proj = if merc_proj == :mapserver
106: "54004"
107: elsif merc_proj == :geoserver
108: "41001"
109: else
110: merc_proj.to_s
111: end
112: @use_geographic = options.has_key?(:use_geographic)? options[:use_geographic] : false
113: puts format
114: end
# File lib/gm_plugin/layer.rb, line 120
120: def create
121: "addWMSPropertiesToLayer(#{super},#{MappingObject.javascriptify_variable(@base_url)},#{MappingObject.javascriptify_variable(@layers)},#{MappingObject.javascriptify_variable(@styles)},#{MappingObject.javascriptify_variable(format)},#{MappingObject.javascriptify_variable(@merc_proj)},#{MappingObject.javascriptify_variable(@use_geographic)})"
122: end