Click or drag to resize

Telogis.GeoBase.MapLayers.PolygonFence

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release

MapLayers.PolygonFence inherits from MapLayers.GeoFence.

A variant of MapLayers.GeoFence that represents a region defined by the closure of an arbitrary polyline.

Constructor
NameDescription
MapLayers.PolygonFence(config)

Arguments

  • config (Object) - Configuration properties for the MapLayers.PolygonFence.

    Properties
    NameTypeDescription
    pointsArray

    The array of LatLon points defining the polygon that initially bounds the fence.

    Defaults to [].
    vertexRadiusNumber

    The radius of the dots to render at the vertices of the polygon. If this is set to zero, no such markers are drawn.

    Defaults to 0.
Functions
NameDescription
appendPoint (LatLon loc)

Appends a point to the polyline defining the fence and updates its bounding box accordingly.

Arguments
  • loc (LatLon) - The latitude-longitude coordinates of the point to add.

contains (LatLon loc)

Determines whether a given point lies within the fence boundaries.

Arguments
  • loc (LatLon) - The latitude-longitude coordinates of the point to test for.

Returns

Boolean - True if MapLayers.PolygonFence.contains.loc lies within the fence; false otherwise.

getPoints ()

Finds the array of points defining the fence's bounding polyline.

Returns

Array - A copy of the fence's vertex array, as LatLons.

snapToStreets (Function callback, Function errorCallback, Object server)

Generates a collection of geofences that represent this MapLayers.PolygonFence when its outer edges have been snapped to the street-links it contains.

Arguments
  • callback (Function) - The function to call when the snapped fence information has been fetched.

    Arguments
  • (Optional) errorCallback (Function) - A callback to execute if an error or timeout occurs while snapping the fence. Defaults to null.

    Arguments
    • error (Telogis.Errors.GeoBaseError) - An exception describing the problem that was encountered.

  • server (Object) - An optional object that contains server.url (The address of the GeoStream server as a string) and server.authToken (The GeoStream authentication token to be used for requesting tiles) to be used for this request.