waynegm / imgViewer2

Extensible and responsive jQuery plugin to zoom and pan images based on the Leaflet mapping library
MIT License
60 stars 34 forks source link

Full Screen button #19

Closed dave7777 closed 6 years ago

dave7777 commented 6 years ago

Dear Wayne, Can you please help me add the full screen button to your fabulous code? I tried adding this line and it did not work:

fullscreenControl: true,

Dave

waynegm commented 6 years ago

Using Leaflet.fullscreen the following works for me:

var $img = $("#image1").imgViewer2({
    onReady: function() {
        this.setZoom(1);
        this.map.addControl(new L.Control.Fullscreen());
    }
});
dave7777 commented 6 years ago

thnak you - for some reason in the fullscreen view the upper part of the screen is filled with the black background - I have attachedthe screenshot.....do you think this is a bug?

Image and video hosting by TinyPic

waynegm commented 6 years ago

Not a bug - probably to do with your screen having a different aspect ratio to the image.

dave7777 commented 6 years ago

thank you Wayne....I did a qucik check and it appears the page sections are below that black area:

Image and video hosting by TinyPic

this is ok? maybe some other plugin will work?

waynegm commented 6 years ago

Looking at it again you are correct the image display is not being placed over the entire view in fullscreen mode. Not sure why other elements on the page are interfering with this. This happens with at least 2 of the Leaflet fullscreen plugins but both of these appear to work fine on a page with a Leaflet map and other page elements. So there may be some incompatibility with how I'm using Leaflet in imgViewer2.

dave7777 commented 6 years ago

Thank you Wayne - do you think you can integrate the fullscreen and the minimap in your otherwise wonderful plugin? I am new to programmign and I guess it woudl take a month for me to do - and like 10 minites for yourself:))

dave7777 commented 6 years ago

I have attached the local version of the webpage on which I am working....

https://sendit.cloud/77zvt6g0ajgh

here is how it shows on my side:

Image and video hosting by TinyPic

can you please take a short look at the weboage ?

dave7777 commented 6 years ago

I got this reply from the developer of the fullscreen script:

It looks like it's due to custom CSS, particularly position: absolute; and an absolute top and left coordinate on the map container. You'll need to ensure that the CSS you apply is compatible with a full screen layout. Closing here since this isn't an issue with the plugin itself.

can you please help me corerct this?

waynegm commented 6 years ago

I need to make some significant changes in the imgViewer2 plugin to make it work with the fullscreen controls. This will require a change to the imgViewer2 plugin interface but I'd prefer to improve the compatibility with existing Leaflet plugins as opposed to hacking them as a solution. Because it will be a fairly major change it will need to become version 2.0.

dave7777 commented 6 years ago

Thank you very much - do you think the future version will work seamlessly with the fullscreen script? there is absolutely no way to make it work now?

waynegm commented 6 years ago

Yes