Geofence.Geofence(String, IGeoshape) constructor

Applies to Windows and Windows Phone

Initializes a new Geofence object given the id and the shape of the geofence.

Syntax


var geofence = new Windows.Devices.Geolocation.Geofencing.Geofence(id, geoshape);

Parameters

id

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

The Id of the geofence.

geoshape

Type: IGeoshape

The area that defines the geofence to monitor.

Remarks

When this constructor is used, the MonitoredStates will default to monitor for both the Entered and Exited states, SingleUse will default to false, the DwellTime will default to 10 seconds, the StartTime will default to 0 meaning start immediately, and the Duration will default to 0, meaning forever.

The id value must be non-null and less than 64 characters.

The geoshape parameter must be a non-null Geocircle with a SpatialReferenceId that matches the platform or an exception will be thrown.

Requirements

Minimum supported client

Windows 8.1

Minimum supported server

None supported

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Devices.Geolocation.Geofencing
Windows::Devices::Geolocation::Geofencing [C++]

Metadata

Windows.winmd

See also

Geofencing, start to finish
Geofence
Geofence(String, IGeoshape, MonitoredGeofenceStates, Boolean)
Geofence(String, IGeoshape, MonitoredGeofenceStates, Boolean, TimeSpan)
Geofence(String, IGeoshape, MonitoredGeofenceStates, Boolean, TimeSpan, DateTime, TimeSpan)

 

 

Show:
© 2014 Microsoft