-
Add a note to the image.
-
Triggers the "onAdd" callback to insert the markup for the marker
-
Stores the note location and text into the marker element
-
Binds the click event of the marker element to trigger the onShow or onEdit callbacks dependant on the canEdit option.
-
Arguments:
-
note: a javascript object which must have at least a note.x, note.y and note.note properties where x and y is the relative image location of the note and note is the associated text.
-
Returns the marker element
elem = $("#image1").imgNotes("addNote",{x: 0.4, y: 0.3, note: "Note <b>Text</b>"});
-
Get the number of notes in the widget
-
Arguments: none
-
Returns: the number of notes in the widget
count = $("#image1").imgNotes("count");
-
Delete all the notes from the widget
-
Arguments: none
-
Returns: none
$("#image1").imgNotes("clear");
-
Delete all the notes and removes the widget
-
Arguments: none
-
Returns: nothing
$("#image1").imgNotes("destroy");
-
Add notes from a javascript array to the widget
-
Arguments - a javascript array of note objects.
[
{
x: relative x image coordinate,
y: relative y image coordinate,
note: the note text
},...
]
-
Returns: the widget object for chainability
$("#image1").imgNotes("import", [ {x: "0.5", y:"0.5", note:"AFL Grand Final Trophy"},
{x: "0.322", y:"0.269", note: "Brisbane Lions Flag"},
{x: "0.824", y: "0.593", note: "Fluffy microphone"}
]);
-
Export notes in the widget to a javascript array
-
Arguments: none
-
Returns - a javascript array of note objects:
[
{
x: relative x image coordinate,
y: relative y image coordinate,
note: the note text
},...
]
notes = $("#image1").imgNotes("export");
-
Pan the view to be centred at the given relative image coordinates
-
Arguments:
-
relx: relative x image coordinate
-
rely: relative y image coordinate
-
-
Returns a javascript object with the relative image coordinates of the view centre after snapping the edges of the zoomed image to the view boundaries.
{
x: view center relative x image coordinate,
y: view center relative y image coordinate
}
-
Returns null if the relative image coordinates are not >=0 and ⇐1 and the view is not changed.
$("#image1").imgNotes("panTo", 0.5,0.0);