The plugin has the following dependencies:
- jQuery (<=3.2.1)
- jQuery UI (>=1.8)
- leaflet.js (>=1.0.2)
Include either the development version or minified production version of the JS file located
in the dist
folder and associated dependencies into your web page:
<head>
...
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" />
<link rel="stylesheet" href="http://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" media="screen">
<script type="text/javascript" src="https://unpkg.com/[email protected]/dist/leaflet.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<script src="imgViewer2.min.js"></script>
...
</head>
Put an image element and a javascript block to attach the plugin to the image in the web page body:
<body>
...
<img id="image1" src="test.jpg" width="80%" />
...
<script>
(function($) {
$("#image1").imgViewer2();
})(JQuery);
</script>
...
</body>