We have this issue on the MAP, we havnt checked this yet with the smart map.
Is there a fix or a workaround so we could use this feature without loosing settings like the MapIcon(also effect the Item.ContextMenu being flushed also).
It seems a bug because we could see the issue. Milestone Development will start an investigation, let me get back to you when I receive a news from them.
We found that this is a combination of how configuration changes are handled in the Event Server and how at least the Sensor Monitor sample is implemented.
Whenever there is a change to any item of a specific kind a notification will be sent to Event Server and it will reload all items of this kind. Unfortunately even though SensorMonitor sample persists the state of the sensors (in static SensorItem.SensorActiveState dictionary) the icon is a property on the item itself and will thus be reset when the configuration is reloaded.
So you need to ensure that the current icon is also persisted when the items are related.
We will fix this in the SensorMonitor sample by overriding the SensorItem.MapIconKey with the following code and no longer set the icon from SensorMonitorSensorItemManager (as it will now be controlled by the state instead):
public override Guid MapIconKey
{
get
{
if (SensorActiveState.ContainsKey(FQID.ObjectId) && SensorActiveState\[FQID.ObjectId\])
{
return SensorMonitorDefinition.SensorMonitorSensorActivated;
}
else
{
return SensorMonitorDefinition.SensorMonitorSensorKind;
}
}
set { } // do nothing
}