ThinkGeo.com    |     Documentation    |     Premium Support

WmsAsyncLayer v14.2

Hello,

after upgrading from version 13.3 to version 14.2 i have noticed some issues. The first one reagrds the WmsAsycLayer. One of the most popular Wms-Sites in germany is https://sgx.geodatenzentrum.de/wms_topplus_open. ThinkGeo generates in version 13.3 Get-Request with ‘CRS=EPSG:25832’. Now the request is ‘CRS=25832’ and the server sends an error.
So my question: Must I change the request in ‘OnSendingHttpRequestMessage’ (I try that and is works fine) or is that an issue?

Regards Torsten

hi @Torsten,

Here’s the code snippet, I also uploaded a working sampleWmsIssue.zip (3.2 KB), feel free to give it a try.

WmsAsyncLayer layer = new WmsAsyncLayer(new Uri("https://sgx.geodatenzentrum.de/wms_topplus_open"), null, "EPSG:25832");
await layer.OpenAsync();
var layers = layer.GetServerLayers();
layer.ActiveLayerNames.Add(layers[0].Name);
layer.ActiveStyleNames.Add("");

LayerOverlay overlay = new LayerOverlay();
overlay.Layers.Add(layer);
map.Overlays.Add(overlay);

map.CurrentExtent = layer.GetBoundingBox(); ;
await map.RefreshAsync();

Regards,
Leo

Hi Leo,

thanks for your answer and sorry for the late response - i was ill.
The WmsAsyncLayer works for me. It was my mistake. I did elsewher in code casting the wmslayer to Layer intead AsyncLayer.

There is another problem after uprading my solution from 13.3 to 14.2. I have a custom class “SqlShapeAsMapShapesLayer” drived from SqlServerFeatureLayer.
In SqlShapeAsMapShapesLayer is a Collection of MapShapes

 private Dictionary<string, MapShape> mapShapes = new Dictionary<string, MapShape>();
 public Dictionary<string, MapShape> MapShapes
 {
     get { return mapShapes; }
 }

and a DrawCore method

protected override void DrawCore(GeoCanvas canvas, Collection<SimpleCandidate> labelsInAllLayers)

Now the DrawCore method is never called. All my other functions works as espected (zooom to a mapshape etc.)

Have you any suggestions for these behavier?

Regards
Torsten

HI Torsten,

I hope you’re feeling fully recovered now!

It sounds like you were hitting a cache so the layer was not drawn. Could you set a breakpoint in the constructor to verify that it’s being initialized? Additionally, try clearing the cache or navigating to an area without cach to check if DrawCore() is being called.

We haven’t made any changes to SqlServerFeatureLayer since version 13.3, so the behavior in v13.3 should be identical to v14. If you’re still encountering this issue, please share a code snippet showing how SqlShapeAsMapShapesLayer is being used, and we’ll investigate further.

Thanks,
Ben

Hi Ben,
thanks for your quick answer. I think the layer is initialized - the constructor is called with no errors. For testing purposes i derived SqlShapeAsMapShapesLayer now from MapShapeLayer and it works.
Basicly I use SqlServerFeatureLayer to load all features from the database table in the MapShapes Dictionary after the constructor is called.
After that, only the MapShapes are handled by my code.

Now, when I use MapShapeLayer as the base class, I use SqlServerFeatureLayer as a ‘helper’ to load the features in the MapShapes.
So I think the logic for instance in LayerOverlay was changed and decides now that the DrawCore not need to be called.

I think I will change my code an go on with the MapShapeLayer.

Regards Torsten

That should work. Just let us know if you see any more issues.

Thanks,
Ben