lmotta / mapswipetool_plugin

GNU General Public License v2.0
19 stars 10 forks source link

MapSwipe Tool does not properly align both images #11

Closed ShannonRice closed 3 years ago

ShannonRice commented 5 years ago

Running Mac 10.13.6 - QGIS 3.4 (although I've experienced issue in QGIS 3.6.1 as well.) When i have perfectly aligned images set to visible, and attempt to use the Mapswipe tool, it displays one of the images offset signficantly from correct location. (so basically, it doesn't work for me). Attached is a screenshot. Please let me know if you have suggestions. I've tried uninstalling, and reinstalling, and nothing allow me to use this, what would be a very useful tool.)

Best, Shannon

Screen Shot 2019-04-09 at 3 42 43 PM

Clarmy commented 4 years ago

I encountered the same problem.

Nie7yang commented 1 year ago

Sorry, I rediscovered the same problem on the M1 Mac using macOS13.2.1 today, the current QGIS version is 3.30, and the MapSwipe Tool is 1.2. Best, Nie

osgav commented 1 year ago

I had this problem as well, but I've figured out a fix.

After the following lines in swipemap.py in the setMap function…

settings = QgsMapSettings( self.canvas.mapSettings() )
settings.setLayers( self.layers )
settings.setBackgroundColor( QColor( Qt.transparent ) )

…add this line:

settings.setDevicePixelRatio( 1 )

For reference I'm on Fedora Linux 35 (GNOME 41.6, Wayland), QGIS 3.22.8 and MapSwipe Tool 1.2.

https://osgav.run/blog/qgis-plugin-mapswipe-tool.html

felupion commented 1 year ago

I had this problem as well, but I've figured out a fix.

After the following lines in swipemap.py in the setMap function…

settings = QgsMapSettings( self.canvas.mapSettings() )
settings.setLayers( self.layers )
settings.setBackgroundColor( QColor( Qt.transparent ) )

…add this line:

settings.setDevicePixelRatio( 1 )

For reference I'm on Fedora Linux 35 (GNOME 41.6, Wayland), QGIS 3.22.8 and MapSwipe Tool 1.2.

https://osgav.run/blog/qgis-plugin-mapswipe-tool.html

@osgav Tks a lot! it worked on my MAC