Class: Layer

Portal Home

CMaps Analytics Online Portal

Javascript API Docs

How to Use CMaps API

Working with Data

Working with Layers

Including Custom Components

View API Docs

Request Access

Developer Resources

Developers Introduction to CMaps Designer

Strategies for Integrating CMaps Analytics

Embed and Connect CMaps Templates in HTML5 App

Creating custom CMaps Analytics Plugin & Property Sheet

Security Guide

Layer

Base class that represents a layer w/ business data & useful functionality to control it.

Constructor

new Layer()

Properties:
Name Type Description
timeAnalysisOptions Object {animateWhilePlaying: false, fadeInterval: 50};
restrictCalcsToViewport Boolean Restricts data calculations to only what's visible in the viewport.
restrictCalcsToVisible Boolean Restricts data calculations to only what's visible on the map, regardless of whether or not an object is in the current viewport.
restrictCalcsToSelected Boolean Restricts data calculations to only what's selected in the layer.
defaultDisplayObjectColor String READ-ONLY "#1b8dce"
displayObjectColors Array READ-ONLY ["#1b8dce", "#1b8dce"];
defaultDisplayObjectPixelSize Number READ-ONLY 20
displayObjectPixelSizes Array READ-ONLY [20, 20]
displayObjectTimes Array READ-ONLY [Date|null, Date|null, Date|null]
displayObjectCategories Array READ-ONLY ["Cat 1", "Cat 1", "Cat 1"]
displayObjectValues Array READ-ONLY [1, 2, 3]
displayObjectLabels Array READ-ONLY ["Label 1", "Label 2", "Label 3"]
displayObjectSelectedFlags Array READ-ONLY [true|false, true|false]
displayObjectVisibilityFlags Array READ-ONLY [true|false, true|false]
cleansedLocationData String READ-ONLY READ-ONLY 1 or 2D Array depending on layer. Holds an array of the transformed location data (centigon.mapping.Location)
apiSpecificLocationData String READ-ONLY READ-ONLY 1 or 2D Array depending on layer. Holds an array of the api-specific location data
rawLocationData Array READ-ONLY READ-ONLY 1 or 2D Array depending on layer. Holds an array of the original location data fed to the layer, unprocessed
cMap Object READ-ONLY READ-ONLY centigon.mapping.CMap
cMapAnalytics Object READ-ONLY READ-ONLY centigon.locationIntelligence.CMapAnalytics
positionInMapDataProvider String READ-ONLY READ-ONLY layer's ordinal position in the map
visible String READ-ONLY READ-ONLY true|false
Version:
  • 4.1.00

Methods

addAddressDataGeocodedCallback(func)

Get called back when address data has been geocoded.
Parameters:
Name Type Description
func Object the callback

addAddressDataProcessedCallback(func)

Get called back when address data has been processed. Doesn't guarantee any asynch data is ready.
Parameters:
Name Type Description
func Object the callback

categories() → {Array}

Get/set categories, same as using cMapAnalytics.categories()[lyrIndex]
Returns:
Type
Array

colors() → {Array}

Get/set colors, same as using cMapAnalytics.colors()[lyrIndex]
Returns:
Type
Array

drawLayer()

Force draw

getAllCleansedLayerLocations() → {Object}

Get all clean, processed locations
Returns:
Type
Object

getAllDisplayObjectsAsCollection() → {Object}

Get all display objects
Returns:
Type
Object

getAllRawLayerLocations() → {Object}

Get all raw, unprocessed locations
Returns:
Type
Object

getApiSpecificLocations() → {Object}

Get all clean, api-specific locations
Returns:
Type
Object

getAvg() → {Number}

Returns data average. Subject to "restriction" calc flags
Returns:
Type
Number

getCategories() → {Array}

Get property based on "restriction" calc flags
Returns:
Type
Array

getCleansedLayerLocation(i) → {Object|Array}

Returns selected location
Parameters:
Name Type Description
i Number child index
Returns:
Type
Object | Array

getColors() → {Array}

