Skip to content

Commit

Permalink
add tile type for clipping
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin McFadden committed Aug 9, 2024
1 parent 18cc70c commit ac5b7a7
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,8 @@
overlap: <?=isset($fileObject->sourceFile->metadata["dziOverlap"])?$fileObject->sourceFile->metadata["dziOverlap"]:1?>,
pixelsPerMillimeter: pixelsPerMillimeter,
detectRetina: false,
renderer: L.canvas()
renderer: L.canvas(),
tileType: tileType
};

if (latData && lngData) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
var tiledTar = "<?= $tiledTar ?>";
var tiledTarIndex = "<?= $tiledTarIndex ?>";
var manifestJson = null;

var tileType = "tar";
async function loadIndex() {
const manifest = await fetch(tiledTarIndex);
manifestJson = await manifest.json();
Expand Down Expand Up @@ -67,6 +67,7 @@
var image;
var count;
var subimages = {};
var tileType = "iiif";
var maxZoom = <?=isset($fileObject->sourceFile->metadata["dziMaxZoom"])?$fileObject->sourceFile->metadata["dziMaxZoom"]:16?> - 1;
var loadIndex = async function() {
tiff = await GeoTIFF.fromUrl("<?=$fileContainers["tiled-iiif"]->getProtectedURLForFile()?>");
Expand Down Expand Up @@ -140,6 +141,7 @@ function hexStringToUint8Array(hexString) {

<? else : ?>
var loadIndex = async function() {}
var tileType = "tiled";
var tileLoadFunction = function(coords, tile, done) {
var params = {
Bucket: '<?= $fileObject->collection->getBucket() ?>',
Expand Down
3 changes: 2 additions & 1 deletion application/views/fileHandlers/embeds/imageHandler_svs.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@
overlap: <?=isset($fileObject->sourceFile->metadata["dziOverlap"])?$fileObject->sourceFile->metadata["dziOverlap"]:1?>,
pixelsPerMillimeter: pixelsPerMillimeter,
lineColor: 'blue',
detectRetina: false
detectRetina: false,
tileType: tileType
};

layer = L.tileLayer.elevator(tileLoadFunction, mapOptions);
Expand Down
3 changes: 2 additions & 1 deletion application/views/fileHandlers/embeds/imageHandler_tiled.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@
tileSize :<?=isset($fileObject->sourceFile->metadata["dziTilesize"])?$fileObject->sourceFile->metadata["dziTilesize"]:255?>,
maxNativeZoom: <?=isset($fileObject->sourceFile->metadata["dziMaxZoom"])?$fileObject->sourceFile->metadata["dziMaxZoom"]:16?> - 1,
overlap: <?=isset($fileObject->sourceFile->metadata["dziOverlap"])?$fileObject->sourceFile->metadata["dziOverlap"]:1?>,
pixelsPerMillimeter: pixelsPerMillimeter
pixelsPerMillimeter: pixelsPerMillimeter,
tileType: tileType
});
layer.addTo(imageMap);

Expand Down
3 changes: 2 additions & 1 deletion assets/leaflet/Leaflet.elevator.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ if(typeof require !== "undefined") var L = require('leaflet')
attributionControl: false,
detectRetina: true,
edgeBufferTiles: 1,
tileType: 'tiled'
},

initialize: function(tileLoadFunction, options) {
Expand Down Expand Up @@ -45,7 +46,7 @@ if(typeof require !== "undefined") var L = require('leaflet')
})(done, error, tile);

this._loadFunction(coords, tile);
if(this._imageSize !== undefined) {
if(this._imageSize !== undefined && this.options.tileType === 'iiif') {
if(this._imageSize[coords.z+1] !== undefined) {
console.log("Clipping tile")
var xPercentage = 100;
Expand Down

0 comments on commit ac5b7a7

Please sign in to comment.