The ThemeLayer class contains already the GetItemInfoValue() method, but
public virtual ItemInfoValue GetItemInfoValue()
{
string uri = Id;
Item portalItem = ItemFactory.Instance.Create(uri, ItemFactory.ItemType.PortalItem);
return new ItemInfoValue()
{
name = portalItem?.Name,
title = portalItem?.Name,
catalogPath = portalItem?.Path,
type = portalItem?.Type,
typeID = portalItem?.TypeID,
isContainer = "false" // is that correct?
};
}
returned always null, as long as I was giving the url to the portal item, instead of simply handing the item id over.
However, now my issue is that the items path value is not pointing at the service itself but at a directory, via the Rest api: "https://portal.com/fed/rest/services/folder/service_name/FeatureServer".
As I see it the actual Feature Service would be found at : "https://portal.com/fed/rest/services/folder/service_name/FeatureServer/0". Now, that one I cannot access, since:
Error: The administrator has disabled the Services Directory.
Code: 403
Usually, I create the layer I want to add from our portal by creating the uriString through:
string curService = $"https://portal.com/portal/home/item.html?id={guid}"
LayerFactory.Instance.CreateLayer(new Uri(curService, UriKind.Absolute), activeMapView.Map, 0);
and that's what I planned to have in the OnDrop() method. But, I never reach the method, because the end of the StartDrag() method leads to a warning-messagebox: Add data - Failed to add data: https://portal.com/fed/rest/services/folder/service_name/FeatureServer
I would rather have the OnDrop() method doing the job of adding the items to the map. Currently it seems that the StartDrag() method is doing everything, which does not make sense, since it is immediately activated when dragging something, without even knowing where it is dragged to.
Does that make sense?
- We are living in the 21st century.
GIS moved on and nobody needs a format consisting out of at least three files! No, nobody needs shapefiles, not even for the sake of an exchange format. Folks, use GeoPackage to exchange data with other GIS!