This README outlines the details of embedding the Roomle Planner to your website.
How to add the embedding API to your project:
You only need to add the code which is in the file roomle-embedding.js to your
project. You can find the file on our website under: https://www.roomle.com/t/external/embedding/. Just add the version and the file name to the URL. An example would be:
We recommend adding the file by a package manager like npm, yarn or similar tools and a build pipe.
Common tools to setup a build pipe for example are gulp, webpack, grunt and many more. Since every new release sits in a separate subfolder you can specify an exact version in your package manager. Locking to a certain version helps you to deliver a stable product with the features you need.
Right now the API is very small but it will expand over the course of the next weeks and month.
// RoomleEmbedding is a global object which has the method initPlanner
// initPlanner takes a embedding_id (is given to you by Roomle) and a DOM element
// into which the planner should be injected
// it returns a promise which resolves with a plan instance
// Some pseudo code would be:
const plan = await RoomleEmbedding.initPlanner(’embedding_id’,
// Right now the plan has the following methods:
// * loadPlan takes a plan id and returns a void promise
// * getTotalFloorArea returns a promise which resolves
// with the total floor area of the
// plan in square mm
// * getPlanObjects returns a promise which resolves with
// the IDs of the items inside the plan
// Here is some pseudo code:
const totalFloorArea = await plan.getTotalFloorArea();
const planObjects = await plan.getPlanObjects();