klokantech / iiifviewer

[DEPRECATED] IIIF WebGL / Canvas / DOM mobile-ready fast viewer powered by OpenLayers V3
http://klokantech.github.io/iiifviewer/
Other
54 stars 10 forks source link

Permalink example #4

Closed klokan closed 9 years ago

klokan commented 9 years ago

The viewer should support permalink for the viewed position on the map, for easier copy&paste of URLs.

The first implementation could probably follow the OL2 syntax of the permalink (with a hash), to mimic the NLS viewer: http://maps.nls.uk/view/74479823#zoom=3&lat=5800&lon=8486&layers=BT

For implementation hits see "Permalink" section of the blog post: http://oobrien.com/2015/01/openlayers-3-and-datashine/

BTW an ideal full viewer example would include also the Overview Control as in NLS viewer (http://openlayers.org/en/v3.1.1/examples/overviewmap-custom.html)

ghost commented 9 years ago

FROM:nls Hello Petr / Dalibor,

Just in case its helpful, we have implemented the OL2-style Permalinks at: http://geo.nls.uk/maps/dev/ol3/explore/#zoom=6&lat=53.5689&lon=-0.7531&layers=10

You will find it very easy - much easier than me, and just involves the stages outlined at: http://oobrien.com/2015/01/openlayers-3-and-datashine/ ...and given the NLS URLs layers=BT, the ol3 syntax is along these lines:

function updateUrl()
{ var centre = ol.proj.transform(map.getView().getCenter(), "EPSG:3857", "EPSG:4326"); window.location.hash = "zoom=" + map.getView().getZoom() + "&lat=" + centre[1].toFixed(4) + "&lon=" + centre[0].toFixed(4) + "&layers=BT" ; }

It would be great if you can prioritise this - hoping it is quick? We have ongoing complaints about the difficulties of printing screengrabs with the current viewer.

Thanks,

Chris

daliborjanak commented 9 years ago

Implemented. Please look at example: http://klokantech.github.io/iiifviewer/examples/permalink.html

ghost commented 9 years ago

FROM:nls Many thanks, Dalibor - this is perfect and exactly what we were hoping for.

To finish, please could you develop a version with the overlaywindow as at: http://openlayers.org/en/v3.1.1/examples/overviewmap-custom.html - hopefully we can customise to look as: http://maps.nls.uk/view/00000207

Your brief advice too on how we merge the existing http://klokantech.github.io/iiifviewer/examples/permalink.html and http://klokantech.github.io/iiifviewer/examples/print.html would be appreciated too - they use different iiifviewer js files, but can/will these be merged? Ideally we would like to deploy a single viewer.js file, but more is okay if necessary.

thanks!

ghost commented 9 years ago

FROM:nls Hello again Dalibor,

With apologies, I only managed to try deploying your Permalink example today for the NLS viewer at: http://geo.nls.uk/maps/dev/iiifviewer/207_iiifviewer_permalink.html

All is fine, apart from for the lat= variable that is negative from the top down, but is currently positive, from the bottom up - ie. http://maps.nls.uk/view/00000197#zoom=2&lat=2109&lon=5746&layers=BT I hope this is easy and quick to fix for us?

I also tried implementing your Print to PDF which worked fine as your demo had it at: http://geo.nls.uk/maps/dev/iiifviewer/print.html but produces an error in line 224 of
iiifviewer-pdf.js when I try to integrate it with the current NLS css, etc. at: http://geo.nls.uk/maps/dev/iiifviewer/207_iiifviewer.html (Print tab lower left). Maybe this is my 'Chris the Hacker' coding (as Petr would say), but very grateful for any advice.

klokan commented 9 years ago

Dalibor,

Please provide Chris with a complete example, hosted on labs and downloadable as .zip - with all the requested features (permalink, overview window, print + sample CSS customisation). Thanks!

daliborjanak commented 9 years ago

I finished last requirements with positive coordinates etc. yesterday. Results here: http://klokantech.github.io/iiifviewer/examples/permalink.html

For finalizing: I will prepare full example for you. We are now working on upgrade to Openlayers 3.2 which is necessary for using overview map and new ol features (it is not implemented in older relases).

Note: In pdf branch is IiifViewer with print to pdf. Printing is not in master. I merged all changes to pdf.

klokan commented 9 years ago

Problem with print reported by Chris is related to #2 - which is now reopened.

klokan commented 9 years ago

The tickets are starting to be very messy. This ticket is about "Permalink" - only issues related to permalink is to be discussed here. Issues related to print are to be discussed at #2. Issues specific to the complete example for NLS are to be discussed under #7