Quantcast
Channel: DotSpatial Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1128

Created Unassigned: Multiple map reprojections fail + drawings not included [63631]

$
0
0
So I am adding an option to my map to change projections between WGS84 and NorthPoleStereographic. The first time the user changes, it works well but then if they want to change it back it just results in a map that looks like a 3D x,y,z axis.

To demonstrate this open up the DemoMap and add land masses and your country and maybe some other shapefile. Right-click on the MapFrame>Projection and change to say Projected.Polar.NorthPoleStereographic. You may have to zoom in to specific country as zooming to the world causes it to go to infinity. but anyways it looks like it should.

Now do the same except change to Geographic.World.WGS1984. It goes to the x,y,z axis. Not sure whats going on there. Is there a workaround?

The other issue is when I reproject a MapFrame the drawings are not reprojected. I think there should be an option to account for these as an overload. I have done this manually like so:

```
'set new projection of the map
'mapMain.MapFrame.Reproject(newProj) '<-- why doesnt this work?
Dim ignoredLayers = New StringBuilder
mapMain.MapFrame.ReprojectMapFrame(newProj, Function(layer) ignoredLayers.AppendLine(layer.LegendText))
If ignoredLayers.Length > 0 Then
MessageBox.Show(Me, "These layers were skipped:" & Environment.NewLine & ignoredLayers.ToString, "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning)
End If

'we have to reproject drawing layers separately
For Each lyr As ILayer In mapMain.MapFrame.DrawingLayers
Debug.Print("Drawing layer has projection [{0}] and CanReproject={1}", lyr.ProjectionString, lyr.CanReproject)
If lyr.CanReproject Then
lyr.Reproject(newProj)
End If
Next lyr
mapMain.MapFrame.ResetExtents()
```

~AGP

Viewing all articles
Browse latest Browse all 1128

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>