peterkromanpeter / OSD-with-specific-properties-and-functions

OSD for use with old records and archives
0 stars 0 forks source link

From thread in openseadragon/openseadragon #1

Open peterkromanpeter opened 7 years ago

peterkromanpeter commented 7 years ago

Fair enough. Well, for using the hash, you could do something like so:


function updateForHash() {
  var hash = window.location.hash.replace(/^#/, '');
  if (hash && /^page /.test(hash)) {
    var hashNumber = hash.replace(/^page /, '');
    var index = parseInt(hashNumber, 10) - 1;
    viewer.goToPage(index);
  }
}
You'll want to call it once after the viewer loads, and once every time there's a hashchange event. You could do it like so:

viewer.addHandler('open', function() {
  window.addEventListener('hashchange', updateForHash, false);
  updateForHash();
});
Regarding the navigator, are you seeing it anywhere on the screen? As long as you have a div with the proper ID, and the navigator is showing up there, it's just a matter of using CSS to position it where you want it. Be sure to make sure it's got a width and a height, or it might not be visible at all.
peterkromanpeter commented 7 years ago

Thanks @iangilman I can't get the hash thing working. I put in the function script in at the top of the and the viewer.addHandler at the bottom with the other handlers. But it does not seem to work. What am I doing wrong?

I put in the code (shortened) here. Hope that you can see what I am doing wrong :)


<head>

<title>W3.CSS</title>
<meta name="viewport" content="width=site-width, initial-scale=1.0">
<meta charset="utf-8" />
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">

</head>

<body>

