- eventToImg - convert a leaflet event location to relative image coordinates
- getView - get the relative image coordinates of the current view
- getMap - return the Leaflet map object or null if the widget is not ready
- getZoom - get the current zoom level
- isVisible - test if a given relative image coordinate is within the bounds of the current view
- leafletZoom - convert an imgViewer zoom to a Leaflet zoom
- panTo - pan the view to be centered at the given relative image coordinates
- relposToLatLng - convert relative image coordinates to a Leaflet LatLng
- relposToImage - convert relative image coordinates to image pixel
- setZoom
-
Arguments:
-
e: leaflet event
-
Returns a javascript object with the relative image coordinates:
-
{ x: relative x image coordinate, y: relative y image coordinate }
-
Returns null if the event location is invalid or the widget is not ready.
-
Returns a javascript object with the relative image coordinates:
-
{ top: minimum relative y coordinate,
-
left: minimum relative x coordinate,
-
bottom: maximum relative y image coordinate,
-
right: maximum relative x coordinate
-
}
-
Returned zoom will always be >=1
-
Note this is not the same as the Leaflet zoom:
-
a zoom of 1 means the entire image is just visible within the viewport
-
a zoom of 2 means half the image is visible etc
-
Arguments:
-
relx: relative x image coordinate
-
rely: relative y image coordinate
-
Returns
-
true or false
-
Arguments:
-
zoom: the imgViewer zoom , must be >=1
-
Returns the equivalent Leaflet zoom
-
Returns null if the widget isn’t ready
-
Arguments:
-
relx: relative x image coordinate
-
rely: relative y image coordinate
-
Returns:
-
a reference to the imgViewer object
-
Arguments:
-
relx: relative x image coordinate
-
rely: relative y image coordinate
-
Returns:
-
Leaflet L.LatLng
-
Returns null if the widget isn’t ready
-
Arguments:
-
pos: javascript object {x: , y: }
-
Returns:
-
javascript object {x: , y: }