Hi,
My problem is related to S-57 maps. I was able to display my S-57 map, but it is stretched horizontally. The image below is a fragment of the displayed map (upper image), and how it should look (lower image).
image: postimg.org/image/76tknvyer/
I suppose problem is in projections, but I don’t understand how it works. Can you tell what should I do to properly display S-57 map?
Here is my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections.ObjectModel;
using ThinkGeo.MapSuite.Core;
using ThinkGeo.MapSuite.DesktopEdition;
namespace JustMapWinForms
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
S57FeatureLayer worldLayer = new S57FeatureLayer(@“C:\Users\Win7Pro32b\Documents\roboczy\mapy\name\name.000”, null, null, “Area”);
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
LayerOverlay layerOverlay = new LayerOverlay();
layerOverlay.Layers.Add(worldLayer);
Map1.MapUnit = GeographyUnit.DecimalDegree;
Map1.Overlays.Add(“Layers”, layerOverlay);
Map1.CurrentExtent = GetFullExtent(layerOverlay.Layers);
Map1.Refresh();
}
private RectangleShape GetFullExtent(GeoCollection<
Layer
> Layers)
{
Collection<
BaseShape
> rectangleShapes = new Collection<
BaseShape
>();
foreach (Layer layer in Layers)
{
layer.Open();
if (layer.HasBoundingBox == true) rectangleShapes.Add(layer.GetBoundingBox());
}
return ExtentHelper.GetBoundingBoxOfItems(rectangleShapes);
}
}
}