ThinkGeo.com    |     Documentation    |     Premium Support

WMTS layer not visible anymore

Hello,
I prepared a small sample code which shows that since version 14.2.2 a public wmts service (https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/WMTS) and one of its layers (World_Imagery) is not shown anymore or even crashes the application.

Same results with using WmtsOverlay instead of WmtsLayerAsync/LayerOverlay.

Were there any code changes from 14.2.1 -> 14.2.2 to be considered to get the same result as visible in 14.2.1?

The exception in 14.2.2 seems to be fixed in further versions but in 14.3.1 I am still not able to see the same result as in 14.2.1

The following sample code was used to test all 3 versions:

private async void MapView_OnLoaded(object sender, RoutedEventArgs e)
{
try
{

			this.mapView.MapUnit = GeographyUnit.Meter;

			var wmtsLayer = new WmtsAsyncLayer(new Uri("https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/WMTS"))
			{
				ActiveLayerName = "World_Imagery"
			};
			var wmtsOverlay = new LayerOverlay();
			wmtsOverlay.Layers.Add(wmtsLayer);
			this.mapView.Overlays.Add("WMTS", wmtsOverlay);

			var pointShape = new PointShape(12911030.330924276, -3743079.27609035); // SRID 3857
			var inMemoryFeatureLayer = new InMemoryFeatureLayer();
			inMemoryFeatureLayer.InternalFeatures.Add("Point", new Feature(pointShape));
			inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyle.CreateSimpleCircleStyle(GeoColors.Red, 10, GeoColors.Black, 1);
			inMemoryFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
			var inMemoryOverlay = new LayerOverlay();
			inMemoryOverlay.Layers.Add("InMemoryFeatureLayer", inMemoryFeatureLayer);
			this.mapView.Overlays.Add("InMemoryOverlay", inMemoryOverlay);

			this.mapView.MouseMove += this.MapView_MouseMove;
			this.mapView.CurrentExtentChanged += this.MapView_CurrentExtentChanged;

			//// Set the extent of the mapView
			this.mapView.CurrentExtent = new RectangleShape(12901000.0, -3743000.0, 12920000, -3760000.0);
			this.currExtent.Content =
				$"minX: {this.mapView.CurrentExtent.MinX}, maxY: {this.mapView.CurrentExtent.MaxY}, maxX: {this.mapView.CurrentExtent.MaxX}, minY: {this.mapView.CurrentExtent.MinY}";

			await this.mapView.RefreshAsync();
		}
		catch (Exception exception)
		{
			Console.WriteLine(exception);
		}

	}

14.2.1 Result:

14.2.2 Result
Crash

System.ArgumentNullException: ‘Value cannot be null. (Parameter ‘key’)’
ThinkGeo.Core.Overlay.7EY=.MoveNext()
ThinkGeo.Core.MapViewBase.WEY=.MoveNext()
ThinkGeo.Core.MapViewBase.WkY=.MoveNext()
ThinkGeo.Core.MapViewBase.VkY=.MoveNext()
ThinkGeo.Core.MapViewBase.U0Y=.MoveNext()
ThinkGeo.Core.MapViewBase.k0Y=.MoveNext()
ThinkGeo.Core.MapViewBase.kkY=.MoveNext()

14.3.1 Result

Hi Daniel,

Thanks for the demo code! It’s an issue introduced after v14.2.1, and it has been fixed in the latest beta (14.4.0-beta044), this fix will be included in the upcoming release v14.3.2, which is about to be available by the end of this month.

Thanks,
Ben