Repository navigation
platform sdk maps
In Security Center, a Map entity displays a floor plan, a site layout, or a georeferenced map in two dimensions. It shows the position of cameras, doors, areas, and other entities for operators in Security Desk. Each item placed on a map is a MapObject linked either to a Security Center entity or rendered as a custom shape, image, or text label. The Platform SDK reads and writes the map's contents through the Map entity:
Map map = engine.GetEntity<Map>(mapGuid);
ReadOnlyCollection<MapObject> existingObjects = map.MapObjects;Map.MapObjects is read-only. Add, modify, or delete map objects through Map.Add, Map.Update, and Map.Remove.
Map object types that you can create are defined in Genetec.Sdk.Entities.Maps, derive from MapObject, and have a public parameterless constructor. The available types are:
- Entity-linked:
CameraMapObject,DoorMapObject,AccessControlUnitMapObject,LprUnitMapObject,DeviceMapObject,ZoneMapObject,IntrusionAreaMapObject,AreaMapObject,MacroMapObject,MapMapObject,CustomEntityMapObject,AlarmMapObject,TilePluginMapObject,SequenceMapObject. - Shapes:
EllipseMapObject,RectangleMapObject,LineMapObject,PolygonMapObject. - Image and text:
ImageMapObject,TextBlockMapObject.
Most types derive from MapRelativeObject, which adds RelativeWidth and RelativeHeight for sizing. The base MapObject exposes the properties common to all types: Id, LinkedEntity, Latitude, Longitude, Rotation, LayerId, and ZIndex.
LayerId identifies the map layer that contains the object. CameraMapObject, DoorMapObject, and AreaMapObject use fixed layers. Assigning a different GUID to their LayerId property does not change the layer ID returned by the object.
Construct a concrete map object, set its properties, and call Map.Add. For entity-linked types, set the target entity's Guid on LinkedEntity:
var camera = new CameraMapObject
{
LinkedEntity = cameraGuid,
Latitude = 45.5,
Longitude = -73.6,
Rotation = 90.0,
AngleOfView = 75.0,
MaxDistance = 50.0,
};
map.Add(camera);For decorative types, populate the type-specific properties:
var label = new TextBlockMapObject
{
Text = "Lobby",
Latitude = 45.5,
Longitude = -73.6,
FontSize = 14,
FontIsBold = true,
};
map.Add(label);Modify an existing map object retrieved from Map.MapObjects and call Map.Update:
CameraMapObject camera = map.MapObjects
.OfType<CameraMapObject>()
.FirstOrDefault(o => o.LinkedEntity == cameraGuid);
if (camera != null)
{
camera.Rotation = 180.0;
camera.AngleOfView = 90.0;
map.Update(camera);
}Map.RefreshMapObject(mapObject) discards unsaved local changes on a map object and restores the values it last received from Security Center. It updates the instance you pass and returns that same instance. Pass an object you obtained from Map.MapObjects; a map object you constructed yourself has nothing to restore. To read the current state of a map, read Map.MapObjects again.
Pass the map object's Id to Map.Remove:
CameraMapObject toRemove = map.MapObjects
.OfType<CameraMapObject>()
.FirstOrDefault(o => o.LinkedEntity == cameraGuid);
if (toRemove != null)
{
map.Remove(toRemove.Id);
}Id is the Guid that identifies the map object within the map. It is independent of the linked entity's Guid, so always pass Id, not LinkedEntity, to Remove.
Map.IsGeoReferenced indicates whether the map's coordinate system represents real geographic positions. On a georeferenced map, MapObject.Latitude and MapObject.Longitude are real coordinates and are validated when you call Add or Update. On a non-georeferenced map (a floor plan or schematic), the same properties are pixel-relative numbers within the image and are not validated.
- Overview
- Connecting to Security Center
- SDK certificates
- Referencing SDK assemblies
- ASP.NET hosting
- SDK compatibility
- Migrating to modern .NET
- Entities
- Entity cache
- Entity loading, cache, and query options
- Detecting entity changes
- Entity change event reference
- Transactions
- Security Center events
- Actions
- Security Desk
- Custom events
- Event-to-actions
- Managing macros
- ReportManager
- ReportManager query reference
- Access control raw events
- DownloadAllRelatedData and StrictResults
- Privileges
- Partitions
- Entity write restrictions
- About custom fields
- About video
- About cameras
- Enrolling a video unit
- Ingesting third-party video
- Archiver and auxiliary archiver roles
- Archive transfer
- About access control
- About cardholders and credentials
- About doors, areas, elevators, and access points
- About access rules and schedules
- About access control units and interface modules
- Enrolling an access control unit
- Door templates
- Visitors
- Mobile credentials
- About threat levels
- About alarms
- About incidents
- Maps
- Logging
- Overview
- Localization
- Certificates
- Lifecycle
- Threading
- State management
- Configuration
- Restricted configuration
- Events
- Queries
- Request manager
- Database
- Entity ownership
- Engine extensions
- Entity mappings
- Server management
- Custom privileges
- Custom entity types
- Resolving non-SDK assemblies
- Deploying plugins
- Modern .NET support
- Overview
- Localization
- Certificates
- Creating modules
- Tasks
- Pages
- Components
- Tile extensions
- Services
- Contextual actions
- Custom actions
- Options extensions
- Configuration pages
- Monitors
- Shared components
- Commands
- Extending events
- Map extensions
- Timeline providers
- Image extractors
- Credential encoders
- Credential readers
- Cardholder fields extractors
- Badge printers
- Content builders
- Dashboard widgets
- Incidents
- Logon providers
- Pinnable content builders
- Custom report pages
- Overview
- Getting started
- Media file formats
- MediaPlayer
- VideoSourceFilter
- MediaExporter
- MediaFile
- G64 converters
- FileCryptingManager
- PlaybackSequenceQuerier
- PlaybackStreamReader
- OverlayFactory
- PtzCoordinatesManager
- AudioTransmitter
- AudioRecorder
- AnalogMonitorController
- Camera blocking
- Overview
- Getting started
- Referencing entities
- Entity operations
- About access control in the Web SDK
- About video in the Web SDK
- Users and user groups
- Partitions
- Custom fields
- Custom card formats
- Actions
- Events and alarms
- Incidents
- Reports
- Tasks
- Macros
- Custom entity types
- System endpoints
- Performance guide
- Reference
- Endpoints
- Constants
- Enumerations
- Under the hood
- Troubleshooting