Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Using the API

Maximilian Bandle edited this page Mar 19, 2016 · 6 revisions

Modal

##Show the modal This method launches a bootstrap modal. Internally this function is used when clicking on a character or city.

mymap.showModal(callback, information, cssclass)

###callback This function is invoked after launching the modal.

function (modal, information) {
  var body = modal.find(".modal-body"); // Body Element
}

###information This object is passed as second object to the callback function. Should have the property name, which is used to display he modal title.

###cssclass This string is added to the className of the modal. Internally used to display icons in front of the modal title.

##Hide the modal This function hides the modal. When the modal is hidden nothing will happen.

mymap.hideModal()

Characters

##Search for a character

mymap.searchCharacter(name)

##Add a character

You have to pass the character information given by searchCharacter. This adds the character to the list and displays the information on the map. Also focusOnCharacter is performed. The ID of the new character is returned.

mymap.addCharacter(character)

##Zoom in on character

mymap.focusOnCharacter(id)

##Remove a character

This function removes the character from the list and all pins from the map. The id is returned by addCharacter.

mymap.removeCharacter(id)

##Show a character

mymap.showCharacter(id)

##Hide a character

mymap.hideCharacter(id)

##Toggle a character

mymap.toggleCharacter(id)

##Remove all characters

mymap.removeAllCharacters()

##Show all Characters

mymap.showAllCharacters()

##Hide all Characters

mymap.hideAllCharacters()

Refresh map display

##Updates the map (by updating paths, characters, realms):

mymap.updateMap([array] range)

Realms

##Show realms

mymap.showRealms([bool] color)

##Hide realms

mymap.hideRealms()

##Toggle realms

mymap.toggleRealms()

Credits:

> mymap.getCredits()
< "GoT Map by Maximilian Bandle, Alexander Beischl und Tobias Piffrader"
Clone this wiki locally