New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MapImageLayer not drawn correctly on print #1137

Closed
MatthiasSchilder opened this Issue Mar 7, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@MatthiasSchilder
Copy link
Contributor

MatthiasSchilder commented Mar 7, 2018

Steps to reproduce

  1. Get test data from MapImageLayerPlacing.zip and unzip it.
  2. Open DemoMap.
  3. Open project DemoMapTestproject.dspx from MapImageLayerPlacing.zip
  4. If nothing is shown, zoom to layer extents of layer ‘test’. Notice, that the green linear features overlap the streets in the OSM basemap.
  5. Go to print layout. Click on the layout element and go to the property panel on the right.
  6. Set Location to 200;200. Notice, that the alignment of the layers is still correct. It should look like this now
    image
  7. Print it; to pdf is enough. One of the layers is now misplaced (because offsets are applied twice in the drawing process of the basemap layer (more generally spoken, every MapImageLayer):
    image

DotSpatial version: HEAD of master

Expected behaviour

Alignment of the “layers” in the print should be the same as in the layout preview and map control.

Actual behaviour

Alignment of the “layers” in the print is not the same as in the layout preview and map control.
MapImageLayerPlacing.zip

@MatthiasSchilder MatthiasSchilder referenced this issue Mar 7, 2018

Open

Proposed fix for #1134 and #1137 #1138

3 of 4 tasks complete
@MatthiasSchilder

This comment has been minimized.

Copy link
Contributor

MatthiasSchilder commented Mar 7, 2018

The problem seems to be, that moving the layout element in the layout control sets a rectangle with X/Y-coords != 0. MapImageLayer uses this as a offset for drawing, which is not correct, since in the drawing process, map elements are offsetted with translation (see MapFrame.cs:910) in an earlier step.
I propose the fix in pull request #1138 .
After applying my fix, map window and print layout view are still drawn correctly. Printed view is now drawn correctly, too.

image

@jany-tenaj jany-tenaj closed this in 15ab645 Dec 9, 2018

@jany-tenaj jany-tenaj added the bug label Dec 9, 2018

@jany-tenaj jany-tenaj added this to the 2.0 milestone Dec 9, 2018

jany-tenaj added a commit that referenced this issue Dec 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment