Documentation

Modules

DataEnrichment

enriches delivered data with default values

Helper

Helper for general purposes

Classes

Bounds
Cluster
Drawable
Interact
LatLng
MappedJS
MapInformation
Marker
MarkerClusterer
Point
Publisher
Rectangle
SideBar
StateHandler
Texture
Tile
TileMap
View

Objects

Events : object

Helper for naming events

DataEnrichment

enriches delivered data with default values

Author: Michael Duve mduve@designmail.net
Copyright: Michael Duve 2016

DataEnrichment.marker(data) ⇒ Object

enriches marker data with all needed data

Kind: static method of DataEnrichment
Returns: Object - enriched marker data
Params

DataEnrichment.settings(data) ⇒ Object

enriches map data with all needed data

Kind: static method of DataEnrichment
Returns: Object - enriched settings data
Params

Helper

Helper for general purposes

Author: Michael Duve mduve@designmail.net
Copyright: Michael Duve 2016

Helper.requestJSON(filename, callback) ⇒ Helper

request json-data from given file and calls callback on success

Kind: static method of Helper
Returns: Helper - Helper object for chaining
Params

Helper.find(elementString, element) ⇒ HTMLElement

find an element in DOM

Kind: static method of Helper
Returns: HTMLElement - reference to HTMLElement or null if not found
Params

Helper.findAll(elementString, element) ⇒ NodeList

find multiple elements in DOM

Kind: static method of Helper
Returns: NodeList - list of found elements
Params

Helper.show(elem) ⇒ Helper

show a HTMLElement

Kind: static method of Helper
Returns: Helper - reference of Helper for chaining
Params

Helper.hide(elem) ⇒ Helper

hide a HTMLElement

Kind: static method of Helper
Returns: Helper - reference of Helper for chaining
Params

Helper.css(elem, css) ⇒ Helper

applies css to given HTMLElement

Kind: static method of Helper
Returns: Helper - reference of Helper for chaining
Params

Helper.addListener(elem, bindTo, fn~addListenerCallback) ⇒ Helper

adds a listener to given HTMLElement

Kind: static method of Helper
Returns: Helper - reference of Helper for chaining
Params

Helper.clamp(v, min, max) ⇒ Number

clamps a value to specified min and max

Kind: static method of Helper
Returns: Number - clamped value
Params

Helper.loadImage(cb) ⇒ Helper

loads an image and calls callback on success

Kind: static method of Helper
Returns: Helper - reference of Helper for chaining
Params

Helper.getFile(url, callback) ⇒ Helper

request data from given file and calls callback on success

Kind: static method of Helper
Returns: Helper - reference of Helper for chaining
Params

Helper.loadScript(url, callback) ⇒ Helper

loads a js script

Kind: static method of Helper
Returns: Helper - reference of Helper for chaining
Params

Helper.forEach(a, cb) ⇒ Helper

for each helper

Kind: static method of Helper
Returns: Helper - reference of Helper for chaining
Params

Helper.toRadians(degrees) ⇒ Number

convert degree to radian

Kind: static method of Helper
Returns: Number - converted radian
Params

Helper.isMouse() ⇒ Boolean

checks if mouse is possible

Kind: static method of Helper
Returns: Boolean - if true, mouse is possible

Helper.isTouch() ⇒ Boolean

checks if touch is possible

Kind: static method of Helper
Returns: Boolean - if true, touch is possible

Helper.isIE() ⇒ Boolean

checks if IE is used

Kind: static method of Helper
Returns: Boolean - if true, IE is used

Helper.scrollEvent() ⇒ String

gets cross-browser scroll-event

Kind: static method of Helper
Returns: String - name of scroll event

Bounds

Kind: global class

new Bounds(northWest, southEast)

Returns: Bounds - instance of Bounds for chaining
Params

bounds.width ⇒ Number

get width of boundaries

Kind: instance property of Bounds
Returns: Number - distance between east and west boundary

bounds.height ⇒ Number

get height of boundaries

Kind: instance property of Bounds
Returns: Number - distance between north and south boundary

bounds.center ⇒ LatLng

get center of boundaries

Kind: instance property of Bounds
Returns: LatLng - half the distance between northwest and southeast boundary

bounds.equals(bounds) ⇒ Boolean

check if specified bounds equals this bounds

Kind: instance method of Bounds
Returns: Boolean - Whether they are equal or not
Params

bounds.toString() ⇒ String

string representation

Kind: instance method of Bounds
Returns: String - string representation of object

Cluster

Kind: global class

new Cluster(context, texture, font, id)

Returns: Cluster - instance of Cluster for chaining
Params

cluster.position ⇒ Point

calculates the actual position of a cluster

Kind: instance property of Cluster
Returns: Point - calculated position

cluster.boundingBox ⇒ Rectangle

calculates actual dimension and position of a cluster

Kind: instance property of Cluster
Returns: Rectangle - calculated dimension

cluster.init() ⇒ Cluster

initialize a cluster

Kind: instance method of Cluster
Returns: Cluster - instance of Cluster for chaining

cluster.createClusterMarker() ⇒ Cluster

create cluster for markers

Kind: instance method of Cluster
Returns: Cluster - instance of Cluster for chaining

cluster.draw() ⇒ Cluster

draw this cluster

Kind: instance method of Cluster
Returns: Cluster - instance of Cluster for chaining

cluster.bindEvents() ⇒ Cluster

bind all events

Kind: instance method of Cluster
Returns: Cluster - instance of Cluster for chaining

cluster.unbindEvents() ⇒ Cluster

unbind all events

Kind: instance method of Cluster
Returns: Cluster - instance of Cluster for chaining

cluster.isActive(point, oneIsHit) ⇒ Boolean

set active to true

Kind: instance method of Cluster
Returns: Boolean - indicate hit (true) or not
Params

cluster.hit(point) ⇒ Booelan

