\SwitchMap
Switches map service based on MapCore API.
Synopsis
class SwitchMap
{
- // constants
- const TABLE_SWITCHES = 'switches';
- // members
- protected $ubillingConfig = NULL;
- protected string $iconSwitchAlive = 'marker.blue';
- protected string $iconSwitchDead = 'marker.red';
- protected string $iconSwitchUnknown = 'marker.darkblue';
- protected $switchDb = '';
- protected $mapCore = '';
- protected array $clustringOptions = ;
- // methods
- public void __construct()
- protected void initDb()
- protected void initMapCore()
- protected array getAllSwitches()
- protected array getSwitchesWithGeo()
- protected array getSwitchesWithoutGeo()
- public void saveSwitchPlacement()
- public static bool isBriefMinimapEnabled()
- public static bool isLinkedSwitch()
- public static array getSwitchParents()
- public static bool isLoopAllowed()
- public array getLinkedSwitchIds()
- public void drawSwitchUplinks()
- public void drawLinkedSwitches()
- public void drawSwitchAllLinks()
- public void drawSwitches()
- public array getSwitchesMapObjects()
- public string getSwitchesPlacemarks()
- public string getLocationSwitchForm()
- public string getLocationFinder()
- public void renderMapContainer()
- public getMapCore()
- public void render()
- public string renderMiniMap()
Constants
| Name | Value |
|---|---|
| TABLE_SWITCHES | 'switches' |
Members
protected
- $clustringOptions
—
array
Default clustering options. - $iconSwitchAlive
—
string
Canonical icon key for alive switches. - $iconSwitchDead
—
string
Canonical icon key for dead switches. - $iconSwitchUnknown
—
string
Canonical icon key for NP/unknown switches. - $mapCore
—
Active map core instance for current rendering context. - $switchDb
—
Switches database abstraction layer. - $ubillingConfig
—
Ubilling configuration provider.
Methods
protected
- getAllSwitches() — Returns all switches from database.
- getSwitchesWithGeo() — Returns switches with non-empty GEO coordinates.
- getSwitchesWithoutGeo() — Returns switches without GEO and excluding NP devices.
- initDb() — Inits switches database abstraction layer.
- initMapCore() — Inits single mapcore instance.
public
- __construct() — Creates SwitchMap service instance.
- drawLinkedSwitches() — Builds markers for linked switches only.
- drawSwitchAllLinks() — Builds links for linked switches only.
- drawSwitchUplinks() — Builds uplink lines set for full map or trace mode.
- drawSwitches() — Builds all switch markers for switch map.
- getLinkedSwitchIds() — Collects all related switch ids for brief minimap mode.
- getLocationFinder() — Builds click-to-place editor code for map.
- getLocationSwitchForm() — Renders selector form for placing switches.
- getMapCore() — Creates configured MapCore instance with all overlays.
- getSwitchParents() — Returns chain of parent switches including current.
- getSwitchesMapObjects() — Returns switch layer as MapCore-compatible map objects payload.
- getSwitchesPlacemarks() — Returns switch layer placemarks JS buffer only.
- isBriefMinimapEnabled() — Detects whether brief minimap mode is enabled.
- isLinkedSwitch() — Checks whether switch id belongs to traced uplink chain.
- isLoopAllowed() — Validates that new parent does not create topology loop.
- render() — Renders full switch map page output.
- renderMapContainer() — Renders map controls and map container block.
- renderMiniMap() — Renders compact switch mini-map for switch profile page.
- saveSwitchPlacement() — Persists posted switch coordinates from editor form if received from editor form