The aegir core namespace contains all of the functions for loading and displaying
your venue map, as well as basic interactions.
Namespaces
Members
(static) EVENTS :object
Constants for dispatched events
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
WILL_ZOOM |
string | event fired before the map changes zoom level |
DID_ZOOM |
string | event fired after the map has changed zoom level |
DID_SELECT_UNIT |
string | event fired when a map unit is clicked |
DID_SELECT_ANNOTATION |
string | event fired when a map annotation is clicked |
DID_CHANGE_CAMERA_POSITION |
string | event fired when the map's camera changes |
DID_SELECT_ANNOTATION_POPUP |
string | event fired when annotation popups are clicked |
DID_OPEN_ANNOTATION_POPUP |
string | event fired when annotation popup is displayed |
- Since:
- 1.2; Added DID_SELECT_ANNOTATION_POPUP and DID_OPEN_ANNOTATION_POPUP in 1.2.2
Methods
(static) addAnnotation(annotation)
Add annotation to map
Parameters:
Name | Type | Description |
---|---|---|
annotation |
vmPointAnnotation | the annotation options |
- Since:
- 1.2
(static) ajax(url, options, onSuccess, onFailure)
Simple replacement for jquery's $.ajax fn. This implementation is not full-featured.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | the endpoint for the ajax call |
options |
ajaxConfig | configuration options |
onSuccess |
onCompleteCallback | handler for succesful ajax calls |
onFailure |
onCompleteCallback | handler for failed ajax calls |
- Since:
- 1.2
(static) centerMap(lng, lat, params)
Center the map on a set of coordinates
Parameters:
Name | Type | Description |
---|---|---|
lng |
number | the longitude |
lat |
number | the latitude |
params |
object | the function to call when map has finished centering |
(static) changeFloors(floors)
Handles automatically hiding and showing floors.
Parameters:
Name | Type | Description |
---|---|---|
floors |
Array.<string> | the list of ids for floors to change |
- Since:
- 1.2
(static) changeFloors(indoorFloors, outdoorFloors)
Handles automatically hiding and showing floors.
Parameters:
Name | Type | Description |
---|---|---|
indoorFloors |
Array.<string> | the list of ids for floors indoor floors to change |
outdoorFloors |
Array.<string> | the list of ids for floors outdoor floors to change |
- Since:
- 1.3
(static) coordFinderById(wpId) → (nullable) {object}
Get the geojson geometry information associated with a given feature
Parameters:
Name | Type | Description |
---|---|---|
wpId |
string | the feature id of the item to search for |
Returns:
the geojson object with the given feature id, or null
- Type
- object
(static) createStyleObjs()
Initializes map styles
(static) each(list, iterator)
Simple replacement for jquery's $.each fn. This implementation is not full-featured.
Parameters:
Name | Type | Description |
---|---|---|
list |
object | the list to iterate, or if an object, iterates over object properties |
iterator |
itemIteratorFunction | callback to call on each iteration |
- Since:
- 1.2
(static) error(error)
Log errors to the console
Parameters:
Name | Type | Description |
---|---|---|
error |
String | the message to log |
(static) findFloorObjForFloorId(floorId) → (nullable) {vmMapBuildingFloor}
Find floor with id in the venue, either indoors or outdoors
Parameters:
Name | Type | Description |
---|---|---|
floorId |
string | the id of the floor to search for |
Returns:
the matched floor, or null
- Type
- vmMapBuildingFloor
(static) findFloorWithId(floorId) → {vmMapBuildingFloor}
Search for indoor floors in any building
Parameters:
Name | Type | Description |
---|---|---|
floorId |
string | the unique id for the floor you are searching for |
- Since:
- 1.2
Returns:
the matched floor, or null if not found
- Type
- vmMapBuildingFloor
(static) findOutdoorFloorWithId(floorId) → {vmMapBuildingFloor}
Search for outdoor floors in any building
Parameters:
Name | Type | Description |
---|---|---|
floorId |
string | the unique id for the floor you are searching for |
- Since:
- 1.2
Returns:
the matched floor, or null if not found
- Type
- vmMapBuildingFloor
(static) floorListener(floors)
Handles automatically hiding and showing floors when added to an event. The floorIds are an array of the ids of the floors the event is tied to.
Parameters:
Name | Type | Description |
---|---|---|
floors |
Array.<string> | the list of ids for floors to change |
- Deprecated:
- since version 1.2. Use aegir.changeFloors() instead.
(static) getConfig() → {object}
Get current configuration
- Since:
- 1.2
Returns:
active configuration settings
- Type
- object
(static) getCoordinateCenterById(featureId) → {location}
Get the lat/lng location for the center of a geojson FEATURE
Parameters:
Name | Type | Description |
---|---|---|
featureId |
string | the id of the geojson FEATURE |
Returns:
- Type
- location
(static) getCurrentFloors() → {Array.<vmMapBuildingFloor>}
Get the list of currently active indoor floors
Returns:
list of floors
- Type
- Array.<vmMapBuildingFloor>
(static) getCurrentOutdoorFloors() → {Array.<vmMapBuildingFloor>}
Get the list of currently active outdoor floors
Returns:
list of floors
- Type
- Array.<vmMapBuildingFloor>
(static) getDebug() → {vmDebugConfig}
Get debug settings
- Since:
- 1.2
Returns:
debug settings
- Type
- vmDebugConfig
(static) getDefaults() → {object}
Get default configuration settings
Returns:
default settings
- Type
- object
(static) getFloors() → {Array.<vmMapBuildingFloor>}
List of floors for the venue
- Deprecated:
- since version 1.2. You should get floors from each building object instead.
Returns:
the list of floors in the venue, not separated by building
- Type
- Array.<vmMapBuildingFloor>
(static) getLayers()
Get map layers
Returns:
map layers
(static) getMap() → {object}
Get mapbox map instance
- Since:
- 1.2
Returns:
mapbox map
- Type
- object
(static) getOutdoorBuildings() → {Array.<vmMapBuilding>}
List of outdoor buildings for the venue
- Since:
- 1.2
Returns:
the list of outdoor floors in the venue
- Type
- Array.<vmMapBuilding>
(static) getUnits() → {Array.<vmMapUnit>}
List of units for the venue
- Deprecated:
- since version 1.2. You should get units from each floor object instead.
Returns:
the list of units in the venue, not separated by floor or building
- Type
- Array.<vmMapUnit>
(static) grep(items, matcher) → {Array.<object>}
Simple replacement for jquery's $.grep fn. This implementation is not full-featured.
Parameters:
Name | Type | Description |
---|---|---|
items |
Array.<object> | the list to search for |
matcher |
matchingFunction | the function to test for matches |
- Since:
- 1.2
Returns:
list of items that were matched
- Type
- Array.<object>
(static) hideLayers(selectedFloors)
Hide map layers associated with specific map floors
Parameters:
Name | Type | Description |
---|---|---|
selectedFloors |
Array.<string> | list of ids for floors to hide |
- Deprecated:
- since version 1.2. There is no replacement.
(static) inArray(needle, haystack) → {number}
Simple replacement for jquery's $.inArray fn. This implementation is not full-featured.
Parameters:
Name | Type | Description |
---|---|---|
needle |
object | the object being searched for |
haystack |
Array | the array to look |
- Since:
- 1.2
Returns:
if found, the index of the item in the array, else -1
- Type
- number
(static) initialLoad(callback)
Initial mapbox setup
Parameters:
Name | Type | Description |
---|---|---|
callback |
onCompleteCallback | the callback when everything is complete |
- Deprecated:
- since version 1.2. There is no replacement.
(static) loadAddBuildingOutlines(layerId, outlineLayerId, layerVisibility, filterParam, fillColor)
Parameters:
Name | Type | Description |
---|---|---|
layerId |
string | the name of the new layer to add |
outlineLayerId |
string | the name of the corresponding outline layer |
layerVisibility |
string | the visibility of the layer |
filterParam |
string | the filters for the layer |
fillColor |
string | the fill color for the layer |
- Deprecated:
- since version 1.2. There is no replacement.
(static) loadBldOutline(callback)
Load Building Outline Layers
Parameters:
Name | Type | Description |
---|---|---|
callback |
onCompleteCallback | callback when loading is complete |
- Deprecated:
- since version 1.2. There is no replacement.
(static) loadCommonBuildingLayers(buildingObj)
Loads map layers for common vector/reaster building features
Parameters:
Name | Type | Description |
---|---|---|
buildingObj |
vmMapBuilding | the object wth the building properties |
- Deprecated:
- since 1.2. There is no replacement.
(static) loadCommonLayers(floorId)
Load label/icon map layers for a particular floor
Parameters:
Name | Type | Description |
---|---|---|
floorId |
string | the id of the floor |
- Deprecated:
- since 1.2. There is no replacement.
(async, static) loadData(xml, geoJSON, params, callback)
Load venue map data
Parameters:
Name | Type | Description |
---|---|---|
xml |
string | Path to the VMD's xml file |
geoJSON |
string | Path to the VMD's geojson file |
params |
mapDataLoadConfig | settings |
callback |
onCompleteCallback | callback when loading is Complete |
- Deprecated:
- since version 1.2. Use aegir.loadVenueMapData() instead.
(static) loadGlobalLayers(callback)
Load global map Layers
Parameters:
Name | Type | Description |
---|---|---|
callback |
onCompleteCallback | callback when loading is completed |
- Deprecated:
- since version 1.2. There is no replacement.
(async, static) loadJSON(jsonUrl, callback)
Load json file
Parameters:
Name | Type | Description |
---|---|---|
jsonUrl |
string | Path to the json file |
callback |
onCompleteCallback | callback for completion |
- Deprecated:
- since version 1.2. There is no replacement.
(static) loadLayers(floorId)
Load map layers for a particular floor
Parameters:
Name | Type | Description |
---|---|---|
floorId |
string | the id of the floor to show |
- Deprecated:
- since version 1.2. There is no replacement.
(static) loadMap(loadOptions, lat, lng, onComplete)
Loads the map view, initialized at the given lat/lng
Parameters:
Name | Type | Description |
---|---|---|
loadOptions |
mapViewLoadConfig | mapview configuration |
lat |
Number | The latitude to initialize the mapview with |
lng |
Number | The longintude to initialize the mapview with |
onComplete |
onCompleteCallback | callback when loading is complete |
- Deprecated:
- Yes
(static) loadMapView(loadOptions, cameraConfig, callback)
Loads the map view, initialized at the given lat/lng
Parameters:
Name | Type | Description |
---|---|---|
loadOptions |
mapViewLoadConfig | mapview configuration |
cameraConfig |
mapViewCameraConfig | mapview camera initial configuration |
callback |
onCompleteCallback | callback when loading is complete |
(static) loadRasterBldOutline()
Load Building Outline Layers
- Deprecated:
- since version 1.2. There is no replacement.
(static) loadRasterVenueOutdoors(floorId)
Load outdoor raster layers
Parameters:
Name | Type | Description |
---|---|---|
floorId |
string | the id of the outdoor floor |
- Deprecated:
- since version 1.2. There is no replacement.
(static) loadVectorLayers(floorId)
Load shape map layers for a particular floor
Parameters:
Name | Type | Description |
---|---|---|
floorId |
string | the id of the floor |
- Deprecated:
- since 1.2. There is no replacement.
(async, static) loadVenueMapData(fileCollection, params, onComplete)
Load venue map data
Parameters:
Name | Type | Description |
---|---|---|
fileCollection |
vmdFileCollection | properties for file Loading |
params |
mapDataLoadConfig | settings |
onComplete |
onCompleteCallback | callback when loading is complete |
- Since:
- 1.2
(async, static) loadXML(xmlUrl, loadOptions, onComplete)
Load XML data file
Parameters:
Name | Type | Description |
---|---|---|
xmlUrl |
string | Path to the XML file |
loadOptions |
mapDataLoadConfig | settings |
onComplete |
onCompleteCallback | callback for completion |
- Deprecated:
- since version 1.2. There is no replacement.
(static) log(msg)
Log something
Parameters:
Name | Type | Description |
---|---|---|
msg |
String | the message to log |
(static) nodeFinderById(itemId) → (nullable) {object}
Get the geojson properties associated with a given feature
Parameters:
Name | Type | Description |
---|---|---|
itemId |
string | the feature id of the item to search for |
Returns:
the geojson object with the given feature id, or null
- Type
- object
(static) refreshBuildingLabelLayers()
Force refresh label& icon layers
- Deprecated:
- since 1.2. There is no replacement.
(static) removeAnnotation(annotation)
Remove an annotation from the map
Parameters:
Name | Type | Description |
---|---|---|
annotation |
vmPointAnnotation | the annotation options |
- Since:
- 1.2
(static) removeStyleForUnit(unit)
Parameters:
Name | Type | Description |
---|---|---|
unit |
vmMapUnit | the unit to remove the style from. Style will revert back to default style defined in json config. |
- Since:
- 1.2.1
(async, static) retrieveUnitData(xml, geoJsonUrl, params, callback)
Load venue map data
Parameters:
Name | Type | Description |
---|---|---|
xml |
string | Path to the VMD's xml file |
geoJsonUrl |
string | Path to the VMD's geojson file |
params |
mapDataLoadConfig | settings |
callback |
onCompleteCallback | callback when loading is Complete |
- Deprecated:
- since version 1.2
(static) selectionHandler(e)
Handle map selection for wayfinding
Parameters:
Name | Type | Description |
---|---|---|
e |
object | the selection event |
- Deprecated:
- since version 1.2. There is no replacement.
(static) setBackgroundAlpha()
set's the alpha on the map's background layer
- Since:
- 1.2
(static) setStyleForUnit(style, unit)
Parameters:
Name | Type | Description |
---|---|---|
style |
vmVenueLayerStyle | the new style for the unit |
unit |
vmMapUnit | the unit to apply the style to |
- Since:
- 1.2.1
(static) warn(warning)
Log warnings to the console
Parameters:
Name | Type | Description |
---|---|---|
warning |
String | the message to log |