check hit of point

Kind: instance method of Cluster
Returns: Booelan - Wheter it is a hit or not
Params

cluster.action() ⇒ Cluster

execute bound action of cluster

Kind: instance method of Cluster
Returns: Cluster - instance of Cluster for chaining

cluster.calculateCenter() ⇒ LatLng

calculates the center of a cluster

Kind: instance method of Cluster
Returns: LatLng - center of cluster

cluster.addMarker(marker) ⇒ Cluster

adds a marker to the cluster

Kind: instance method of Cluster
Returns: Cluster - instance of Cluster for chaining
Params

cluster.remove() ⇒ Cluster

remove this cluster

Kind: instance method of Cluster
Returns: Cluster - instance of Cluster for chaining

Drawable

Kind: global class

new Drawable(id, x, y, w, h)

Returns: Drawable - instance of Drawable for chaining
Params

drawable.view ⇒ Rectangle

stores mapdimension information

Kind: instance property of Drawable
Returns: Rectangle - map

drawable.level ⇒ Number

stores level information

Kind: instance property of Drawable
Returns: Number - level

drawable.viewport ⇒ Rectangle

stores viewport information

Kind: instance property of Drawable
Returns: Rectangle - viewport

drawable.distortionFactor ⇒ Number

stores distortion information

Kind: instance property of Drawable
Returns: Number - distortionFactor

drawable.offsetToCenter ⇒ Number

stores x offset to center

Kind: instance property of Drawable
Returns: Number - offsetToCenter

drawable.centerPosition ⇒ LatLng

stores latlng position of map center

Kind: instance property of Drawable
Returns: LatLng - center

drawable.zoomFactor ⇒ Number

stores current zoom factor

Kind: instance property of Drawable
Returns: Number - zoomFactor

drawable.bounds ⇒ Bounds

stores boundary information

Kind: instance property of Drawable
Returns: Bounds - bounds

drawable.draw() ⇒ Drawable

execute on displaying instance

Kind: instance method of Drawable
Returns: Drawable - instance of Drawable for chaining

Interact

Kind: global class

new Interact(settings)

Returns: Interact - new instance
Params

interact.timeToLastMove ⇒ Number

get time difference to last

Kind: instance property of Interact
Returns: Number - difference

interact.time ⇒ Number

get time difference to start

Kind: instance property of Interact
Returns: Number - difference

interact.getDefaultSettings() ⇒ Object

get the default settings

Kind: instance method of Interact
Returns: Object - settings

interact.getDefaultCallbacks() ⇒ Object

get default callbacks

Kind: instance method of Interact
Returns: Object - callbacks

interact.getDefaultEventNames() ⇒ Object

get default eventnames

Kind: instance method of Interact
Returns: Object - eventnames

interact.getDefaultData() ⇒ Object

get default data

Kind: instance method of Interact
Returns: Object - data

interact.handleViewport(viewport) ⇒ Interact

handles the overwrite of viewport meta

Kind: instance method of Interact
Returns: Interact - Returns this instance
Params

interact.init(container) ⇒ Interact

initializes class settings and bindings

Kind: instance method of Interact
Returns: Interact - Returns this instance
Params

interact.bindEvents() ⇒ Interact

binds all needed events

Kind: instance method of Interact
Returns: Interact - Returns this instance

interact.bindIEEvents() ⇒ Interact

binds all needed events for IE

Kind: instance method of Interact
Returns: Interact - Returns this instance

interact.bindTouchEvents() ⇒ Interact

binds all needed events for touch devices

Kind: instance method of Interact
Returns: Interact - Returns this instance

interact.bindMouseEvents() ⇒ Interact

binds all needed events for mouse devices

Kind: instance method of Interact
Returns: Interact - Returns this instance

interact.preHandle(event) ⇒ Object

pre handle all events

Kind: instance method of Interact
Returns: Object - normalized Event
Params

interact.scrollHandler(event) ⇒ Boolean

handles cross-browser and -device scroll

Kind: instance method of Interact
Returns: Boolean - always returns false
Params

interact.normalizeWheelDelta(e) ⇒ Number

Solution from http://jsfiddle.net/uNeBr/

Kind: instance method of Interact
Returns: Number - normalized wheel delta
Params

interact.isPointerEvent(e) ⇒ Boolean

check if event is a PointerEvent (IE)

Kind: instance method of Interact
Returns: Boolean - Whether event is PointerEvent
Params

interact.calculateStart(e) ⇒ Object

calculation to be made at start-handler

Kind: instance method of Interact
Returns: Object - calculated data
Params

interact.handlePointerEventStart(data, e) ⇒ Object

handle PointerEvent calculations

Kind: instance method of Interact
Returns: Object - manipulated enriched data
Params

interact.handleTouchEventStart(data, e) ⇒ Object

handle TouchEvent calculations for start

Kind: instance method of Interact
Returns: Object - manipulated enriched data
Params

interact.getPointerArray() ⇒ Object

get array of pointers (IE)

Kind: instance method of Interact
Returns: Object - array of pointerIDs

interact.handleMultitouchStart(positionsArray) ⇒ Object

handles multitouch for start

Kind: instance method of Interact
Returns: Object - manipulated enriched data
Params

interact.handleSingletouchStart(position) ⇒ Object

handles singletouch for start

Kind: instance method of Interact
Returns: Object - manipulated enriched data
Params

interact.takeActionStart(action) ⇒ Interact

handle action at start event handler

Kind: instance method of Interact
Returns: Interact - instance of Interact for chaining
Params

interact.startHandler(event) ⇒ Boolean

handles cross-browser and -device start-event

Kind: instance method of Interact
Returns: Boolean - always returns false
Params

interact.clearTimeouts(timeout) ⇒ Interact

clear timeout helper

Kind: instance method of Interact
Returns: Interact - instance of Interact for chaining
Params

