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
7 8 9 |
# File 'app/models/concerns/blacklight_iiif_search/annotation_behavior.rb', line 7 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
14 15 16 |
# File 'app/models/concerns/blacklight_iiif_search/annotation_behavior.rb', line 14 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
23 24 25 26 |
# File 'app/models/concerns/blacklight_iiif_search/annotation_behavior.rb', line 23 def coordinates return '' unless query '#xywh=0,0,0,0' end |