-
Notifications
You must be signed in to change notification settings - Fork 3
Using the API
##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()
##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()
##Updates the map (by updating paths, characters, realms):
mymap.updateMap([array] range)
##Show realms
mymap.showRealms([bool] color)
##Hide realms
mymap.hideRealms()
##Toggle realms
mymap.toggleRealms()
> mymap.getCredits()
< "GoT Map by Maximilian Bandle, Alexander Beischl und Tobias Piffrader"
GoT Map by Maximilian Bandle, Tobias Piffrader and Alexander Beischl