interact.calculateMove(e) ⇒ Object

calculation to be made at move-handler

Kind: instance method of Interact
Returns: Object - calculated data
Params

interact.handlePointerEventMove(data, e) ⇒ Object

handle PointerEvent at moving (IE)

Kind: instance method of Interact
Returns: Object - manipulated enriched data
Params

interact.handleTouchEventMove(data, e) ⇒ Object

handle TouchEvent calculations for move

Kind: instance method of Interact
Returns: Object - manipulated enriched data
Params

interact.handleTouchEvent(data, e, fnSingle, fnMulti) ⇒ Object

handles touch events

Kind: instance method of Interact
Returns: Object - manipulated enriched data
Params

interact.handleMultitouchMove(positionsArray) ⇒ Object

handles multitouch for move

Kind: instance method of Interact
Returns: Object - manipulated enriched data
Params

interact.handleSingletouchMove(position) ⇒ Object

handles singletouch for move

Kind: instance method of Interact
Returns: Object - manipulated enriched data
Params

interact.moveHandler(event) ⇒ Boolean

handles cross-browser and -device move-event

Kind: instance method of Interact
Returns: Boolean - always returns false
Params

interact.handlePinchAndZoom() ⇒ Interact

handles pinch and zoom

Kind: instance method of Interact
Returns: Interact - instance of Interact for chaining

interact.positionDidNotChange(e) ⇒ Boolean

check if position has been changed

Kind: instance method of Interact
Returns: Boolean - Whether or not position has changed
Params

interact.calculateEnd(e) ⇒ Object

calculation to be made at end-handler

Kind: instance method of Interact
Returns: Object - calculated data
Params

interact.handleSingletouchEnd(position) ⇒ Object

handles singletouch for end

Kind: instance method of Interact
Returns: Object - manipulated enriched data
Params

interact.takeActionEnd(action) ⇒ Interact

handle action at end event handler

Kind: instance method of Interact
Returns: Interact - instance of Interact for chaining
Params

interact.endHandler(event) ⇒ Boolean

handles cross-browser and -device end-event

Kind: instance method of Interact
Returns: Boolean - always returns false
Params

interact.handleSwipeAndFlick() ⇒ Interact

handles flick and swipe events

Kind: instance method of Interact
Returns: Interact - instance of Interact for chaining

interact.handleMultitouchEnd(e) ⇒ Interact

handles multitouch for end

Kind: instance method of Interact
Returns: Interact - instance of Interact for chaining
Params

interact.pinchBalance() ⇒ Interact

balances pinching after release of finger

Kind: instance method of Interact
Returns: Interact - instance of Interact for chaining

interact.getSwipeDirections(direction) ⇒ Array.<String>

Returns an array of strings, representing the directions

Kind: instance method of Interact
Returns: Array.<String> - returns an array representing the directions as strings
Params

interact.setTimeoutForEvent(callback, timeout, args, holdTimeout) ⇒ Interact

Helper for setting a timeout for events

Kind: instance method of Interact
Returns: Interact - Returns this instance
Params

interact.eventCallback(callback, args) ⇒ Interact

Eventhandler for handling the callbacks

Kind: instance method of Interact
Returns: Interact - Returns this instance
Params

interact.getRelativePosition(e) ⇒ Point

get the relative position of clientX and clientY

Kind: instance method of Interact
Returns: Point - calculated relative position
Params

interact.getAbsolutePosition(point) ⇒ Point

get the absolute position of clientX and clientY

Kind: instance method of Interact
Returns: Point - calculated absolute position
Params

interact.getScrollDirection(event) ⇒ Array.<String>

get scroll direction from event

Kind: instance method of Interact
Returns: Array.<String> - an array with scroll directions
Params

interact.isDownDirection(axis, event) ⇒ Boolean

checks if direction is down

Kind: instance method of Interact
Returns: Boolean - Whether or not direction is down
Params

interact.isUpDirection(axis, event) ⇒ Boolean

checks if direction is up

Kind: instance method of Interact
Returns: Boolean - Whether or not direction is up
Params

interact.isRightDirection(axis, event) ⇒ Boolean

checks if direction is right

Kind: instance method of Interact
Returns: Boolean - Whether or not direction is right
Params

interact.isLeftDirection(axis, event) ⇒ Boolean

checks if direction is left

Kind: instance method of Interact
Returns: Boolean - Whether or not direction is left
Params

interact.getEvent(e) ⇒ Event

Get event helper, applies event-fix too

Kind: instance method of Interact
Returns: Event - cross-device event
Params

LatLng

Kind: global class

new LatLng(lat, lng)

Returns: LatLng - instance of LatLng for chaining
Params

latLng.length ⇒ Number

length of a latlng

Kind: instance property of LatLng
Returns: Number - length of latlng

latLng.clone ⇒ LatLng

gets a clone of this latlng

Kind: instance property of LatLng
Returns: LatLng - create a copy

latLng.distance(latlng) ⇒ Number

calculates distance between this and specified latlng

Kind: instance method of LatLng
Returns: Number - distance
Params

latLng.substract(coord) ⇒ LatLng

substract specified coord from this coordinate

Kind: instance method of LatLng
Returns: LatLng - instance of LatLng for chaining
Params

latLng.add(coord) ⇒ LatLng

add specified coord to this coordinate

Kind: instance method of LatLng
Returns: LatLng - instance of LatLng for chaining
Params

latLng.divide(factorLat, factorLng) ⇒ LatLng

divides a latlng with a given factor

Kind: instance method of LatLng
Returns: LatLng - instance of LatLng for chaining
Params

latLng.multiply(factorLat, factorLng) ⇒ LatLng

multiplicates a latlng with a given factor

Kind: instance method of LatLng
Returns: LatLng - instance of LatLng for chaining
Params

latLng.equals(coord) ⇒ Boolean

checks if specified coord equals this coord

