Class: CMapAnalytics

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

CMapAnalytics

Main class that represents a map, layers w/ business data & useful functionality to control them.

Constructor

new CMapAnalytics()

Version:
  • 4.1.00

Methods

addLayerLocationsForDynamicZooming(layer)

Adds a given layer's locations to the dynamic zoom list
Parameters:
Name Type Description
layer Object centigon.mapping.Layer

addMapClickListener(callback)

Register a callback for when the map gets clicked, anywhere.
Parameters:
Name Type Description
callback function

adhocPanelVisible(value) → {Boolean}

Controls selector control visiblity
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

advancedInfoWindowVisible(val)

Sets the advanced info window's visibility.
Parameters:
Name Type Description
val Boolean

alertColors(value) → {Array}

Gets/Sets alert level colors for all layers. The difference between this property and alertDefaultColors, is that each array in this 2D Array can contain N number of color codes, depending on how many alert levels are established for the given layer, whereas alertDefaultColors only assigns 1 default color per layer.
Parameters:
Name Type Description
value Array 2DArray of String values that need to equal the number of layers present. e.g. [["#00FF00","#EFEFEF","#FFFFFF"]]
Returns:
Type
Array

alertDefaultColors(value) → {Array}

Gets/Sets default alert colors for all layers
Parameters:
Name Type Description
value Array of String values. e.g. ["#00FF00","#EFEFEF","#FFFFFF"]
Returns:
Type
Array

alertDefaultIcons(value) → {Array}

Gets/Sets default alert icon types for all layers
Parameters:
Name Type Description
value Array of String values that need to equal the number of layers present. e.g. [centigon.mapping.MarkerIconFactory.ICONS.PIN, centigon.mapping.MarkerIconFactory.ICONS.CYLINDER]
Returns:
Type
Array

alertEnabled(value) → {Array}

Gets/Sets if alerts are enabled for all layers
Parameters:
Name Type Description
value Array of Booleans
Returns:
Type
Array

alertIcons(value) → {Array}

Gets/Sets alert level icons for all layers.The difference between this property and alertDefaultIcons, is that each array in this 2D Array can contain N number of icon types, depending on how many alert levels are established for the given layer, whereas alertDefaultIcons only assigns 1 default icon type per layer.
Parameters:
Name Type Description
value Array 2DArray of String values that need to equal the number of layers present. e.g. [[centigon.mapping.MarkerIconFactory.ICONS.PIN, centigon.mapping.MarkerIconFactory.ICONS.CYLINDER]]
Returns:
Type
Array

alertIconSwitchingEnabled(value) → {Array}

Determines if alert automatic icon switching behavior is enabled for all layers. If the behavior is enabled for a layer, the map's alert controller will automatically change icon types for individual points, based on the layer's alert configuration. measure against.
Parameters:
Name Type Description
value Array of Booleans
Returns:
Type
Array

alertIsHighGood(value) → {Array}

Determines if high values are to be considered "good" for all layers
Parameters:
Name Type Description
value Array of Booleans
Returns:
Type
Array

alertLimits(value) → {Array}

Gets/Sets alert limits values for all layers. Each level for each alert-enabled layer, should contain a limit value. These values are used as upper limits to restrict when color or icon styles change.
Parameters:
Name Type Description
value Array 2D 2DArray of Numbers that need to equal the number of layers present
Returns:
Type
Array

alertTargetEnabled(value) → {Array}

Determines if alert targets are enabled for all layers. If the data supplied to the map's "values" property are measured against unique targets per data point, enabling this for the layer is the appropriate alert option. When using this option, the alertTargets property is required to provide target values to measure against.
Parameters:
Name Type Description
value Array of Booleans
Returns:
Type
Array

alertTargets(value) → {Array}

Gets/Sets alert target values for all layers. Each level for each alert-enabled layer, should contain a target value, if targets are enabled for the given layer. The values contained within alertTargets will be measured against the map's values property.
Parameters:
Name Type Description
value Array 2D 2DArray of Numbers that need to equal the number of layers present. e.g. 2 layers, one with 3 levels and the other with 2, could look like [[1, 2.5, 5.6], [100, 250]).
Returns:
Type
Array

alertTypes(value) → {Array}

Determines the alert type for each layer measure against.
Parameters:
Name Type Description
value Array of Strings, e.g. "type-none", "type-heatmap", "type-target", "type-value"
Returns:
Type
Array

allowMultipleSelection(value) → {Boolean}

If true, multiple layer objects can be selected, otherwise only a single object can be selected
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

baseImageryStyle() → {String}

Sets the style of the base map tiles
Parameters:
Name Type Description
e.g. String | Object "grayscale", military", coolgray", black", satellite", terrain", roadmap", hybrid"
Returns:
Type
String

boundsContain(arrLatLng, csvLatLng) → {boolean}

Check to see if the csvLatLng is contained in the bounds made up of the lat,lngs in arrLatLng.
Parameters:
Name Type Description
arrLatLng array of lat,lng strings
csvLatLng string
Returns:
Type
boolean

buildIndoorMapsList()

Build list of any indoor SVG hyperlinks associated with a given layer's display object

