Possibility of adding items to the smart map

Hello,

I’m trying to build a plugin that retrieves the locations of multiple moving elements and displays them on the smart map. I tried to find a way to add elements via the SDK but I didn’t find any, am I missing something?

Thank you.

The way you add a camera, or other items, to the Smart Map manually is one of two:

In the Smart Client in Setup mode place and move items onto the Smart Map.

In the Management Client, on the camera (or other item), on the Info tab, find Positioning information and enter GPS coordinates.

What you can do by code is the equivalent of the second option. Using Configuration API or Rest API you can add GPS coordinates.

A word of caution: You talk about moving elements, but in essence the Smart Map is a static solution. When the Smart Map is opened the location data is read and items are placed. There is no functionality to update this location on the map dynamically. If a location is changed the user will only see it on the Smart Map if he closes and reopens the map.

Teaser test code that is using the Configuration API strongly typed classes (VideoOS.Platform.ConfigurationItems classes)

private void setGisPoint()
{
	ManagementServer mgt = new ManagementServer(EnvironmentManager.Instance.MasterSite.ServerId);
	var cam = mgt.RecordingServerFolder.RecordingServers.FirstOrDefault().HardwareFolder.Hardwares.First(x => x.Name.Contains("Ceili")).CameraFolder.Cameras.FirstOrDefault();
	//cam.GisPoint = "POINT (12.3742 55.658 0)";
	cam.GisPoint = "POINT EMPTY";
	cam.Save();
}

See also- https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_configuration_items_1_1_camera.html&tree=tree_search.html?search=gispoint