The API will be in the form of JavaScript library you include in your own code.
<script src="https://apps.alpha-vision.com/api/floorplanAPIv2.4.js"></script>
https://apps.zondavirtual.com/demo/floorplanApi/floorplanV4.html
Declare an API variable. This will Initialize the floorplan, the variable will be used later for all other function calls. Default visible floor and default flip will be used as set in our CMS.
Parameters
- BUILDER GUID: Unique GUID of the builder. Contact Alpha Vision to request your Builder GUID.
- Plan Id : Unique Integration ID of the plan. Included in your alphaplan links
- parentElement: reference DOM element, The SVG element will be added inside the DOM element provided as reference in the initialization. This will prevent the need to provide the DOM element in future calls
- optionCodes: (optional): Array of optionCode to enable at initialization.
- Callback: function called when the api is ready to use
Example
fp = new AVFloorplan("8D676CB9-C011-429D-8D71-87D34A87494B","686546",$("#divFloorplan")[0],optionsId, fpIsReady);
- enableOption(optionId,location): Enable a single option. This will enable a single option from the current state of the floorplan. Options enabled before will still be enable. Location is optional, should be provided if multiple options share the same optionID. See Message Section for the return codes.
- disableOption(optionId,location): Disable a single option. From current state of the floorplan. Location is optional, should be provided if multiple options share the same optionID. See Message Section for the return codes.
- enableOptions([optionId]): This act as a reset. The plan will first be reset to its default state then the list of provided options will be enabled. This can be used when loading a saved configuration.
- flip: The floorplan will be flipped horizontally.
- setFloor(floorId): Will change the visible floor. Values start with 1 to x. where 1 is basement if exists.
- resetOptions(): This will return the options to their default state. It will not however change the flip or visible floor.
- disableAllOptions(): This will as it say disable all the options. The result is sometimes different then doing resetOptions. For example, it’s possible in our CMS to set some options as Built-in. Those options are enabled by default. They will be enabled when the plan is first initialized, and they will be enabled after a resetOptions.
- setRoomsColor(color): Change the graphical color of all basic room elements in the SVG.
- setOptionsColor(color): Change the graphical color of all enabled options elements in the SVG.
- setBuiltInColor(color): Change the graphical color of all built-in options elements in the SVG
- addHomeFootPrint(color): By default, our SVG is fully transparent. This will add an opaque background inside the walls of the home.
- exportStaticSVG(blackAndWhite) : return an array of SVG using the current configuration. One SVG per floor. Display colors by default. if True: remove homefootprint and set all colors to black.
Examples
fp.enableOption("Room3012")
fp.setFloor(2)
fp.setOptionsColor("#4286f4")
garageOrientation: contains either RIGHT, LEFT or Empty String (if no garage is present or if value is not set in CMS).
- S-0001: Option found and set.
- S-0002: Elevation found and set.
- S-0003: Multiple options found and set.
- E-0001: Option Code invalid.
- E-0002: Option Code not found.
- E-0004: Multiple options have the same Integration id and Location. Please review the data in our CMS.
- For this API to work properly optionCodes need to be set in Alpha-Vision CMS for all options and Elevation (only required for elevations that affect floorplan)
- This flow does not include anything about floorplan versioning. API call will always an SVG element according to the latest plan version.