<script>
function updateForHash() {
  var hash = window.location.hash.replace(/^#/, '');
  if (hash && /^page /.test(hash)) {
    var hashNumber = hash.replace(/^page /, '');
    var index = parseInt(hashNumber, 10) - 1;
    viewer.goToPage(index);
  }
}
</script>

... shortened ...

<!-- Page Content -->
<!-- OSD start -->

<!-- Navigator for pages -->
<style> 
.flex-container {
    display: -webkit-flex;
    display: flex;
     -webkit-flex-flow: row wrap;
    flex-flow: row wrap;   
    width: site-width;
    height: 60px;
    background-color: #666666;
    margin-bottom:20px
    border-bottom: 1px solid #f6f6f6;
    margin-top: 0px;

    justify-content: center; 

}
.flex-item {
    background-color: #666666;

    height: 45px;

    color: #f6f6f6;
    margin-top: 13px;

}
</style>

</span>    

<div class="flex-container">

<!-- My own buttons before -->

<!-- First page --> 
<div class="flex-item"><input type="button" button title="Første side" style="width: 30px; text-align:center; color: #f6f6f6; background-color:#666666; border:none; margin-left:20px";id="onefirst"; onclick="firstOne()" value="|<"></div> 

 <script>
function firstOne() {
    document.getElementById("onefirst").innerHTML = viewer.goToPage(0); // First page;
}
</script>

<!-- -1 page -->
<div class="flex-item"><input type="button" button title="1 side tilbage"style="width: 30px; text-align:center; color: #f6f6f6; background-color:#666666; border:none;  margin-left:20px";id="oneminus"; onclick="minusOne()" value="<1"></div> 

 <script>
function minusOne() {
    document.getElementById("oneminus").innerHTML = viewer.goToPage(Math.max(0, viewer.currentPage() - 1)); // 1 pages before;
}
</script>

<!-- -5 pages -->
<div class="flex-item"><input type="button" button title="5 sider tilbage"style="width: 30px; text-align:center; color: #f6f6f6; background-color:#666666; border:none;  margin-left:20px";id="fiveminus"; onclick="minusFive()" value="<5"></div> 

 <script>
function minusFive() {
    document.getElementById("fiveminus").innerHTML = viewer.goToPage(Math.max(0, viewer.currentPage() - 5)); // 5 pages before;
}
</script>

<!-- -10 pages -->
<div class="flex-item"><input type="button" button title="10 sieder tilbage"style="width: 40px; text-align:center; color: #f6f6f6; background-color:#666666; border:none; margin-right:20px;  margin-left:20px";id="tenminus"; onclick="minusTen()" value="<10"></div> 

 <script>
function minusTen() {
    document.getElementById("tenminus").innerHTML = viewer.goToPage(Math.max(0, viewer.currentPage() - 10)); // 5 pages before;
}
</script>

 <!-- Input field for page search -->
  <div class="flex-item"><input type="text" style="width: 45px; text-align:right; color: #f6f6f6; background-color:#666666; border:none; margin-right:0px; margin-left:20px";id="my_text-input" value="Side"></div>

  <div class="flex-item"><input type="text" style="width: 45px; text-align:center; color: #666666; background-color:#f6f6f6; border: 1px solid black; margin-left:20px"; id="my-page-input" value="1"></div>

  <div class="flex-item"><input type="text" style="width: 45px; text-align:left; color: #f6f6f6; background-color:#666666; border:none; margin-left:20px; margin-right:20px";id="my_text-input_2" value="af 18"></div> 

   <!-- My own buttons after -->
    <!-- +1 page -->
<div class="flex-item"><input type="button" button title="1 side frem"style="width: 30px; text-align:center; color: #f6f6f6; background-color:#666666; margin-left:20px; border:none";id="oneplus"; onclick="plusOne()" value="1>"></div> 

 <script>
function plusOne() {
    document.getElementById("oneplus").innerHTML = viewer.goToPage(Math.min(viewer.tileSources.length - 1, viewer.currentPage() + 1)); // 1 pages after;
}
</script>

    <!-- +5 pages -->

  <div class="flex-item"><input type="button" button title="5 sider frem"style="width: 30px; text-align:center; color: #f6f6f6; background-color:#666666; border:none; margin-left:20px";id="fiveplus"; onclick="plusFive()" value="5>"></div> 

 <script>
function plusFive() {
    document.getElementById("fiveplus").innerHTML = viewer.goToPage(Math.min(viewer.tileSources.length - 1, viewer.currentPage() + 5)); // 5 pages after;
}
</script>

    <!-- +10 pages -->
<div class="flex-item"><input type="button" button title="10 sieder frem"style="width: 40px; text-align:center; color: #f6f6f6; background-color:#666666; border:none; margin-left:20px";id="tenplus"; onclick="plusTen()" value="10>"></div> 

 <script>
function plusTen() {
    document.getElementById("tenplus").innerHTML = viewer.goToPage(Math.min(viewer.tileSources.length - 1, viewer.currentPage() + 10)); // 10 pages after;
}
</script>

    <!-- Last page -->
<div class="flex-item"><input type="button" button title="Sidste side"style="width: 30px; text-align:center; color: #f6f6f6; background-color:#666666; border:none; margin-left:20px";id="onelast"; onclick="lastOne()" value=">|"></div> 

 <script>
function lastOne() {
    document.getElementById("onelast").innerHTML = viewer.goToPage(viewer.tileSources.length - 1); // Last page;
}
</script>  

</div>

<div id="openseadragon1" style="width: site-width; height: 600px; border-top: 1px solid #f6f6f6;background-color:#666666";"margin: auto;></div>

<!-- OSD -->
<script src="/openseadragon/openseadragon.min.js"></script>
<script src="/openseadragon/zoomifytilesource.js"></script>

<script type="text/javascript">
    var viewer = OpenSeadragon({

        id: "openseadragon1",
        prefixUrl: "/openseadragon/images/",
    //showNavigator:  true,
    //navigatorId:   "navigatorDiv",

        //navigatorPosition: "ABSOLUTE",
        //navigatorTop:      "900px",
        //navigatorLeft:     "750px",
        //navigatorHeight:   "120px",
        //navigatorWidth:    "100px",
    //navigatorPosition:   "BOTTOM_RIGHT",
    //navigatorHeight:   "100px",
        //navigatorWidth:    "60px",
     sequenceMode: true,
    preserveViewport: true,
    //showReferenceStrip: true,
    referenceStripScroll: 'horizontal',
    defaultZoomLevel: 0.3,
    visibilityRatio: 0.5,
    constrainDuringPan: true,
    // Show rotation buttons
    //showRotationControl: true,
    //zoomInButton:   "zoom-in",
    //zoomOutButton:  "zoom-out",
    homeButton:     "home",
    fullPageButton: "full-page",
    //nextButton:     "next",
    //previousButton: "previous",
    //showZoomControl: false,
    //showHomeControl: false,
    showSequenceControl: false,

        tileSources: [
            {
                type: "zoomifytileservice",
                width: 1191, // change width and height according your image size
                height: 1684,
                tilesUrl: "/Zoomify_images/Kauffmann/Bogen-Kaufmann,-21.-maj-2013.-revideret-001/"

    ... shortened ...       

   var input = document.getElementById('my-page-input');

    input.addEventListener('keypress', function(event) {
        if (event.which === 13) { // Return key
            viewer.goToPage(parseInt(input.value, 10)-1);
        }
    });

    viewer.addHandler("page", function (data) {
        input.value = ( data.page + 1 );
    });

    viewer.addHandler('open', function() {
  window.addEventListener('hashchange', updateForHash, false);
  updateForHash();
});

</script>

</div>

</body>
</html>
iangilman commented 7 years ago

Great, thank you for moving the conversation here :)

So what exactly isn't working?

One thing that seems to be missing is a place where you actually set the location.hash. For instance in your page handler you might have something like this:

viewer.addHandler("page", function (data) {
  input.value = ( data.page + 1 );
  location.hash = "page " + (data.page + 1);
});

Anyway, I can't really tell you what to fix if I don't know what aspect is not working, or what your symptoms are.

peterkromanpeter commented 7 years ago

Hi @iangilman I am not getting a hash specified url at all. I have the page handler exactly as you describe it (look in the code in the second statement from the bottom). And I have the function script at the very top of the body. the actual page I am testing this on is this: http://genealogiskforum.dk/private/

iangilman commented 7 years ago

Thanks for the link to the page. I've verified that you don't have the page handler exactly as I describe... you're missing the location.hash line, which is the line that makes the hash URL.

Also, when the page starts up (you can put it inside your "open" handler) you should also set up the hash to begin with. Something like:

if (!location.hash.replace(/^#/, '')) {
  location.hash = 'page ' + (viewer.currentPage() + 1);
}
peterkromanpeter commented 7 years ago

Thanks @iangilman It is now working in the respect of showing the hash, and changing it when I toggle the pages. That is very fine. But it is still not an unique url. When I go to e.g. page 15, and copy the url: http://genealogiskforum.dk/private/#Side 15 and paste it into a new browser window, it displays page 1 (Side 1), but shows .../#Side 15 in the address line.. Is there a way to fix that too?

The handler looks like this now: viewer.addHandler("page", function (data) { input.value = ( data.page + 1 ); location.hash = "Side " + (data.page + 1); if (!location.hash.replace(/^#/, '')) { location.hash = "Side " + (viewer.currentPage() + 1); }
});

iangilman commented 7 years ago

The code that handles the update to get you to the right page when you load is:

function updateForHash() {
  var hash = window.location.hash.replace(/^#/, '');
  if (hash && /^page /.test(hash)) {
    var hashNumber = hash.replace(/^page /, '');
    var index = parseInt(hashNumber, 10) - 1;
    viewer.goToPage(index);
  }
}

You have that function on your page, but it appears that you're not calling it, so it never runs. You should call it inside the open handler.

In addition to that, you'll note that that code is expecting hashes that look like this: #page 1 but you're using hashes that look like this: #Side 1. The code needs to be updated to support that. Btw, I recommend not including spaces in your hash, as spaces aren't legal for URLs. I also recommend sticking to full lowercase to avoid confusion over capitalization. So maybe you should use something like #side1, in which case the code above would look like so:

function updateForHash() {
  var hash = window.location.hash.replace(/^#/, '');
  if (hash && /^side/.test(hash)) {
    var hashNumber = hash.replace(/^side/, '');
    var index = parseInt(hashNumber, 10) - 1;
    viewer.goToPage(index);
  }
}
peterkromanpeter commented 7 years ago

Thanks @iangilman I have made the changes to the function code that you suggest. It looks like this now:

<script>
function updateForHash() {
  var hash = window.location.hash.replace(/^#/, '');
  if (hash && /^side/.test(hash)) {
    var hashNumber = hash.replace(/^side/, '');
    var index = parseInt(hashNumber, 10) - 1;
    viewer.goToPage(index);
  }
}
</script>

But I am confused about the "open" handler that you mention. I have these two handlers in the code at the moment, and I don't know which one to use, or if there is a handler missing :) 

}); var input = document.getElementById('my-page-input');

input.addEventListener('keypress', function(event) {
    if (event.which === 13) { // Return key
        viewer.goToPage(parseInt(input.value, 10)-1);
    }
});

    viewer.addHandler("page", function (data) {
    input.value = ( data.page + 1 );
  location.hash = "side" + (data.page + 1);

if (!location.hash.replace(/^#/, '')) { location.hash = "side" + (viewer.currentPage() + 1); }
}); What am I doing wrong here? If you could give me an example on how to call this function in a handler I would be most grateful :)

peterkromanpeter commented 7 years ago

Hi @iangilman I think I might have found a way to get around the hash challenges and at the same time take a giant step forward in my project as a whole.

My end goal is to be able to display danish churchbooks through OSD. There are about 30.000 books with an average of 250 pages per book. They are all scanned by our national archive in Denmark. I have made a database holding all the books, and from which the user can seek out the precise book he needs. The individual book in the database holds a link that I specify and that refers to the url that displays the book and the user can toggle around the pages in the book.

So what I need is to be able to catch the data at the national archive, and to display them with openseadragon, AND to let users use my own toggle pages settings so that the easily can move to the page the are seeking.

I have just found out that there is a facility available called "Openseadragonizer" that can fetch images from urls. I believe that this might be the solution, if I could make these tow things working together.

You can see an example of a page in a churchbook opened with Openseadragonizer here: http://openseadragon.github.io/openseadragonizer/?img=http://ao.sa.dk/ao/data.ashx?bid=24530382

One of the beauties here is that the next page in the book is the next number in the url (24530383) which eliminates the need for hashes in the urls I believe. So if I could get my fine "toggle-tools" to work with this "Openseadragonizer" I would be able to move a giant step forward in my project I think.

You can see an example of how I imagine it could look like here (it does'nt work right yet, but it looks right :) ) http://genealogiskforum.dk/kirkeboeger_show3/

If you have any ideas on how to make this work, I would be absolutely thrilled :)

iangilman commented 7 years ago

To answer the question about the "open" handler, sorry, I thought at one point we had one. Anyway, you would add this after the viewer is created:

viewer.addHandler('open', function() {
  updateForHash();
});

As for using OpenSeadragonizer, you certainly can, though it doesn't fix your hash URL support issue... you would still need to either support hash URLs on your page and pass the info into OpenSeadragonizer, or you'd have to decide you don't want hash URLs, in which case it wouldn't matter whether you use OpenSeadragonizer or not.

At any rate, OpenSeadragonizer isn't magic... it's just a thin wrapper around the Image tile source:

http://openseadragon.github.io/examples/tilesource-image/

That tile source just takes the whole image and displays it without breaking it into tiles. If your images are small enough (less than 3000px wide, let's say) then it's fine. If they're more like 10,000px wide, it would be good to tile them ahead of time.

At any rate, you can use the image tile source without OpenSeadragonizer, like so:

viewer.open({
  type: 'image',
  url: 'http://ao.sa.dk/ao/data.ashx?bid=24530382'
});

You can basically make your own OpenSeadragonizer like so:

var viewer = OpenSeadragon({
  tileSources: {
    type: 'image',
    url: OpenSeadragon.getUrlParameter('img')
  },
  // Additional options go here
});
peterkromanpeter commented 7 years ago

Thanks @iangilman I am in trouble :) I can't get any of it working. I have put in the "open" handler on this page: http://genealogiskforum.dk/private4/#side11. It still works when I toggle the images on the page, but the url is still not a unique url for the individual image. I have tried to add the code you suggest to create a way to fetch data from an url (with or without OpenSeadragonizer here: http://genealogiskforum.dk/kirkeboeger_show3/. I get a blank screen.

I am a newbie to this, so I believe I am putting in the code in wrong places. I am attaching both index.php files here, and hope that you will edit them, and return the edited files to me. I believe I will learn much faster that way. I am sorry for beeing so "not skilled" - but I really hope for your patience a still little while. And you should know that I am very grateful for all the help you are giving me :) kirkeboeger_show3.zip private4.zip

iangilman commented 7 years ago

The updateForHash in the open handler isn't working because you've got a typo where you define updateForHash. This is what you have:

<script>
f<script>
function updateForHash() {
  var hash = window.location.hash.replace(/^#/, '');
  if (hash && /^side/.test(hash)) {
    var hashNumber = hash.replace(/^side/, '');
    var index = parseInt(hashNumber, 10) - 1;
    viewer.goToPage(index);
  }
}
</script>

Note the f<script> on the second line? That whole line needs to be deleted.

That should take care of the private4 issue.

For adding simple image tile sources based on an img URL parameter, probably the easiest thing is to add this:

  viewer.open({
    type: 'image',
    url: OpenSeadragon.getUrlParameter('img')
  });

...and don't forget to add ?img=http://ao.sa.dk/ao/data.ashx?bid=24530382 to the URL.

peterkromanpeter commented 7 years ago

Yes. I can see the typo in the script. When I remove that, no images are displayed at all, only a blank screen...... What am I doing wrong.

And I need you to tell me where exactly I need to add the the ?img=http://ao.sa.dk/ao/data.ashx?bid=24530382 in the code - one od my my biggest challenges is to get the code syntax right

iangilman commented 7 years ago

I took another look at private4 and found a couple more issues. It would be easiest for us to share code changes if we could put the code directly into this repository. Could you give me write access here?

As for where to add the ?img= I meant in the URL when you go to the page, like so:

http://genealogiskforum.dk/kirkeboeger_show3/?img=http://ao.sa.dk/ao/data.ashx?bid=24530382

By the way, are you looking in the developer console in your browser? It will display errors and warnings that are helpful to finding your issues.

peterkromanpeter commented 7 years ago

That would be nice. But I don't know how to put my code into the repository, or how to provide you with write access??

iangilman commented 7 years ago

At the top of this page in the bar that starts with "Code" you should see "Settings". Hit that and then select "Collaborators" on the left side and then enter "iangilman". I'll take care of putting the code in.

Also, you might look into getting the GitHub Desktop App for helping you get code in and out. https://desktop.github.com/

peterkromanpeter commented 7 years ago

I have added you as collaborator :) (I hope)

iangilman commented 7 years ago

Great! Okay, I've put your code in and I've made a pull request to show my changes:

https://github.com/peterkromanpeter/OSD-with-specific-properties-and-functions/pull/2

...and I've commented on the changes so you can understand what I've done.

By the way, since I don't have your images, I can't see it running for sure, but everything else seems to be working...

peterkromanpeter commented 7 years ago

@iangilman Thanks,

I have implemented your changes, and everything works just fine now. The last thing I need to do is to be able to load images from another URL into the viewer at the page. An example could be this url: https://www.sa.dk/ao-soegesider/da/billedviser?epid=17121300#159468,26816262 which represents the first page in a book of 101 pages. Is there a way to do that too?

iangilman commented 7 years ago

Glad to hear it's working!

Okay, that example URL you gave... is that an example of what you would like to have working, or is that an image you'd like to be using?

At any rate, the idea is pretty similar to what we're already doing... just grab info from the URL and use it to load stuff. You could stick with a hash or do it as a URL parameter. Do you mind if the page refreshes when you go from one image to the next?

Can you give an example of what the imaginary URL would look like in your case, and where that image might come from? For instance, we talked about this as a possibility:

http://genealogiskforum.dk/kirkeboeger_show3/?img=http://ao.sa.dk/ao/data.ashx?bid=24530382

...but another possibility would be something like:

http://genealogiskforum.dk/kirkeboeger_show3/#24530382

peterkromanpeter commented 7 years ago

I have made a copy of the private4 file, and removed the urls to the local images from the code in order to get all the coding right in this file too :) I attach that file here. kirkeboeger_show3 3.zip

What I want is an URL that loads images into my page from another URL, and where the toggle facilities on my page is still working. It is quite OK that the page refreshes when moving to the next page. The example URL is one that should be working. It shows the first page af 310 pages in one book.

iangilman commented 7 years ago

Okay, I've made a new pull request with a basic version that'll load a single image:

https://github.com/peterkromanpeter/OSD-with-specific-properties-and-functions/pull/3

You can see it running like so:

http://genealogiskforum.dk/kirkeboeger_show3/?img=http://ao.sa.dk/ao/data.ashx?bid=24530382

If you want all of the links and whatnot to work, to get you from page to page, you just need to set them up with the proper img param. Where you get the URLs from is up to you of course.

peterkromanpeter commented 7 years ago

That works fine, with one image. Thanks :) But how do I get my toggle facilities to work. What I need here is to affect the last number in the URL, in this case 24530382, to move forward e.g. +1 (=24530383), +5 (=24530387) forward and backwards in the book when I hit the toggle functions at the top of the page. Is that possible?

iangilman commented 7 years ago

It's certainly possible, and it's fairly basic programming. Look into string manipulation and DOM manipulation. You basically want to grab the URL that we used to make the image, pull out just the number part, convert it to an actual number, add some value to it, then make it the href of an <a> tag (which is your button).

I won't be able to help out for a few days; see what you can accomplish, and I'll check in when I can.

peterkromanpeter commented 7 years ago

Thanks @iangilman But this is just where my basic skills does not meet my own requests :) I'll wait until you are back, and hope that you can guide me through this too :)

iangilman commented 7 years ago

Fair enough. Are you interested in learning more about web development? I can recommend resources for you. I keep this list:

https://github.com/iangilman/learning-javascript

...but I can also point you towards specific sites.

At any rate, I've added a new pull request: #4, with a start on moving from place to place. See if you can understand it, and ask me questions if you don't. I don't want to do it all for you; I'm hoping to help you learn!

peterkromanpeter commented 7 years ago

Thanks @iangilman I am definately interested in learning more about development. Thanks for the hints about that. I will use it. I'll look into your new pull request, and I will try not to disturb you quite as much in the future. Thanks very much for all your help. For me it has been some huge jumps forward. Thanks again.

iangilman commented 7 years ago

Great... well, I'm happy to help you move forward in your learning; do ask questions to help you understand.

By the way, if you want to buy me a coffee or so, you can help support my work at https://www.patreon.com/iangilman :)

Anyway, keep me posted... I'd love to see how the site comes together. When it's ready, we should add it to:

http://openseadragon.github.io/examples/in-the-wild/

peterkromanpeter commented 6 years ago

Hi @iangilman

I am back on the stage :) If you take a look on this page: https://navnpaasted.dk/, I have made a viewer to show county/parish maps. It works fine, but there is a little thing that I would like to fix.

I have used the build in icon bar for two issues: Toggle full page and Home. What I would like to do here, is to change the button titles (the pop-up text when hovering the button) to something in danish language and something that is better understood by my danish users.

Is there any posibillity to do that?

iangilman commented 6 years ago

Lovely! Looks like you're doing great :)

To customize the strings, you can do something like so:

OpenSeadragon.setString('Tooltips.Home', 'Gå hjem');
OpenSeadragon.setString('Tooltips.FullPage', 'Skift hele siden');

(Pardon the probably horrible translation; blame Google!)

If you want to see what strings are possible, here's the list:

https://github.com/openseadragon/openseadragon/blob/master/src/strings.js#L40

peterkromanpeter commented 6 years ago

Thanks @iangilman I'll work with that :)

And I really would like to buy you a coffee but I can't figure out how to do it on the page you linked m to.

HELP :) :)

peterkromanpeter commented 6 years ago

I can't get it working.

Where in the code should I put these lines in?

iangilman commented 6 years ago

Sorry, I forgot to mention that you need to put those lines in before you create your viewer. I've just tested and verified that that works.

As for buying me a coffee, I just meant it as a metaphor for passing some money my way. On https://www.patreon.com/iangilman you can hit the big red "become a patron" button on the right to send me a little money every month (you can cancel any time). If that doesn't work for you, I'm also on PayPal. Anyway, no big deal... only if you want to. :)

peterkromanpeter commented 6 years ago

Thanks @iangilman

It works nicely now. One more little thing. I use only the "Home" and the "Full page" button per default, but I would like to also have the "Next" and "Previous" buttons visible when in full-page mode. Is that a possibility?

iangilman commented 6 years ago

We don't have explicit code for showing and hiding those buttons, but it can be done by manipulating their CSS. Make sure they're on by default and then you can hide them like so:

viewer.nextButton.element.style.visibility = 'hidden';
viewer.previousButton.element.style.visibility = 'hidden';

...and then you can show them like so:

viewer.nextButton.element.style.visibility = 'visible';
viewer.previousButton.element.style.visibility = 'visible';
peterkromanpeter commented 6 years ago

Thanks @iangilman I'll work on that :)

peterkromanpeter commented 6 years ago

Hi @iangilman I am working with a stream of zoomify images on my page. Like this:

tileSources: [
        {
          type: "zoomifytileservice",
        width: 7000, // change width and height according your image size
        height: 7000,
        tilesUrl: "https://genealogiskforum.dk/Zoomify_images/Hele landet/"

      },{
        type: "zoomifytileservice",
        width: 2800, // change width and height according your image size
        height: 2800,
        tilesUrl: "https://genealogiskforum.dk/Zoomify_images/Hjørring/"

      },
      {
        type: "zoomifytileservice",
        width: 2800, // change width and height according your image size
        height: 2800,
        tilesUrl: "https://genealogiskforum.dk/Zoomify_images/Hjørring, solo/"

      }, ....

I would like to change the very first image in the stream to a svg image I am making with active links and hover functions - while keeping the other appr. 30 images in the stream as zoomify images. I get the idea that svg is supported in OSD from your codepen page here: https://codepen.io/iangilman/pen/wKVQjK - but how do I do it in this particular case :)

iangilman commented 6 years ago

To include an SVG image, you have to use the https://github.com/openseadragon/svg-overlay plugin. The SVG image is not treated the same as the other images; it's simply an overlay on top of everything.

It may also take some additional work to get the hovers and links to work properly.

peterkromanpeter commented 6 years ago

OK. Thanks - I'll go to work on it :)