categories(value) → {Array}

Determines the category for every location to be plotted for all layers
Parameters:
Name Type Description
value Array 2D Array of Strings
Returns:
Type
Array

center(value) → {String}

Gets/Sets current map center.
Parameters:
Name Type Description
value String Can be lat,lng or address
Returns:
Type
String

clearAllLayersSelectedFlags()

Resets all layer's selected flags to empty.

clearAllLocationsForDynamicZooming()

Clears all locations that have been currently accumulated to perform dynamic zooming.

clearAllSelections()

Clears all map selections and sets the adhoc panel to single-select

clearLayerFilters(lyrIx)

Clear all filters for given layer ix
Parameters:
Name Type Description
lyrIx Number

clearSelectionsAndRefreshDynamicZoom()

Clears all map selections and reevaluates dynamic zoom

clickLocation() → {String}

Returns:
lat,lng representing wherever user last clicked on the map
Type
String

closeAllInfoWindows()

Closes all open infowindows

clusterOptions(value) → {Array}

Determines how the radius of a layer's clustering is calculated. Choices for radius_unit_of_measure are "auto|pixels|meters|mi|km"
Parameters:
Name Type Description
value Array Array of Objects e.g. [{radius_unit_of_measure:"auto"}, {radius_unit_of_measure:"meters", radius:3000}]
Returns:
Type
Array

clusterStyles(value) → {Array}

Determines the style of a layer's clustering
Parameters:
Name Type Description
value Array Array of Strings e.g. "sum", "samelocationsum", "average", "samelocationaverage", "count", "samelocationcount"
Returns:
Type
Array

clusterToggleVisible(value) → {Boolean}

Controls cluster-toggle control visiblity
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

colors(value) → {Array}

Gets/Sets the color of every object on every layer
Parameters:
Name Type Description
value Array 2D Array of String values that need to equal the number of layers present, that are used to color every layer object. e.g. [["#00FF00","#EFEFEF","#FFFFFF"],["#00FF00","#EFEFEF","#FFFFFF"]]
Returns:
Type
Array

convertDistanceToMeters(value, unitOfMeasure) → {number}

Parameters:
Name Type Description
value number
unitOfMeasure String e.g. mi, km, yards
Returns:
Type
number

currentLocation() → {string}

Returns the current location of the user's device
Returns:
lat,lng String e.g. '32.777865,-117.119752'
Type
string

currentLocationControlVisible(value) → {Boolean}

Controls current location control visiblity
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

currentMapCenterLatitude() → {String}

Get current center lat
Returns:
Type
String

currentMapCenterLongitude() → {String}

Get current center lon
Returns:
Type
String

dbfKeys(value) → {Array}

2D Array of String values that are used in conjunction with "userShapeKeys" to map data values to, and control the visibility of, shape layer objects. The DBF Keys are obtained directly from the DBF file and contain a distinct range of values obtained directly from the DBF file. The DBF file contains the labels/ids for each shape within a shape file and can be opened. (can be opened with Excel, other spreadsheet or GIS tools). Upon extracting the DBF data from the shapefile and passing it to the dbfKeys property, you can change the values but NOT the sort order. If you need to change the data order, you will do so when using the userShapeKeys property.
Parameters:
Name Type Description
value Array 2D Array of Strings
Returns:
Type
Array

defaultLayerColors(value) → {Array}

Determines each layer's default color.
Parameters:
Name Type Description
value Array of String values. e.g. ["#00FF00","#EFEFEF","#FFFFFF"]
Returns:
Type
Array

defaultLayerIcons(value) → {Array}

Array of String values that need to equal the number of layers present, that are used to determined a layer's default icon.
Parameters:
Name Type Description
value Array of Strings Complete list of icons available inside of centigon.mapping.MarkerIconFactory.ICONS. e.g. [centigon.mapping.MarkerIconFactory.ICONS.PIN, centigon.mapping.MarkerIconFactory.ICONS.CYLINDER]
Returns:
Type
Array

defaultLayerSizes(value) → {Array}

Determines each layer's default icon size.
Parameters:
Name Type Description
value Array of Numbers that need to equal the number of layers present, that are used to determined a layer's default icon size.
Returns:
Type
Array

defaultZoomCoords(latLng) → {String}

Gets/Sets where the map should pan to on init
Parameters:
Name Type Description
latLng String
Returns:
Type
String

deregisterCustomLayer()

Removes the specified custom layer from the map.

directionPanelVisibility(value) → {string}

Determines the visibility of the directions panel. 1, "on" or true equal visible while 0, "off" or false equal hidden.
Parameters:
Name Type Description
value Boolean | String
Returns:
Type
string

directionWaypoints(waypoints) → {string}

Locations to get directions for
Parameters:
Name Type Description
waypoints Array of lat,lng values or addresses or both. e.g. ['32.777865,-117.119752', 'San Diego, CA']
Returns:
Type
string

drillBreadcrumbsVisible(value) → {Boolean}

Shows the breadcrumb navigation on the top of the map so users can drill up.
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

drillEventTriggers(value) → {Array}

Assigns an optional drill event trigger type to map layers.
Parameters:
Name Type Description
value Array of String values e.g. layerclicked or infowindowclicked
Returns:
Type
Array