Kind: instance method of LatLng
Returns: Boolean - Returns if specified coord equals this coord
Params

latLng.toString() ⇒ String

converts a LatLng to string

Kind: instance method of LatLng
Returns: String - representing LatLng

LatLng.createFromLatLng(LatLng) ⇒ LatLng

Creates a LatLng from specified LatLng

Kind: static method of LatLng
Returns: LatLng - the LatLng specified
Params

MappedJS

Kind: global class

new MappedJS(tilesData, markerData, settings)

Returns: MappedJS - instance of MappedJS for chaining
Params

mappedJS.generateUniqueID() ⇒ Number

generate a unique id for this instance

Kind: instance method of MappedJS
Returns: Number - unique id

mappedJS.addInformationLayer(type, settings) ⇒ MappedJS

add an information layer to container

Kind: instance method of MappedJS
Returns: MappedJS - instance of MappedJS for chaining
Params

mappedJS.addControls() ⇒ MappedJS

add controls (zoom, home) to DOM

Kind: instance method of MappedJS
Returns: MappedJS - instance of MappedJS for chaining

mappedJS.initializeSettings(settings) ⇒ MappedJS

initializes the settings and handles errors

Kind: instance method of MappedJS
Returns: MappedJS - instance of MappedJS for chaining
Params

mappedJS.initializeData(data, cb) ⇒ MappedJS

initializes the data, asynchronous

Kind: instance method of MappedJS
Returns: MappedJS - instance of MappedJS for chaining
Params

mappedJS.initializeMap() ⇒ MappedJS

initializes Map module

Kind: instance method of MappedJS
Returns: MappedJS - instance of MappedJS for chaining

mappedJS.getAbsolutePosition(point) ⇒ Point

get absolute position of a point

Kind: instance method of MappedJS
Returns: Point - absolute position to viewport
Params

mappedJS.initializeInteractForMap() ⇒ MappedJS

initializes interaction

Kind: instance method of MappedJS
Returns: MappedJS - instance of MappedJS for chaining

mappedJS.hoverItems(pos) ⇒ MappedJS

check hover of items

Kind: instance method of MappedJS
Returns: MappedJS - instance of MappedJS for chaining
Params

mappedJS.bindEvents() ⇒ MappedJS

binds all events to handlers

Kind: instance method of MappedJS
Returns: MappedJS - instance of MappedJS for chaining

mappedJS.resetToInitialState() ⇒ MappedJS

resets map to initial state

Kind: instance method of MappedJS
Returns: MappedJS - instance of MappedJS for chaining

mappedJS.zoomInToCenter() ⇒ MappedJS

zooms into center of map

Kind: instance method of MappedJS
Returns: MappedJS - instance of MappedJS for chaining

mappedJS.zoomOutToCenter() ⇒ MappedJS

zooms out of center of map

Kind: instance method of MappedJS
Returns: MappedJS - instance of MappedJS for chaining

mappedJS.keyPress(e) ⇒ MappedJS

Keypress handler

Kind: instance method of MappedJS
Returns: MappedJS - instance of MappedJS for chaining
Params

mappedJS.handleMovementByKeys(direction) ⇒ MappedJS

handles the translation of the map by keypress

Kind: instance method of MappedJS
Returns: MappedJS - instance of MappedJS for chaining
Params

mappedJS.keyRelease() ⇒ MappedJS

key is released

Kind: instance method of MappedJS
Returns: MappedJS - instance of MappedJS for chaining

mappedJS.resizeHandler() ⇒ MappedJS

handles resizing of window

Kind: instance method of MappedJS
Returns: MappedJS - instance of MappedJS for chaining

mappedJS.loadingFinished() ⇒ MappedJS

called when loading and initialization is finished

Kind: instance method of MappedJS
Returns: MappedJS - instance of MappedJS for chaining

MappedJS.count : Number

instance counter

Kind: static property of MappedJS

MapInformation

Kind: global class

new MapInformation(id, path)

Returns: MapInformation - singleton instance of MapInformation for chaining
Params

mapInformation.offsetToCenter

Returns the current distorted viewport

Kind: instance property of MapInformation

mapInformation.pixelPerLatLng ⇒ Point

how many pixels per lat and lng

Kind: instance property of MapInformation
Returns: Point - pixels per lat/lng

mapInformation.get() ⇒ Object

gets current data

Kind: instance method of MapInformation
Returns: Object - map information

mapInformation.bindEvents() ⇒ MapInformation

bind all events

Kind: instance method of MapInformation
Returns: MapInformation - instance of MapInformation for chaining

mapInformation.update(obj) ⇒ MapInformation

updates current information

Kind: instance method of MapInformation
Returns: MapInformation - instance of MapInformation for chaining
Params

mapInformation.convertPointToLatLng(point) ⇒ LatLng

converts a Point to LatLng in view

Kind: instance method of MapInformation
Returns: LatLng - presentation of point in lat-lng system
Params

mapInformation.convertLatLngToPoint(latlng) ⇒ Point

converts a LatLng to Point in view

Kind: instance method of MapInformation
Returns: Point - presentation of point in pixel system
Params

mapInformation.centerUpdated() ⇒ Boolean

center position was updated

Kind: instance method of MapInformation
Returns: Boolean - information was updated

mapInformation.updateOffsetToCenter() ⇒ Boolean

offset to center was updated

Kind: instance method of MapInformation
Returns: Boolean - information was updated

mapInformation.getDistortionFactorForLatitude(latlng) ⇒ Number

get distortion factor for specified latitude

Kind: instance method of MapInformation
Returns: Number - distortion factor
Params

mapInformation.destroy()

destroys singleton instance

Kind: instance method of MapInformation

MapInformation.instances : Object

singleton instance wrapper

Kind: static property of MapInformation

Marker

Kind: global class

new Marker(settings, context, id)