Get property based on "restriction" calc flags
Returns:
Type
Array

getCount() → {Number}

Returns location count. Subject to "restriction" calc flags
Returns:
Type
Number

getDateRangeBounds() → {Object}

Get time-based bounds
Returns:
{min:null, max:null, dayDiff:null, hourDiff:null, minDiff:null, secDiff:null, msDiff:null, numTimes:null, avgDiffBetweenTimesInMs:null, avgDiffBetweenTimesInSecs:null, avgDiffBetweenTimesInMins:null, avgDiffBetweenTimesInHours:null, avgDiffBetweenTimesInDays:null}
Type
Object

getDisplayObjectAtIndex(i) → {Object}

Gets display object at child index
Parameters:
Name Type Description
i Number
Returns:
Type
Object

getDisplayObjectIterator() → {Object}

Get all centigon.mapping.LayerDisplayObject
Returns:
Type
Object

getDisplayObjectSelectedFlags() → {Array}

Get list of selected flags
Returns:
Type
Array

getLabels() → {Array}

Get property based on "restriction" calc flags
Returns:
Type
Array

getLocations() → {Array}

Get property based on "restriction" calc flags
Returns:
Type
Array

getMax() → {Number}

Returns data max. Subject to "restriction" calc flags
Returns:
Type
Number

getMeasureIx() → {Number}

Get active measure index
Returns:
Type
Number

getMedian() → {Number}

Returns data median. Subject to "restriction" calc flags
Returns:
Type
Number

getMin() → {Number}

Returns data min. Subject to "restriction" calc flags
Returns:
Type
Number

getSelectedLabel() → {String}

Returns selected label
Returns:
Type
String

getSelectedLocation() → {Object|Array}

Returns selected location
Returns:
centigon.mapping.Location | Array of centigon.mapping.Location
Type
Object | Array

getSelectedValue() → {Number}

Returns selected data value
Returns:
Type
Number

getSum() → {Number}

Returns data sum. Subject to "restriction" calc flags
Returns:
Type
Number

getTimes() → {Array}

Get property based on "restriction" calc flags
Returns:
Type
Array

getValues() → {Array}

Get property based on "restriction" calc flags
Returns:
Type
Array

getVisibilityFlags() → {Array}

Get property based on "restriction" calc flags
Returns:
Type
Array

getVisibleLocations() → {Array}

Get all visible locations
Returns:
of centigon.mapping.Location
Type
Array

isSelectedFlagEnabledAtIndex(index) → {Boolean}

Returns whether the displayObject is selected
Parameters:
Name Type Description
index Number child index
Returns:
Type
Boolean

labels() → {Array}

Get/set labels, same as using cMapAnalytics.labels()[lyrIndex]
Returns:
Type
Array

locations() → {Array}

Get/set locations, same as using cMapAnalytics.locations()[lyrIndex]
Returns:
Type
Array

lyrObjTimeWithinRange(dpsObjIx, timeFilterObj) → {Boolean}

Checks if the child display object falls within the given min/max date
Parameters:
Name Type Description
dpsObjIx Number child display object index
timeFilterObj Object {min: Date, max: Date}
Returns:
Type
Boolean

measureNames() → {Array}

Get/set measureNames, same as using cMapAnalytics.measureNames()[lyrIndex]
Returns:
Type
Array

measures() → {Array}

Get/set measures, same as using cMapAnalytics.measures()[lyrIndex]
Returns:
Type
Array

removeAddressDataProcessedCallback(func)

Remove a callback
Parameters:
Name Type Description
func Object the callback to remove

removeAddressDataProcessedCallback(func)

Remove a callback
Parameters:
Name Type Description
func Object the callback to remove

setMeasure(measIx)

Set active measure
Parameters:
Name Type Description
measIx Number

times() → {Array}

Get/set times, same as using cMapAnalytics.times()[lyrIndex]
Returns:
Type
Array

values() → {Array}

Get/set values, same as using cMapAnalytics.values()[lyrIndex]
Returns:
Type
Array