drillIds(value) → {Array}

Drill ID's are used to filter data down, based on parent-child drilling relationships.
Parameters:
Name Type Description
value Array
Returns:
Type
Array

drillLevels(value) → {Array}

Assigns an optional drill level to map layers.
Parameters:
Name Type Description
value Array
Returns:
Type
Array

drillLevelsExistBelowLayer(layer) → {Boolean}

Returns true if a drill level exists below the given layer
Parameters:
Name Type Description
layer Object centigon.mapping.Layer
Returns:
Type
Boolean

drillParents(value) → {Array}

Assigns an optional drill parent to map layers. A drill parent should correspond to the parent layer's index.
Parameters:
Name Type Description
value Array
Returns:
Type
Array

dynamicZoomEnabled(value) → {Boolean}

When true, auto-pans-and-zooms the map to fit the locations that have been plotted. This value is honored anytime the "locations" property changes.
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

dynamicZoomEnabledNoVportRecalc(value) → {Boolean}

Same as "dynamicZoomEnabled", except no immediate reevaluation of dynamic zoom is performed
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

dynamicZoomOnClusterSelect(value) → {Boolean}

When true, auto-pans-and-zooms the map to fit the currently selected cluster's bounds.
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

dynamicZoomOnDrill(value) → {Boolean}

Dynamically zooms in on drillable layers when drilling occurs.
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

dynamicZoomOnPointSelect(value) → {Boolean}

When true, auto-pans-and-zooms the map to center on the currently selected point.
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

dynamicZoomOnShapeSelect(value) → {Boolean}

When true, auto-pans-and-zooms the map to fit the currently selected shape's bounds.
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

executeDynamicRadialSelection()

Triggers radial selection

filteredLayersSourceData() → {Array}

The map filters down the layersSourceData based on layer selections. This property contains those filtered values and is refreshed automatically each time a layer is selected.
Returns:
Type
Array

filterLayerByBottomNLayerData(layerIx, numData)

Filters what's displayed in the layer by showing the specified number of layer objects with the lowest values.
Parameters:
Name Type Description
layerIx number
numData number number of results limit

filterLayerByTopNLayerData(layerIx, numData)

Filters what's displayed in the layer by showing the specified number of layer objects with the highest values.
Parameters:
Name Type Description
layerIx number
numData number number of results limit

getAllMarkerLayers() → {Array}

Get Array of all marker layers
Returns:
Type
Array

getAreaOfViewportInMeters() → {number}

Returns:
Type
number

getAuthKey() → {String}

Get your CMaps Authentication key
Returns:
Type
String

getBaseMap() → {Object}

Returns whatever base map is in-use.
Returns:
baseMap
Type
Object

getBaseMapOverlayTarget() → {Object}

Returns a reference to the base overlay class' dom target.
Returns:
Type
Object

getBottomNLayerData(layerIx, numData, onlyVisible) → {Object}

Returns an array of objects of filtered layer metadata.
Parameters:
Name Type Description
layerIx number
numData number number of results limit
onlyVisible Boolean
Returns:
Type
Object

getCustomBaseMapOverlay() → {Object}

Returns a reference to the base class.
Returns:
Type
Object

getDirectionsRawResponse(csvLocsForDirs) → {Array}

Use this if you just want the raw response straight from the map provider
Parameters:
Name Type Description
csvLocsForDirs Array of String values
Returns:
Type
Array

getDirectionsRenderer() → {Object}

Returns directions renderer (if any) from the map provider
Returns:
Type
Object

getDirectionsUrl(csvLocsForDirs) → {Array}

Returns a formatted directions url straight from the map provider
Parameters:
Name Type Description
csvLocsForDirs Array of String values
Returns:
Type
Array

getDistBetweenLocationsInMeters(csvLatLngs) → {number}

Returns straight-line distance between any number of locations
Parameters:
Name Type Description
csvLatLngs array of lat,lng strings
Returns:
Type
number

getDivId() → {string}

The map's div id
Returns:
Type
string

getDriveDistBetweenLocationsInMeters(csvLatLngs) → {number}

Returns drive distance between any number of locations
Parameters:
Name Type Description
csvLatLngs array of lat,lng strings
callback(centigon.mapping.TravelResponse) Object The callback that handles the response.
Returns:
Type
number

getHeight() → {number}

The map's div height
Returns:
Type
number

getIndicesWhereLocsInSelectedShape(locs) → {array}

Cycles through the locs parameter and if a given csv lat,lng is contained in the currently selected shape, adds that given location index to the return array.
Parameters:
Name Type Description
locs array of lat,lng strings
Returns:
of object indices
Type
array

getLayerAlertColors(layerIx, layerDataValues) → {Array}

Gets an array of alert colors for the layer
Parameters:
Name Type Description
layerIx number
layerDataValues Array
Returns:
Type
Array

getLayerAt(layerIndex) → {Object}

Gets the layer at the specified index
Parameters:
Name Type Description
layerIndex Number
Returns:
Type
Object

getLayerChoroplethLevels(layerIx, maxNumLevels) → {Array}

