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.
5 6 7 8 |
# File 'lib/geoblacklight/wms_layer.rb', line 5 def initialize(params) @params = params.to_h.merge(Settings.WMS_PARAMS) @response = Geoblacklight::FeatureInfoResponse.new(request_response) end |
Instance Method Details
#feature_info ⇒ Object
18 19 20 |
# File 'lib/geoblacklight/wms_layer.rb', line 18 def feature_info @response.check end |
#request_response ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/geoblacklight/wms_layer.rb', line 22 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
14 15 16 |
# File 'lib/geoblacklight/wms_layer.rb', line 14 def search_params @params.except("URL") end |
#url ⇒ Object
10 11 12 |
# File 'lib/geoblacklight/wms_layer.rb', line 10 def url @params["URL"] end |