Planit.js

new (@options = {})

Class: Planit

Planit comes preloaded with a global variable, planit. This is an instance of the Planit class, which means we can call its methods directly. Therefore, calling planit.new() creates a new interactive plan.

Options

Option Value Default Description
container String planit The ID of a DOM element in which to initialize Planit
image Object NULL url: (required if you want an image) The URL of the image to add as the plan image

zoom: Boolean of whether or not to add zoomable options
markers Array of Objects NULL Each object should represent the options for each marker, as explained here.

Returns: A Plan object

Example

p = planit.new({
  container: 'planit',
  image: {
    url: 'http://i.kinja-img.com/gawker-media/image/upload/s--odQGlKs_--/18jyfksl1kks0jpg.jpg',
    zoom: true,
  },
  markers: [
    {
      coords: ['12','45'],
      draggable: true,
      infobox: {
        html: "<h2>Dingle</h2><p>It's the dinkus.</p>",
        position: 'top',
        arrow: true
      },
      class: "cheese bucket",
      color: "#CEA052",
      size: 40
    },
    {
      coords: ['45','62'],
      draggable: true,
      infobox: {
        html: "<h2>Dangle</h2><p>It's the other dinkus.</p>",
        position: 'left',
        arrow: true
      }
  ]
});