Class: Geoblacklight::WmsLayer
- Inherits:
-
Object
- Object
- Geoblacklight::WmsLayer
- Defined in:
- lib/geoblacklight/wms_layer.rb
Instance Method Summary collapse
- #feature_info ⇒ Object
-
#initialize(params) ⇒ WmsLayer
constructor
A new instance of WmsLayer.
- #request_response ⇒ Object
- #search_params ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(params) ⇒ WmsLayer
Returns a new instance of WmsLayer.
4 5 6 7 |
# File 'lib/geoblacklight/wms_layer.rb', line 4 def initialize(params) @params = params.to_h.merge(Settings.WMS_PARAMS) @response = Geoblacklight::FeatureInfoResponse.new(request_response) end |
Instance Method Details
#feature_info ⇒ Object
17 18 19 |
# File 'lib/geoblacklight/wms_layer.rb', line 17 def feature_info @response.check end |
#request_response ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/geoblacklight/wms_layer.rb', line 21 def request_response conn = Faraday.new(url: url) conn.get do |request| request.params = search_params request..timeout = Settings.TIMEOUT_WMS request..open_timeout = Settings.TIMEOUT_WMS end rescue Faraday::ConnectionFailed, Faraday::TimeoutError => error Geoblacklight.logger.error error.inspect { error: error.inspect } end |
#search_params ⇒ Object
13 14 15 |
# File 'lib/geoblacklight/wms_layer.rb', line 13 def search_params @params.except('URL') end |
#url ⇒ Object
9 10 11 |
# File 'lib/geoblacklight/wms_layer.rb', line 9 def url @params['URL'] end |