Completed
Last Updated: 09 Jun 2021 14:23 by ADMIN
Release R2 2021 SP1
Ketan
Created on: 09 May 2021 05:03
Category: Map
Type: Feature Request
0
Exception while adding layers without a text/name

Hi,

An exception is thrown while adding layers without name. (System.InvalidOperationException: 'A layer with the same Name already exists in the collection.')

i.e

            var layer1 = new MapLayer();
            var layer2 = new MapLayer();

            map.Layers.Add(layer1);
            map.Layers.Add(layer2);

The simple fix is to always pass a unique name, but it must work like say DataTable.Columns.Add(); (which internally generates unique name)

Thanks

3 comments
ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 10 May 2021 07:03

Hi, Ketan,

Yes, there is a parameterless constructor for the MapLayer which allows you to add multiple layers without a name. That is why I previously logged this as a request for improving.

Please make sure that you follow this item in order to get notified for any further changes.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Ketan
Posted on: 10 May 2021 06:53

Hi Dess,

The MapLayer constructor accepts null for the 'name' parameter.

ADMIN
Dess | Tech Support Engineer, Principal
Posted on: 10 May 2021 06:10
Hello, Ketan,

Currently, each MapLayer requires a unique name by which it can be accessed and managed further, e.g. adding pins to it. The first layer can be added with an empty name, but it is expected the second MapLayer without a name to thrown an exception since the name is not unique, there is another layer already with the same empty name.

Indeed, it sounds reasonable to generate an automatic name for the layer if it is added with an empty name. That is why I am converting this support thread into a public feedback item on your behalf. You can track its progress, subscribe for status changes and add your comments on the following link - feedback item.

I have also updated your Telerik points.


I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.