Gets an array of value levels for the layer
Parameters:
Name Type Description
layerIx number
maxNumLevels number
Returns:
Type
Array

getLayerConfig(layerIx, suppressApplyLayerCfg) → {Object}

Get a copy of the layer's entire configuration, and optionally suppress it being applied.
Parameters:
Name Type Description
layerIx number
suppressApplyLayerCfg Boolean if true the layer doesn't get refreshed
Returns:
Type
Object

getLayers() → {Array}

Gets all layers
Returns:
Type
Array

getPropertyValues(vals, layerIndex) → {Array}

Returns an array of data based on the vals passed in. If the layer is using a shape data provider & dbfKeys/userShapeKeys the return array will be ordered accordingly, otheriwse it just gives you back whatever you passed in originally. Vals can be any given array, layerIndex is position.
Parameters:
Name Type Description
vals Array
layerIndex Number
Returns:
Type
Array

getSafeColorCode(clr) → {String}

Returns a safe-to-use color code
Parameters:
Name Type Description
clr String supports most color formats, e.g. "#000000" or "c0c0c0" or "0xffffff"
Returns:
Type
String

getShapeLayerBounds(layer) → {Array}

Get a given shape layer's bounds.
Parameters:
Name Type Description
layer Object centigon.mapping.Layer
Returns:
Type
Array

getTopNLayerData(layerIx, numData, onlyVisible) → {Object}

Returns an array of objects of filtered layer metadata.
Parameters:
Name Type Description
layerIx number
numData number number of results limit
onlyVisible Boolean
Returns:
Type
Object

getWidth() → {number}

The map's div width
Returns:
Type
number

glowColor(value) → {String}

Controls the color of the glow effect on selected layer objects
Parameters:
Name Type Description
value String e.g. "#0000FF"
Returns:
Type
String

glowTransparency(value) → {Number}

Controls the transparency of the glow effect on selected layer objects
Parameters:
Name Type Description
value Number between 0 and 1
Returns:
Type
Number

googlePremierLicenseKey(value)

OPTIONAL - Set your Google Premier key - must be set before the "key" property.
Parameters:
Name Type Description
value String

hasCapability(String) → {boolean}

Check for a capability, like streetview, geocoding, directions, etc.
Parameters:
Name Type Description
String centigon.mapping.MapApiAdapter.CAPABILITY_NAMES
Returns:
Type
boolean

heatmapGradients(value) → {Array}

Array of String values that need to equal the number of layers present, that are used to determine heatmap gradient styles.
Parameters:
Name Type Description
value Array e.g. [centigon.mapping.HeatmapOptions.GRADIENTS.THERMAL, centigon.mapping.HeatmapOptions.GRADIENTS.RAINBOW]
Returns:
Type
Array

heatmapIntensity(value) → {Array}

Array of numeric values that need to equal the number of layers present, that are used to determine heatmap layer intensity multiplier.
Parameters:
Name Type Description
value Array
Returns:
Type
Array

hideAdvancedInfowindow()

Hides the advanced info window.

hideIndoorMapsList()

Hide list of any indoor SVG hyperlinks

hideLayer(layer)

Hides the given layer
Parameters:
Name Type Description
layer Object centigon.mapping.Layer

indoorEnabled(value) → {Boolean}

Determines the enabled state of the indoor map viewer
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

infoLogOpts(opts)

