Options
All
  • Public
  • Public/Protected
  • All
Menu

Map class for displaying geographic maps of the world and its different parts.

Hierarchy

Implements

Index

Constructors

constructor

Properties

classList

classList: DOMTokenList

Class attribute for the root element.

externalJSON

externalJSON: GeoJSON

featureName

featureName: string

mapOptions

mapOptions: MapOptions

The options used when constructing the map. Consists of: fill,stroke,strokeWidth,nonScalingStroke

root

root: SVGSVGElement

style

style: CSSStyleDeclaration

Style for the root element.

update

update: function

The update function describes how this element should update itself

Type declaration

    • (): void
    • Returns void

Static controller

controller: Controller = new Controller()

The controller manages the dependencies between elements. Every element is added to this controller upon creation.

Static count

count: number = 0

This number uniquely identifes elements

Static disable

disable: boolean = false

Allows for the events attatched to elements to be disabled.

Accessors

height

height:

Returns the height of this svg element. Sets the height of this svg element to the provided value.

id

id:

Returns the unique generated identifier associated with this element.

viewBox

viewBox:

width

width:

Return the width of this svg element. Set the width of this svg element.

x

x:

y

y:

Methods

a

  • a(href: string): A
  • Constructs and appends an 'a' (link) element within this element.

    Parameters

    • href: string

    Returns A

addDependency

appendChild

  • appendChild<T>(child: T): T

circle

  • circle(cx: number, cy: number, r: number): Circle
  • Parameters

    • cx: number
    • cy: number
    • r: number

    Returns Circle

clear

  • clear(): void
  • Removes all child elements from this element.

    Returns void

clearPaths

  • clearPaths(): void
  • Clears the interactive of all Map paths.

    Returns void

clipPath

  • Constructs and appends a 'clipPath' element within this element.

    Returns ClipPath

contains

  • contains(element: Element): boolean
  • Returns true if this element contains the argument element.

    Parameters

    Returns boolean

defs

  • defs(): Defs
  • Returns Defs

description

draw

  • draw(name: string): void
  • Renders the geo json onto the webpage.

    Parameters

    • name: string

      name of the feature you want to draw. If left blank will draw all features

    Returns void

ellipse

  • ellipse(cx: number, cy: number, rx: number, ry: number): Ellipse
  • Parameters

    • cx: number
    • cy: number
    • rx: number
    • ry: number

    Returns Ellipse

getAllFeaturePaths

  • getAllFeaturePaths(): Array<Group>
  • Returns all of the paths for the current map.

    Returns Array<Group>

getAttribute

getBoundingBox

  • getBoundingBox(): SVGRect
  • Returns the bounding box of this element. Note, this is different from the getBoundingClientRect method since the bounding box is affected by the current viewPort.

    If this element's root is not a SVGGraphics element as is the case for the marker, title, and more element, then null is returned instead of a DOMRect.

    Returns SVGRect

getHTMLFeatureElements

  • getHTMLFeatureElements(): Array<Element>
  • Returns an Array HTML Elements that are all of the plotted features.

    Returns Array<Element>

getPathForFeatureName

  • getPathForFeatureName(name: string): Group
  • Returns the path for the given feature name

    Parameters

    • name: string

      name of the feature you want the path for

    Returns Group

group

line

  • line(x1: number, y1: number, x2: number, y2: number): Line
  • Parameters

    • x1: number
    • y1: number
    • x2: number
    • y2: number

    Returns Line

marker

  • marker(refX: number, refY: number, width: number, height: number): Marker
  • Constructs and appends a 'marker' element within this element.

    Parameters

    • refX: number
    • refY: number
    • width: number
    • height: number

    Returns Marker

metadata

onchange

  • onchange(): void
  • The default behavior is to update its dependents on change.

    Returns void

path

  • path(d: string): Path
  • Parameters

    • d: string

    Returns Path

polygon

  • Parameters

    • points: string

    Returns Polygon

prependChild

  • prependChild<T>(child: T): T

rectangle

  • rectangle(x: number, y: number, width: number, height: number): Rectangle
  • Parameters

    • x: number
    • y: number
    • width: number
    • height: number

    Returns Rectangle

remove

  • remove(): void

removeFeature

  • removeFeature(name: string): void
  • remove the feature with the passed in name from the geo map

    Parameters

    • name: string

      the name of the feature you want to remove

    Returns void

resetViewBox

  • resetViewBox(): void
  • Resets the viewbox to the entire map

    Returns void

script

  • Constructs and appends a 'script' element within this element.

    Returns Script

setAttribute

setViewBox

  • setViewBox(x: number, y: number, width: number, height: number): void
  • Parameters

    • x: number
    • y: number
    • width: number
    • height: number

    Returns void

setViewBoxToFeature

  • setViewBoxToFeature(name: string): void
  • sets the viewbox of the interactive to the specified feature

    Parameters

    • name: string

    Returns void

svg

  • svg(x: number, y: number, width: number, height: number): SVG
  • Parameters

    • x: number
    • y: number
    • width: number
    • height: number

    Returns SVG

symbol

text

  • text(x: number, y: number, str: string): Text
  • Parameters

    • x: number
    • y: number
    • str: string

    Returns Text

title

updateDependents

  • updateDependents(): void

use

  • use(x: number, y: number, width: number, height: number): Use
  • Parameters

    • x: number
    • y: number
    • width: number
    • height: number

    Returns Use

Static SVG

  • SVG(idOrElement: string | HTMLElement, x?: number, y?: number, width?: number, height?: number): SVG
  • Constructs and returns a SVG object within the DOM. If the provided argument is an HTMLElement appends the interactive within that element. If the provided a value is a string, appends the interactive within the HTML element with the corresponding ID. If no element is found throws an error.

    Parameters

    • idOrElement: string | HTMLElement
    • Optional x: number
    • Optional y: number
    • Optional width: number
    • Optional height: number

    Returns SVG

Static clear

  • clear(disable?: boolean): void
  • Clears the static data structures holding elements and resets the count.

    Parameters

    • Default value disable: boolean = false

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc