ThinkGeo.com    |     Documentation    |     Premium Support

Implementing Globe Projection

Hello,

I am trying to create a globe that can be rotated, similar to Google Earth. Is there any built in ThinkGeo functionality to handle this, or any sample projects demonstrating a globe?

I am able to achieve a 2D image of the globe projection with a certain center lat/long point using ProjectionConverters with the Lambert Azimuthal Equal Area (+proj=laea) projection string. I put together a very rough rotation by updating each layer’s ProjectionConverter +proj=laea string every time I pan the map. For example, “+proj=laea +lat_0=” + LatModifier + " +lon_0=" + LongModifier" where changing latModifier and longModifier will recenter the projection at that point. The modifiers are based on how far the pan tool was clicked and dragged. This leads to a very choppy experience since it requires updating each layer’s ProjectionConverter string and refreshing the map on each pan.

Please let me know if there are any samples using a 3D sphere/globe projection or any alternative for creating a rotatable globe besides constantly reprojecting +proj=laea with different center points.

Thanks,
Dane

Hey Dane,

Unfortunately, 3D support never came to ThinkGeo MapSuite in an official capacity. We had a somewhat workable prototype back in 2015, but ultimately development stopped in favor of development of more in demand features. So, reprojecting using different center points as the user pans is pretty much the only way to simulate that effect.

You might be able to achieve a “smoother” effect by overriding the MapView’s OnMapMouseMove method to update each layer’s projection converter and applying a ResetDelay refresh on the overlay. That way, while the user pans it’ll update when the users pauses briefly. Here’s some pseudo working code here:

protected override void OnMapMouseMove(System.Windows.Input.MouseEventArgs e)
{
    base.OnMapMouseMove(e);

    if (e.LeftButton == MouseButtonState.Pressed)
    {
        var newCenter = CurrentExtent.GetCenterPoint();
        var layerOverlay = Overlays[0] as LayerOverlay;
        foreach (FeatureLayer layer in layerOverlay.Layers)
        {
            layer.FeatureSource.ProjectionConverter = new ProjectionConverter(3857, $"+proj = laea + lat_0 = ${newCenter.X} +lon_0= ${newCenter.Y}");
        }
        layerOverlay.Refresh(new TimeSpan(500), RequestDrawingBufferTimeType.ResetDelay);
    }
}

Thanks,
Kyle

Thanks for the information.

Dane

You’re welcome!

Thanks,
Kyle