Skip to content

Commit

Permalink
Merge pull request #20 from mejackreed/leaflet-v1.0.0-beta1
Browse files Browse the repository at this point in the history
Leaflet v1.0.0
  • Loading branch information
mejackreed authored Nov 18, 2016
2 parents 6847eae + 1814840 commit 7a6cd32
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
4 changes: 2 additions & 2 deletions examples/example.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="//cdn.leafletjs.com/leaflet-0.7.5/leaflet.css" />
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.1/dist/leaflet.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<script src="//cdn.leafletjs.com/leaflet-0.7.5/leaflet.js"></script>
<script src="https://unpkg.com/leaflet@1.0.1/dist/leaflet.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../leaflet-iiif.js"></script>
</head>
Expand Down
2 changes: 1 addition & 1 deletion examples/iiif-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ map = L.map('map', {

stanfordMlk = L.tileLayer.iiif('https://stacks.stanford.edu/image/iiif/hg676jb4964%2F0380_796-44/info.json', {
attribution: '<a href="http://searchworks.stanford.edu/view/hg676jb4964">Martin Luther King Jr. & Joan Baez march to integrate schools, Grenada, MS, 1966</a>',
maxZoom: 6
maxZoom: 5
}).addTo(map);

princetonMap = L.tileLayer.iiif('http://libimages.princeton.edu/loris2/pudl0076%2Fmap_pownall%2F00000001.jp2/info.json', {
Expand Down
4 changes: 2 additions & 2 deletions examples/manifest.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.0.1/dist/leaflet.css" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<script src="//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js"></script>
<script src="https://unpkg.com/leaflet@1.0.1/dist/leaflet.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="../leaflet-iiif.js"></script>
</head>
Expand Down
6 changes: 3 additions & 3 deletions leaflet-iiif.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ L.TileLayer.Iiif = L.TileLayer.extend({
var _this = this,
x = coords.x,
y = (coords.y),
zoom = _this._map.getZoom(),
zoom = _this._getZoomForUrl(),
scale = Math.pow(2, _this.maxNativeZoom - zoom),
tileBaseSize = _this.options.tileSize * scale,
minx = (x * tileBaseSize),
Expand Down Expand Up @@ -193,9 +193,9 @@ L.TileLayer.Iiif = L.TileLayer.extend({
_templateUrl: function() {
return this._infoToBaseUrl() + '{region}/{size}/{rotation}/{quality}.{format}';
},
_tileShouldBeLoaded: function(coords) {
_isValidTile: function(coords) {
var _this = this,
zoom = _this._map.getZoom(),
zoom = _this._getZoomForUrl(),
sizes = _this._tierSizes[zoom],
x = coords.x,
y = (coords.y);
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
"homepage": "https://github.com/mejackreed/Leaflet-IIIF",
"devDependencies": {
"http-server": "^0.9.0",
"jasmine": "^2.4.1",
"jasmine": "^2.5",
"jquery": "^2.2.2",
"karma": "^0.13.22",
"karma-jasmine": "^0.3.7",
"karma": "^1.3",
"karma-jasmine": "^1.0",
"karma-phantomjs-launcher": "^1.0.0",
"leaflet": "^0.7.7",
"leaflet": "^1.0",
"phantomjs-prebuilt": "^2.1.5"
}
}
8 changes: 8 additions & 0 deletions spec/LTileLayerIiifSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ describe('L.TileLayer.Iiif', function() {
iiifLayer = iiifLayerFactory();
});

afterEach(function() {
iiifLayer.off('load');
});

it('by default is on', function(done) {
map.addLayer(iiifLayer);
iiifLayer.on('load', function() {
Expand All @@ -91,6 +95,10 @@ describe('L.TileLayer.Iiif', function() {

describe('quality', function() {
var iiifLayer;

afterEach(function() {
iiifLayer.off('load');
});

it('by default is on', function(done) {
iiifLayer = L.tileLayer.iiif('http://localhost:9876/base/fixtures/acrobat_info.json');
Expand Down

0 comments on commit 7a6cd32

Please sign in to comment.