/**

Returns: Marker - instance of Marker for chaining
Params

marker.position ⇒ Point

position of marker

Kind: instance property of Marker
Returns: Point - position

marker.boundingBox ⇒ Rectangle

get dimensions of marker

Kind: instance property of Marker
Returns: Rectangle - dimensions

marker.nearestPositionToCenter ⇒ LatLng

find nearest position to mapcenter

Kind: instance property of Marker
Returns: LatLng - nearest position

marker.isClusterable() ⇒ Boolean

check if marker can be clustered

Kind: instance method of Marker
Returns: Boolean - wheter it can be clustered or not

marker.getNearestPositionToCenter() ⇒ LatLng

find nearest position to mapcenter

Kind: instance method of Marker
Returns: LatLng - nearest position

marker.isActive(point, oneIsHit) ⇒ Boolean

set active to true

Kind: instance method of Marker
Returns: Boolean - indicate hit (true) or not
Params

marker.action() ⇒ Marker

execute bound action of cluster

Kind: instance method of Marker
Returns: Marker - instance of Marker for chaining

marker.bindEvents() ⇒ Marker

bind all events

Kind: instance method of Marker
Returns: Marker - instance of Marker for chaining

marker.draw() ⇒ Marker

draw a marker

Kind: instance method of Marker
Returns: Marker - instance of Marker for chaining

marker.hit(point) ⇒ Booelan

check hit of point

Kind: instance method of Marker
Returns: Booelan - Wheter it is a hit or not
Params

marker.decideWhatToDraw(text, icon) ⇒ function

currying function for drawing text, icon or both

Kind: instance method of Marker
Returns: function - function to be called on draw
Params

marker.drawText(pos)

draw text of marker

Kind: instance method of Marker
Params

marker.drawIcon(pos)

draw icon of marker

Kind: instance method of Marker
Params

marker.drawCircleIcon(size) ⇒ function

currying function for drawing a circle

Kind: instance method of Marker
Returns: function - function for drawing circle icon
Params

marker.drawSquareIcon(size) ⇒ function

currying function for drawing a square

Kind: instance method of Marker
Returns: function - function for drawing square icon
Params

marker.drawImageIcon(texture, size, offset) ⇒ function

currying function for drawing an image

Kind: instance method of Marker
Returns: function - function for drawing image icon
Params

MarkerClusterer

Kind: global class

new MarkerClusterer(markers, context, clusterImage, id)

Returns: MarkerClusterer - instance of MarkerClusterer for chaining
Params

markerClusterer.bindEvents() ⇒ MarkerClusterer

bind all events

Kind: instance method of MarkerClusterer
Returns: MarkerClusterer - instance of MarkerClusterer for chaining

markerClusterer.clusterize() ⇒ MarkerClusterer

decompose all markers into Cluster

Kind: instance method of MarkerClusterer
Returns: MarkerClusterer - instance of MarkerClusterer for chaining

markerClusterer.findNearestHit(marker, hits) ⇒ Cluster

find nearest cluster if there are multiple hits

Kind: instance method of MarkerClusterer
Returns: Cluster - closest cluster
Params

markerClusterer.getDistance(marker, cluster) ⇒ Number

gets distance between marker and cluster

Kind: instance method of MarkerClusterer
Returns: Number - distance between them
Params

markerClusterer.createCluster(marker) ⇒ Cluster

creates a new cluster for marker

Kind: instance method of MarkerClusterer
Returns: Cluster - created cluster
Params

markerClusterer.deleteAllClusters() ⇒ MarkerClusterer

delete all clusters

Kind: instance method of MarkerClusterer
Returns: MarkerClusterer - instance of MarkerClusterer for chaining

Point

Kind: global class

new Point(x, y)

Returns: Point - instance of Point for chaining
Params

point.length ⇒ Number

length of a point

Kind: instance property of Point
Returns: Number - length of a point

point.clone ⇒ Point

gets a clone of this point

Kind: instance property of Point
Returns: Point - new instance equals this point

point.abs ⇒ Point

gets absolute Point

Kind: instance property of Point
Returns: Point - returns Point with absolute values

point.substract(point) ⇒ Point

substracts 2 points

Kind: instance method of Point
Returns: Point - instance of Point for chaining
Params

point.add(point) ⇒ Point

adds 2 points

Kind: instance method of Point
Returns: Point - instance of Point for chaining
Params

point.multiply(x, y) ⇒ Point

multiplicates a point with a given x and y

Kind: instance method of Point
Returns: Point - instance of Point for chaining
Params

point.divide(x, y) ⇒ Point

divide a point with a given x and y

Kind: instance method of Point
Returns: Point - instance of Point for chaining
Params

point.equals(point) ⇒ Boolean

check if points are equal

Kind: instance method of Point
Returns: Boolean - is true, if x and y are the same
Params

point.distance(point) ⇒ Point

Returns the distance from this Point to a specified Point

Kind: instance method of Point
Returns: Point - the distance between this Point and specified point
Params

point.translate(x, y) ⇒ Point

translates a point by x and y

Kind: instance method of Point
Returns: Point - instance of Point for chaining
Params

point.position(x, y) ⇒ Point

positions a point by x and y

Kind: instance method of Point
Returns: Point - instance of Point for chaining
Params

point.toArray() ⇒ Array

translates a Point to an array

Kind: instance method of Point
Returns: Array - Returns Point as Array(x, y)

Point.createFromPoint(point) ⇒ Point

Creates a Point from specified point

Kind: static method of Point
Returns: Point - the point specified
Params

Publisher

Kind: global class

new Publisher(id)

Returns: Publisher - singleton instance of Publisher for chaining
Params

publisher.subscribe(type, fn) ⇒ Publisher

subscribe to a topic

Kind: instance method of Publisher
Returns: Publisher - instance of Publisher for chaining
Params

publisher.unsubscribe(type, fn) ⇒ Publisher

unsubscribe from a topic

Kind: instance method of Publisher
Returns: Publisher - instance of Publisher for chaining
Params

publisher.publish(type, arg) ⇒ Publisher

publish to a topic

Kind: instance method of Publisher
Returns: Publisher - instance of Publisher for chaining
Params

publisher.handle(action, type, a) ⇒ Publisher

handle subscribe to a topic

Kind: instance method of Publisher
Returns: Publisher - instance of Publisher for chaining
Params

publisher.destroy()

destroys singleton instance

Kind: instance method of Publisher

Publisher.instances : Object

singleton instance wrapper

Kind: static property of Publisher

Rectangle

Kind: global class

new Rectangle(x, y, width, height)

Returns: Rectangle - instance of Rectangle for chaining
Params

rectangle.center ⇒ Point

get center-position of rectangle

Kind: instance property of Rectangle
Returns: Point - center point

rectangle.topLeft ⇒ Point

get top-left-position of rectangle

Kind: instance property of Rectangle
Returns: Point - top-left point

rectangle.topRight ⇒ Point

get top-right-position of rectangle

Kind: instance property of Rectangle
Returns: Point - top-right point

rectangle.bottomLeft ⇒ Point

get bottom-left-position of rectangle

Kind: instance property of Rectangle
Returns: Point - bottom-left point

rectangle.bottomRight ⇒ Point

get bottom-right-position of rectangle

Kind: instance property of Rectangle
Returns: Point - bottom-right point

rectangle.right ⇒ Number

Returns right position of Rectangle

Kind: instance property of Rectangle
Returns: Number - right position

rectangle.left ⇒ Number

Returns left position of Rectangle

Kind: instance property of Rectangle
Returns: Number - left position

rectangle.top ⇒ Number

Returns top position of Rectangle

Kind: instance property of Rectangle
Returns: Number - top position

rectangle.bottom ⇒ Number

Returns bottom position of Rectangle

Kind: instance property of Rectangle
Returns: Number - bottom position

rectangle.clone ⇒ Rectangle

clones a rectangle

Kind: instance property of Rectangle
Returns: Rectangle - duplicated rectangle

rectangle.intersects(rect) ⇒ Boolean

Checks whether Rectangle intersects with specified Rectangle

Kind: instance method of Rectangle
Returns: Boolean - true if containment is entirely
Params

rectangle.contains(rectOrPoint) ⇒ Boolean

Checks whether Rectangle entirely contains the Rectangle or Point

Kind: instance method of Rectangle
Returns: Boolean - true if containment is entirely
Params

rectangle.extend(rect) ⇒ Rectangle

extend a rectangle by specified rectangle dimensions

Kind: instance method of Rectangle
Returns: Rectangle - instance of Rectangle for chaining
Params

rectangle.setCenter(point) ⇒ Rectangle

Sets the center of this Rectangle to specified point

Kind: instance method of Rectangle
Returns: Rectangle - instance of Rectangle for chaining
Params

rectangle.setCenterX(x) ⇒ Rectangle

Sets the x-center of this Rectangle to specified x

Kind: instance method of Rectangle
Returns: Rectangle - instance of Rectangle for chaining
Params

rectangle.setCenterY(y) ⇒ Rectangle

Sets the y-center of this Rectangle to specified y

Kind: instance method of Rectangle
Returns: Rectangle - instance of Rectangle for chaining
Params

rectangle.containsPoint(point) ⇒ Boolean

Checks whether Rectangle entirely contains the Point

Kind: instance method of Rectangle
Returns: Boolean - true if containment is entirely
Params

rectangle.containsRect(rect) ⇒ Boolean

Checks whether Rectangle entirely contains the Rectangle

Kind: instance method of Rectangle
Returns: Boolean - true if containment is entirely
Params

rectangle.getDistortedRect(factor) ⇒ Rectangle

distorts rectangle by factor

Kind: instance method of Rectangle
Returns: Rectangle - a distorted Rectangle
Params

rectangle.getNormalRect(factor) ⇒ Rectangle

redistorts rectangle by factor

Kind: instance method of Rectangle
Returns: Rectangle - an undistorted Rectangle
Params

rectangle.scaleX(x) ⇒ Rectangle

scale x and width of rectangle

Kind: instance method of Rectangle
Returns: Rectangle - instance of Rectangle for chaining
Params

rectangle.scaleY(y) ⇒ Rectangle

scale y and height of rectangle

Kind: instance method of Rectangle
Returns: Rectangle - instance of Rectangle for chaining
Params

rectangle.scale(x, y) ⇒ Rectangle

scale x and y for width and height of rectangle

Kind: instance method of Rectangle
Returns: Rectangle - instance of Rectangle for chaining
Params

rectangle.scaleCenter(x, y) ⇒ Rectangle

scale x and y for width and height of rectangle

Kind: instance method of Rectangle
Returns: Rectangle - instance of Rectangle for chaining
Params

rectangle.translate(x, y) ⇒ Rectangle

moves a rectangle by specified coords

Kind: instance method of Rectangle
Returns: Rectangle - instance of Rectangle for chaining
Params

rectangle.transform(x, y, width, height) ⇒ Rectangle

transforms a rectangle by specified coords

Kind: instance method of Rectangle
Returns: Rectangle - instance of Rectangle for chaining
Params

rectangle.position(x, y) ⇒ Rectangle

changes the position a rectangle by specified coords

Kind: instance method of Rectangle
Returns: Rectangle - instance of Rectangle for chaining
Params

rectangle.size(x, y, width, height) ⇒ Rectangle

changes the size of a rectangle by specified params

Kind: instance method of Rectangle
Returns: Rectangle - instance of Rectangle for chaining
Params

rectangle.setSize(width, height) ⇒ Rectangle

changes the size of a rectangle by specified params

Kind: instance method of Rectangle
Returns: Rectangle - instance of Rectangle for chaining
Params

rectangle.equals(rectangle) ⇒ Boolean

check if rectangles are equal

Kind: instance method of Rectangle
Returns: Boolean - is true, if x, y, width and height are the same
Params

Rectangle.createFromRectangle(rect) ⇒ Rectangle

Creates a Rectangle from specified Rectangle

Kind: static method of Rectangle
Returns: Rectangle - a copy of specified rectangle
Params

Kind: global class

new SideBar(container, path, templates, id)

Returns: SideBar - instance of SideBar for chaining
Params

checks if all templates were loaded

Kind: instance property of SideBar
Returns: Boolean - wheter true if all templates were loaded or false

initialize boot up after Handlebars is loaded

Kind: instance method of SideBar
Returns: SideBar - instance of SideBar for chaining
Params

initialize all container and DOM objects for SideBar

Kind: instance method of SideBar
Returns: SideBar - instance of SideBar for chaining

register helpers for handlebars

Kind: instance method of SideBar
Returns: SideBar - instance of SideBar for chaining

initialize all templates

Kind: instance method of SideBar
Returns: SideBar - instance of SideBar for chaining
Params

bind all events

Kind: instance method of SideBar
Returns: SideBar - instance of SideBar for chaining

on resize check if sidebar is bottom or left position

Kind: instance method of SideBar
Returns: SideBar - instance of SideBar for chaining

inserts content to SideBar instance container

Kind: instance method of SideBar
Returns: SideBar - instance of SideBar for chaining
Params

opens a sidebar

Kind: instance method of SideBar
Returns: SideBar - instance of SideBar for chaining
Params

closes a sidebar

Kind: instance method of SideBar
Returns: SideBar - instance of SideBar for chaining

sets position of sidebar to left or bottom

Kind: instance method of SideBar
Returns: SideBar - instance of SideBar for chaining

precompiles all Handlebars templates

Kind: instance method of SideBar
Returns: SideBar - instance of SideBar for chaining

StateHandler

Kind: global class

new StateHandler(states_array)

Returns: StateHandler - instance of StateHandler for chaining
Params

stateHandler.current ⇒ Object

get current state

Kind: instance property of StateHandler
Returns: Object - current state from STATES-array

stateHandler.length ⇒ Number

get number of states

Kind: instance property of StateHandler
Returns: Number - number of states

stateHandler.next() ⇒ StateHandler

get the next element

Kind: instance method of StateHandler
Returns: StateHandler - instance of StateHandler for chaining

stateHandler.previous() ⇒ StateHandler

get the previous element

Kind: instance method of StateHandler
Returns: StateHandler - instance of StateHandler for chaining

stateHandler.changeTo(state) ⇒ StateHandler

change the state to specified state

Kind: instance method of StateHandler
Returns: StateHandler - instance of StateHandler for chaining
Params

stateHandler.hasNext() ⇒ Boolean

checks if there is a next element

Kind: instance method of StateHandler
Returns: Boolean - wheter there is a next state or not

stateHandler.hasPrevious() ⇒ Boolean

checks if there is a previous element

Kind: instance method of StateHandler
Returns: Boolean - wheter there is a previous state or not

Texture

Kind: global class

new Texture(path, size, offset)

Returns: Texture - instance of Texture for chaining
Params

texture.initializeHitMap(w, h) ⇒ Texture

initializes an offscreen canvas hitmap

Kind: instance method of Texture
Returns: Texture - instance of Texture for chaining
Params

texture.isHit(point) ⇒ Boolean

checks wheter texture was hit

Kind: instance method of Texture
Returns: Boolean - wheter texture is hit or not
Params

Texture.textures : Array

stores all initialized textures in this array

Kind: static property of Texture

Tile

Kind: global class

new Tile(path, x, y, w, h, context, id)

Returns: Tile - instance of Tile for chaining
Params

tile.distortedTile ⇒ Tile

transform original tile to a distorted tile

Kind: instance property of Tile
Returns: Tile - distorted tile

tile.initialize() ⇒ Tile

initializes tile and starts loading image

Kind: instance method of Tile
Returns: Tile - instance of Tile for chaining

tile.draw() ⇒ Tile

draws image data of tile on context

Kind: instance method of Tile
Returns: Tile - instance of Tile for chaining

Tile.STATES : Array

States of a tile

Kind: static property of Tile

TileMap

Kind: global class

new TileMap(container, path, tilesData, settings, id)

Returns: TileMap - instance of TileMap for chaining
Params

tileMap.width ⇒ Number

Returns width of container

Kind: instance property of TileMap
Returns: Number - - width of container

tileMap.height ⇒ Number

Returns height of container

Kind: instance property of TileMap
Returns: Number - - height of container

tileMap.viewport ⇒ Rectangle

gets current viewport

Kind: instance property of TileMap
Returns: Rectangle - viewport

tileMap.view ⇒ View

current view

Kind: instance property of TileMap
Returns: View - view

tileMap.currentLevel ⇒ Object

current level

Kind: instance property of TileMap
Returns: Object - information of level

tileMap.clusters ⇒ Array

returns all clusters

Kind: instance property of TileMap
Returns: Array - array of clusters

tileMap.initializeLevels(data) ⇒ TileMap

initializes all levels

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining
Params

tileMap.initializeInstanceVariables(id, container, markerData, settings, path) ⇒ TileMap

initialize all variables

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining
Params

tileMap.reset() ⇒ TileMap

resets view to initial state

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining

tileMap.initializeMarkers() ⇒ TileMap

initialize all markers

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining

tileMap.createViewFromData(data) ⇒ View

creates a View from specified parameters

Kind: instance method of TileMap
Returns: View - created View
Params

tileMap.createSidebarContainer() ⇒ TileMap

creates an instance of SideBar

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining

tileMap.bindEvents() ⇒ TileMap

bind all events

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining

tileMap.zoomToBounds(center, boundingBox) ⇒ TileMap

zoom to boundaries on specified center

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining
Params

tileMap.thumbLoaded() ⇒ TileMap

called when thumbnail image was loaded

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining

tileMap.setViewToOldView(center, zoom) ⇒ TileMap

set new view to old views position and zoomlevel

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining
Params

tileMap.changelevel(direction) ⇒ TileMap

change level up or down

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining
Params

tileMap.initializeCanvas() ⇒ TileMap

initializes the canvas, adds to DOM

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining

tileMap.redraw() ⇒ TileMap

complete clear and draw of all visible tiles

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining

tileMap.resize() ⇒ TileMap

Handles resizing of TileMap

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining

tileMap.moveView(delta) ⇒ TileMap

move view by delta

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining
Params

tileMap.zoom(factor, position) ⇒ TileMap

handles zoom by factor and position

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining
Params

tileMap.clusterHandler() ⇒ TileMap

handles creation of clusters

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining

tileMap.resizeCanvas() ⇒ TileMap

resizes the canvas sizes

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining

tileMap.resizeView() ⇒ TileMap

Handles resizing of view

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining

tileMap.mainLoop()

main draw call

Kind: instance method of TileMap

tileMap.clearCanvas() ⇒ TileMap

clears whole canvas

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining

tileMap.drawView() ⇒ TileMap

draws current view

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining

tileMap.checkBoundaries() ⇒ TileMap

checks boundaries

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining

tileMap.calculateDeltaTiming() ⇒ TileMap

calculates current delta timing

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining

tileMap.calculateVelocity(dT) ⇒ TileMap

calculates current velocity

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining
Params

tileMap.checkAoIBoundaries() ⇒ TileMap

checks area of interest boundaries and resets positions if outside

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining

tileMap.drawClusters() ⇒ TileMap

draw all clusters

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining

tileMap.drawMarkers() ⇒ TileMap

draw all markers

Kind: instance method of TileMap
Returns: TileMap - instance of TileMap for chaining

View

Kind: global class

new View(view, data, context, maxZoom, minZoom, aoiBounds, id)

Returns: View - instance of View for chaining
Params

view.visibleTiles ⇒ array

get all visible tiles

Kind: instance property of View
Returns: array - all tiles that are currently visible

view.init() ⇒ View

initializes the view

Kind: instance method of View
Returns: View - instance of View for chaining

view.reset() ⇒ View

resets current View to its initial position

Kind: instance method of View
Returns: View - instance of View for chaining

view.getDistortedView() ⇒ View

distorts this view

Kind: instance method of View
Returns: View - [distorted View]

view.checkBoundaries() ⇒ View

check boundaries of map and bounds

Kind: instance method of View
Returns: View - instance of View for chaining

view.viewportIsSmallerThanView(view) ⇒ Boolean

check if viewport is smaller than view

Kind: instance method of View
Returns: Boolean - true if smaller, else false
Params

view.checkX(left, right, mapWidth, viewWidth) ⇒ Number

check x boundaries

Kind: instance method of View
Returns: Number - calculated x to be in viewport
Params

view.checkY(top, bottom, mapHeight, viewHeight) ⇒ Number

check y boundaries

Kind: instance method of View
Returns: Number - calculated y to be in viewport
Params

view.loadThumb() ⇒ View

loads thumbnail of view

Kind: instance method of View
Returns: View - instance of View for chaining

view.setLatLngToPosition(latlng, position) ⇒ View

set specified lat/lng to position x/y

Kind: instance method of View
Returns: View - instance of View for chaining
Params

view.getDeltaXToCenter(pos) ⇒ Number

receive relative Position to center of viewport

Kind: instance method of View
Returns: Number - delta of point to center of viewport
Params

view.zoom(factor, pos, automatic) ⇒ Number

zooming handler

Kind: instance method of View
Returns: Number - indicates if direction has changed
Params

view.changeZoomLevelIfNecessary(factor, viewportIsSmaller) ⇒ Number

changes zoom level if its necessary

Kind: instance method of View
Returns: Number - indicates if direction has changed
Params

view.calculateNewCenter() ⇒ View

update center position of view

Kind: instance method of View
Returns: View - instance of View for chaining

view.moveView(pos) ⇒ View

moves the view's current position by pos

Kind: instance method of View
Returns: View - instance of View for chaining
Params

view.draw() ⇒ View

Handles draw of visible elements

Kind: instance method of View
Returns: View - instance of View for chaining

view.drawVisibleTiles() ⇒ View

draws all visible tiles

Kind: instance method of View
Returns: View - instance of View for chaining

view.drawThumbnail() ⇒ View

draws the thumbnail

Kind: instance method of View
Returns: View - instance of View for chaining

view.initializeTiles() ⇒ View

initializes tiles

Kind: instance method of View
Returns: View - instance of View for chaining

Events : object

Helper for naming events

Kind: global namespace
Author: Michael Duve mduve@designmail.net
Copyright: Michael Duve 2016

Events.SideBar : Object

Eventnames for SideBar class

Kind: static property of Events
Properties

Events.Publisher : Object

Eventnames for Publisher class

Kind: static property of Events
Properties

Events.TileMap : Object

Eventnames for TileMap class

Kind: static property of Events
Properties

Events.Handling : Object

Eventnames for Handling in all classes

Kind: static property of Events
Properties

Events.View : Object

Eventnames for View class

Kind: static property of Events
Properties

Events.MarkerClusterer : Object

Eventnames for MarkerClusterer class

Kind: static property of Events
Properties

Events.MapInformation : Object

Eventnames for MapInformation class

Kind: static property of Events
Properties

Events.General : Object

Eventnames for MappedJS class

Kind: static property of Events
Properties