Useful configuration for how you want the map to log info. Param like
Parameters:
Name Type Description
opts object { "serviceParamName": "Log", "serviceOpName": "Log", "serviceUrl": "http://localhost:4118/WebService.asmx", "loggingMode": "soap", //centigon.util.Logger.INFO_LOG_MODE (LOG_ONLY_ERRORS, LOG_ONLY_INFO, LOG_ALL, LOG_NONE) "showAlerts": "false", "destination": "" //centigon.util.Logger.DESTINATION (NONE, SOAP, SIMPLE_AJAX, WEB_CONSOLE) }

infoWindowFontAlign(value) → {String}

Parameters:
Name Type Description
value String e.g. "left", "right", "center"
Returns:
Type
String

infoWindowFontColor(value) → {String}

Parameters:
Name Type Description
value String e.g. "#FFFFFF"
Returns:
Type
String

infoWindowFontFamily(fam) → {String}

Parameters:
Name Type Description
fam String
Returns:
Type
String

infoWindowFontSize(value) → {Number}

Parameters:
Name Type Description
value Number
Returns:
Type
Number

infoWindowLabelRange(value) → {Array}

Can be used to override the way infowindow content is displayed
Parameters:
Name Type Description
value Array Array of strings that the infowindows will use as their content
Returns:
Type
Array

infoWindowLayerNamesVisible(value) → {Boolean}

Determines if a selected layer's name is displayed in the info window
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

infoWindowLayerValuesVisible(value) → {Boolean}

Determines if a selected location's value is displayed in the InfoWindow
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

infoWindowsVisible(value) → {Boolean}

Determines the visibility of Info Windows.
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

infoWindowUseBoldFont(value) → {Boolean}

Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

infoWindowUseFontUnderline(value) → {Boolean}

Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

infoWindowUseItalicFont(value) → {Boolean}

Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

isCurrentlyInMultiselectMode() → {Boolean}

Returns true if any sort of multi select is being used
Returns:
Type
Boolean

isLocInShape(shpObj, csvLatLng) → {boolean}

Tests if the lat,lng is in the given shape.
Parameters:
Name Type Description
shpObj object displayObject from a shape layer
csvLatLng string lat,lng
Returns:
Type
boolean

isShapeDataProvider(type) → {Boolean}

Returns true if the type is powered by an external shape provider
Parameters:
Name Type Description
type String centigon.locationIntelligence.CMapAnalytics.DATA_PROVIDERS
Returns:
Type
Boolean

key(value)

Set your CMaps Authentication key - MUST be set in order for map to work.
Parameters:
Name Type Description
value String

labelFilters(value) → {Array}

Filters what's displayed in all map layers. One String in the Array per layer, uses partial matching.
Parameters:
Name Type Description
value Array of Strings
Returns:
Type
Array

labels(value) → {Array}

Determines the labels for every location to be plotted for all layers
Parameters:
Name Type Description
value Array 2D Array of Strings e.g. [["Layer 1 Point 1", "Layer 1 Point 2"],["Layer 2 Point 1", "Layer 2 Point 2"]]
Returns:
Type
Array

lassoSelectionMode(mode) → {String}

Sets the selection mode to be used by the lasso selector. Allows the user to click and drag (freeform) or to click (N-number of times) to set polygon boundary points
Parameters:
Name Type Description
mode String e.g. centigon.mapping.SelectorPanel.SelectionTypes.FREEFORM_LASSO or centigon.mapping.SelectorPanel.SelectionTypes.CLICK_LASSO
Returns:
Type
String

layerAlertIconsEnabled(layerIx) → {Boolean}

Check if a layer is alert-icon-auto-switching-enabled
Parameters:
Name Type Description
layerIx number
Returns:
Type
Boolean

layerAlertsEnabled(layerIx) → {Boolean}

Check if a layer is alert-enabled
Parameters:
Name Type Description
layerIx number
Returns:
Type
Boolean

layerDrillEnabled(lyr) → {Boolean}

Assigns an optional drill level to map layers.
Parameters:
Name Type Description
lyr Object centigon.mapping.Layer
Returns:
Type
Boolean

layerDynamicSizeEnabled(layerIx) → {Boolean}

Check if a layer is dynamic size enabled
Parameters:
Name Type Description
layerIx number
Returns:
Type
Boolean

layerHasTimeData(lyr) → {Boolean}

Checks if layer has any valid times
Parameters:
Name Type Description
lyr Object centigon.mapping.Layer
Returns:
Type
Boolean

layerNames(value) → {Array}

Determines each layer's display name
Parameters:
Name Type Description
value Array of String values. e.g. ["My Points Layer","My Shapes Layer"]
Returns:
Type
Array

layerOptions(value) → {Array}

Gets/Sets the various layer-specific properties
Parameters:
Name Type Description
value Array 2D Array of Object values that need to equal the number of layers present.
Returns:
Type
Array

layersDataDestinationOutputRanges() → {Array}

Get 2D Array of Selected "position", "label", "value", "row", "column" values, 1 Array per layer
Returns:
Type
Array

layersDynamicSizeEnabled(value) → {Array}

Gets/Sets enabling dynamic sizing for each layer
Parameters:
Name Type Description
value Array of Booleans
Returns:
Type
Array

layersFilteredSourceDataTypes(value)

Gets/Sets the data filter types to be used for each layer
Parameters:
Name Type Description
value Array of filter types, e.g. "position", "label", "value", "row", "column"

layersIconKeys(value) → {Array}

Enables a single layer to display mutlpiple icon types.
Parameters:
Name Type Description
value Array 2D Array of String values that need to equal the number of layers present. e.g. [[centigon.mapping.MarkerIconFactory.ICONS.PIN, centigon.mapping.MarkerIconFactory.ICONS.CYLINDER],[centigon.mapping.MarkerIconFactory.ICONS.DIAMOND, centigon.mapping.MarkerIconFactory.ICONS.DOLLAR]]
Returns:
Type
Array

layersLogScaleEnabled(value) → {Array}

Gets/Sets if a log scale is to be used to determine marker icon sizes for points layers.
Parameters:
Name Type Description
value Array of Booleans
Returns:
Type
Array

layersMouseEnabled(value) → {Array}

Gets/Sets the mouse-enabled to be used for each layer
Parameters:
Name Type Description
value Array of Booleans, (0-1, where 0 is transparent and 1 is opaque), e.g [0, .25, .5, .75, 1]
Returns:
Type
Array

layersObjectsVisibility(value) → {Array}

Gets/Sets the visibility for each layer's objects
Parameters:
Name Type Description
value Array 2D array of Booleans where each child-level array represents a layer's object's visibility list.
Returns:
Type
Array

layersSourceData(value) → {Array}

A convenient property that you can provide with arbitrary data, that the map will in turn filter down (filteredLayersSourceData) based on layer selections.
Parameters:
Name Type Description
value Array 2D Array of arbitrary values where each child array holds the pieces of data that correspond to the layer's objects
Returns:
Type
Array

layersTransparency(value)

Gets/Sets the transparency to be used for each layer
Parameters:
Name Type Description
value Array of Numbers, (0-1, where 0 is transparent and 1 is opaque), e.g [0, .25, .5, .75, 1]

layersVisible(value) → {Array}

Array of Boolean values that determine layer visibility
Parameters:
Name Type Description
value Array
Returns:
Type
Array

layerTypeIsMarker(type) → {Boolean}

Returns true if the type is a marker layer
Parameters:
Name Type Description
type String centigon.locationIntelligence.CMapAnalytics.DATA_PROVIDERS
Returns:
Type
Boolean

layerTypes(value) → {Array}

Array of String values that need to equal the number of layers present, that are used to determine a layer's type.
Parameters:
Name Type Description
value Array e.g. [centigon.mapping.Layer.TYPE.SHAPE, centigon.mapping.Layer.TYPE.MARKER]
Returns:
Type
Array

legendVisible(value) → {Boolean}

Controls legend visiblity
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

locations(value) → {Array}

Determines the locations to be plotted for all layers. 2D Array of String values that need to equal the number of layers present, that are used to populate all layers with their locations to plot. Addresses, lat,lng Strings and shapefile URL's are allowed. e.g. for a points layer and a shape layer [["san diego", "los angeles", "32.777865,-117.119752"],["http://[url]/myShapes.shp"]]
Parameters:
Name Type Description
value Array 2D Array of Strings
Returns:
Type
Array

maxCountFilters(value) → {Array}

Filters what's displayed in all map layers. One Number in the Array per layer that dictates how many objects get shown
Parameters:
Name Type Description
value Array of Numbers
Returns:
Type
Array

maxCountSortType(value) → {Array}

Filters what's displayed in all map layers by low or high.
Parameters:
Name Type Description
value Array of Strings. Acceptable values are descending or ascending (default).
Returns:
Type
Array

maxValueFilters(value) → {Array}

Filters what's displayed in all map layers. One Number in the Array per layer
Parameters:
Name Type Description
value Array Array of Numbers
Returns:
Type
Array

measureNames(value) → {Array}

Measure name(s) per-layer.
Parameters:
Name Type Description
value Array 2D Array of Strings e.g. [["lyr 1 measure 1", "lyr 1 measure 2"],["lyr 2 measure 1", "lyr 2 measure 2"]]
Returns:
Type
Array

metersToKm(meters) → {number}

Parameters:
Name Type Description
meters number
Returns:
Type
number

metersToMiles(meters) → {number}

Parameters:
Name Type Description
meters number
Returns:
Type
number

minValueFilters(value) → {Array}

Filters what's displayed in all map layers. One Number in the Array per layer
Parameters:
Name Type Description
value Array Array of Numbers
Returns:
Type
Array
Controls nav control visiblity
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

onCenterChanged()

Callback function - Fires when the map's center changes

onCurrentLocationChanged()

Callback function - Fires when the map's user's current device location changes

onDirectionsRawResponse(rsp)

Callback function - Fires when a geocode response is received
Parameters:
Name Type Description
rsp Object Raw response from whatever underlying api served the directions. Useful if you need to get at a response property that we don't normally provide access to via our centigon.mapping.DirectionsResponse class.

onDirectionsResponse(rsp)

Callback function - Fires when a directions response is received
Parameters:
Name Type Description
rsp Object centigon.mapping.DirectionsResponse

onDrill(selectedLayer, layersInDrillPath)

Callback function - Fired when drilling down or up
Parameters:
Name Type Description
selectedLayer Object centigon.mapping.Layer
layersInDrillPath Array of centigon.mapping.Layer's currently participating in some way, in this drill

onGeocodeResponse(rsp)

Callback function - Fires when a geocode response is received
Parameters:
Name Type Description
rsp Object centigon.mapping.GeocodeResponse

onInfoWindowClosed(layer, ix)

Callback function - Fires whenever a regular map infowindow closes
Parameters:
Name Type Description
layer Object centigon.mapping.Layer
ix Number layer child selected index

onInfoWindowOpened(layer, ix)

Callback function - Fires whenever a regular map infowindow opens
Parameters:
Name Type Description
layer Object centigon.mapping.Layer
ix Number layer child selected index

onLayerMoused(layer)

Callback function - Fires whenever a layer has been moused over
Parameters:
Name Type Description
layer Object centigon.mapping.Layer

onLayerSelected(layer)

Callback function - Fires whenever a layer has been selected
Parameters:
Name Type Description
layer Object centigon.mapping.Layer

onLayersReady()

Callback function - Fired once the map layers have been initialized. This happens anytime resetMap() is used or any other time the layers are initially created.

onMapReady()

Callback function - Fired when once the map has been initialized, this only happens once.

onZoomChanged()

Callback function - Fires when the map's zoom level changes

options(options) → {Object}

Can be used to set any public map properties via a JSON object where each object key name/value corresponds to the documented map property.
Parameters:
Name Type Description
options Object centigon.locationIntelligence.MapViewOptions
Returns:
Type
Object

panZoomTo(val)

Sets viewport to the given location
Parameters:
Name Type Description
val String lat,lng or address

parseConfig(cfg)

Creates map based on output from CMapsAnalytics Designer
Parameters:
Name Type Description
cfg Object | String A JSON/XML String or an Object with a "url", e.g. {"url":"http://somewhere.com/mymap.json"} property, to load a remote map config file.

polyDataSources(value) → {Array}

Array of String values that need to equal the number of layers present, that are used to determine a poly layer's data source type.
Parameters:
Name Type Description
value Array e.g. ["","",centigon.locationIntelligence.CMapAnalytics.DATA_PROVIDERS.SHAPE_DATAPROVIDER]
Returns:
Type
Array

polyOutlineColors(value) → {Array}

Gets/Sets the outline colors that are to be used for poly layers.
Parameters:
Name Type Description
value Array of Strings, e.g. for 4 layers ["#000000","#00FF00","#0000FF","#FF0000"]
Returns:
Type
Array

polyOutlinesEnabled(value) → {Array}

Gets/Sets if outlines are to be used for poly layers.
Parameters:
Name Type Description
value Array of Booleans
Returns:
Type
Array

pxHeight(height) → {number}

Get/Set the map's div height
Parameters:
Name Type Description
height number
Fires:
  • event:resizeMap
Returns:
Type
number

pxWidth(width) → {number}

Get/Set the map's div width
Parameters:
Name Type Description
width number
Fires:
  • event:resizeMap
Returns:
Type
number

radiusCenterPoint(value) → {String}

Sets the center point to be used by the radius selector.
Parameters:
Name Type Description
value String e.g. '32.777865,-117.119752'
Returns:
Type
String

radiusMeasureUnit(value) → {String}

Sets the radius selector to use Miles or Kilometers as the distance measure. Used in conjunction with the "radiusValue" property.
Parameters:
Name Type Description
value String e.g. "mi" or "km"
Returns:
Type
String

radiusSelectionMode(mode) → {String}

Sets the selection mode to be used by the radius selector. Allows the user to click and drag (freeform) or to click (preset)
Parameters:
Name Type Description
mode String e.g. centigon.mapping.SelectorPanel.SelectionTypes.FREEFORM_RADIUS or centigon.mapping.SelectorPanel.SelectionTypes.PRESET_RADIUS
Returns:
Type
String

radiusValue(value) → {Number}

Gets/Sets the distance that the radius selection should cover. Used in conjunction with the "radiusMeasureUnit" property.
Parameters:
Name Type Description
value Number
Returns:
Type
Number

redrawAllLayers()

Forces an update of all map layers.

redrawAllMarkerLayers()

Forces redraws on all marker layers

refreshAllLayers()

Forces refresh of all layers

refreshAllMarkerLayers()

Forces refresh of all marker layers

registerCustomLayer()

Puts the specified custom layer on the map.

registerMarkerRenderer(customRenderer) → {Array}

Define a custom marker renderer with a name and a render callback. *MANDATORY - prefix your name with "custom:", e.g. "custom:pink_squares".
Parameters:
Name Type Description
customRenderer Object e.g. {name:"hello world", render:function(renderObj){}}
Returns:
Type
Array

removeAllLayers()

Removes all layers from the map

removeLayer(lyrIx)

Remove layer from map at given layer ix
Parameters:
Name Type Description
lyrIx Number

resetMap()

Removes all layers from the map and resets all map data properties, e.g. labels, values, locations, dbfKeys, etc

reverseGeocode(strLatLng)

Reverse geocodes a lat,lng String
Parameters:
Name Type Description
strLatLng String e.g. '32.777865,-117.119752'

reverseGeocodeResult() → {Array}

Returns the array of address parts from the last reverse geocode request
Returns:
of Strings
Type
Array

selectedItem(value) → {String}

String csv value of layer index, marker/shape index. e.g. "1,1" selects layer 1, location1. "-1" clears all selections.
Parameters:
Name Type Description
value String
Returns:
Type
String

selectedLayerName() → {String}

Get last selected layer name
Returns:
Type
String

selectedPolygonOuterRingLocations(value)

Changes whenever a shape is selected, Returns the outer ring boundary of the last selected polygon, if using the selector panel's polygon selector.
Parameters:
Name Type Description
value Array of lat,lng's

setAdvancedInfowindowOptions(advancedInfoWindowOpts)

Sets the advanced info window's options
Parameters:
Name Type Description
advancedInfoWindowOpts Object centigon.ui.AdvancedInfoWindowOptions

setMapViewport(csvLatLngs)

Sets viewport to the given array of csv lat,lngs
Parameters:
Name Type Description
csvLatLngs Array

setMapViewportBasedOnLocations(locs)

Sets viewport to the given array of locations
Parameters:
Name Type Description
locs Array of centigon.mapping.Location

showAdvancedInfowindow()

Shows the advanced info window.

showGlow(value) → {Boolean}

Controls glow effect visibility
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

showIndoorMapsList()

Show a list of any indoor SVG hyperlinks

showInfoWindowsOn(value) → {String}

Gets/sets the event that triggers the display of InfoWindows
Parameters:
Name Type Description
value String centigon.mapping.CMap.INFO_WINDOW_SELECTION_MODES
Returns:
Type
String

showLayer(layer)

Shows the given layer
Parameters:
Name Type Description
layer Object centigon.mapping.Layer

sqMetersToKm(meters) → {number}

Parameters:
Name Type Description
meters number
Returns:
Type
number

sqMetersToMiles(meters) → {number}

Parameters:
Name Type Description
meters number
Returns:
Type
number

sslEnabled(value) → {Boolean}

Determines if the map api is loaded over SSL.
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

timeFilters(value) → {Array}

Filters what's displayed in all map layers. One filter in the Array per layer
Parameters:
Name Type Description
value Array Array of Objects with "min" and "max" date properties e.g. {min:myStartJSDateVar, max:myEndJSDateVar}
Returns:
Type
Array

times(value) → {Array}

Determines the time for every location to be plotted for all layers
Parameters:
Name Type Description
value Array 2D Array of Strings
Returns:
Type
Array

toggleAdvancedInfowindow()

Toggles the advanced info window's visibility.

toggleIndoorMap()

Toggles the svg's visibility.

toggleSpecialApiLayer(layerType, enabled)

Allows the toggling of any special API layer.
Parameters:
Name Type Description
layerType String "bike", "traffic" and "transit" are valid values.
enabled Boolean true adds the layer while false removes the layer

toLowercaseAllElementsIn2DArray(value) → {Array}

Goes through all elements in 2DArray and returns a cloned array of lowercase values.
Parameters:
Name Type Description
value Array
Returns:
Type
Array

toNumberAllElementsIn2DArray(value) → {Array}

Goes through all elements in 2DArray and returns a cloned array of numeric values.
Parameters:
Name Type Description
value Array
Returns:
Type
Array

toStringAllElementsIn2DArray(value) → {Array}

Goes through all elements in 2DArray and returns a cloned array of string values.
Parameters:
Name Type Description
value Array
Returns:
Type
Array

transparentFillEnabled(value) → {Array}

Gets/Sets if fills are to be used for poly layers.
Parameters:
Name Type Description
value Array of Booleans
Returns:
Type
Array

triggerLayerChildClick(lyrIx, childIx)

Programmatically trigger a click on a given layer's object
Parameters:
Name Type Description
lyrIx Number
childIx Number

triggerMapResize()

Forces the map to redraw and resize itself.

useAdvancedInfowindow(val) → {Boolean}

Gets/Sets the advanced info window's enabled state.
Parameters:
Name Type Description
val Boolean
Returns:
Type
Boolean

useLasso(value) → {Boolean}

A programmatic shortcut (bypasses the need for the user to choose the lasso tool from the selector panel) to put the user into lasso selection mode
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

useRadius(value) → {Boolean}

A programmatic shortcut (bypasses the need for the user to choose the lasso tool from the selector panel) to put the user into radius selection mode
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

userShapeKeys(value) → {Array}

2D Array of String values that are used in conjunction with "dbfKeys" to map data values to, and control the visibility of, shape layer objects. The userShapeKeys property will contain a distinct range of values used to match the DBF Keys. During runtime, the map will evaluate the userShapeKeys and search for a matching DBF key. When the userShapeKeys matches the DBF Key, the corresponding shapes will display in in the map. Otherwise the shapes are NOT displayed. The userShapeKeys will define the data order for other map properties including:

Address/Long,Lat
Labels
Values
Selector Source Data
Selector Position
Colors (alerts tab)
Alerts Targets (when using % alerts)
For example, if a shapefile contained 2 states, California and Denver, in that order, but the order of my values property data is the reverse order(Denver, California), the userShapeKeys, dbfKeys and values would look like this:

userShapeKeys([["Denver", California"]]);
dbfKeys([["California", "Denver"]]);
values([[10,20]]);

which would result in the value 10 being associated with Denver and 20 with California.
Parameters:
Name Type Description
value Array 2D Array of Strings
Returns:
Type
Array

values(value) → {Array}

Allows layer(s) to have multiple measures. One measure can be displayed at a time, and the active measure will be used to populate the given layer(s) "values" property.
Parameters:
Name Type Description
value Array 2D Array of Numbers e.g. [[1,2,3.5],[1500,2500,1800]]
Returns:
Type
Array

values(value) → {Array}

Gets/Sets the data value associated with every object on every layer.
Parameters:
Name Type Description
value Array 2D Array of Numbers e.g. [[1,2,3.5],[1500,2500,1800]]
Returns:
Type
Array

visible(value) → {Boolean}

A Boolean value that controls map visibility
Parameters:
Name Type Description
value Boolean
Returns:
Type
Boolean

xPos(x) → {number}

Get/Set the map's x position
Parameters:
Name Type Description
x number
Fires:
  • event:resizeMap
Returns:
Type
number

yPos(y) → {number}

Get/Set the map's y position
Parameters:
Name Type Description
y number
Fires:
  • event:resizeMap
Returns:
Type
number

zoomLevel(value) → {Number}

Gets/Sets the map zoom level
Parameters:
Name Type Description
value Number
Returns:
Type
Number