Module: BlacklightIiifSearch::AnnotationBehavior
- Included in:
- IiifSearchAnnotation
- Defined in:
- app/models/concerns/blacklight_iiif_search/annotation_behavior.rb
Instance Method Summary collapse
-
#annotation_id ⇒ String
Create a URL for the annotation.
-
#canvas_uri_for_annotation ⇒ String
Create a URL for the canvas that the annotation refers to.
-
#coordinates ⇒ String
return a string like “#xywh=100,100,250,20” corresponding to coordinates of query term on image local implementation expected, value returned below is just a placeholder.
Instance Method Details
#annotation_id ⇒ String
Create a URL for the annotation
9 10 11 |
# File 'app/models/concerns/blacklight_iiif_search/annotation_behavior.rb', line 9 def annotation_id "#{controller.solr_document_url(parent_document[:id])}/canvas/#{document[:id]}/annotation/#{hl_index}" end |
#canvas_uri_for_annotation ⇒ String
Create a URL for the canvas that the annotation refers to
16 17 18 |
# File 'app/models/concerns/blacklight_iiif_search/annotation_behavior.rb', line 16 def canvas_uri_for_annotation "#{controller.solr_document_url(parent_document[:id])}/canvas/#{document[:id]}" + coordinates end |
#coordinates ⇒ String
return a string like “#xywh=100,100,250,20” corresponding to coordinates of query term on image local implementation expected, value returned below is just a placeholder
25 26 27 28 |
# File 'app/models/concerns/blacklight_iiif_search/annotation_behavior.rb', line 25 def coordinates return '' unless query '#xywh=0,0,0,0' end |