Class: StoryMap

mcutils. StoryMap

StoryMap object that contains the Carte


new StoryMap(options [, target], key, url, id, fullscreen)

Constructor

Parameters:
Name Type Argument Description
options *
target string | Element <optional>
key string

GPP api key

url string

StoryMap file url

id string

StoryMap id

fullscreen boolean
Source:
StoryMap.js
Fires:
  • event:read
  • read:start
  • change:carte
  • change:step
  • change:tab

Members


getUrlParameter

Get url parameters

Source:
StoryMap.js

getUrlPosition

Get position passed by the url

Source:
StoryMap.js

models

StoryMap model def

Source:
StoryMap.js

resetUrlPosition

Reset position passed by the url

Source:
StoryMap.js

Methods


addTab(options)

Add a new tab to the story

Parameters:
Name Type Description
options TabOptions

an objet with an id and a title

Properties
Name Type Description
title string

button info title

id string

narrative id

description string

button hover title

showTitle boolean
Source:
StoryMap.js

addToolBar(options, import, measure, draw, options)

Add stoymap tool bar

Parameters:
Name Type Description
options Object
import boolean
measure boolean
draw boolean
options boolean
Source:
StoryMap.js

clearCarte()

Remove all existing cartes

Source:
StoryMap.js

clearInfoVolet()

Clear volet info

Source:
StoryMap.js

clearTabs()

Remove all tabs

Source:
StoryMap.js

freezeStep( [b])

Prevent change step manually

Parameters:
Name Type Argument Description
b boolean <optional>

if undefined return if the steps are frozen

Source:
StoryMap.js
Returns:
Type
boolean

fullscreen( [b])

Display StoryMap fullscreen

Parameters:
Name Type Argument Description
b boolean <optional>

if not defined returns true if fullscreen

Source:
StoryMap.js
Returns:
Type
boolean

getCarte(n)

Get carte

Parameters:
Name Type Description
n number

carte number 0 or 1

Source:
StoryMap.js
Returns:
Type
mcutils.Carte

getIndicators()

Get indicator list

Source:
StoryMap.js
Returns:

[indicators]

Type
Collection

getSelectColor(select)

Get select color

Parameters:
Name Type Description
select string

interaction name (select1 or select2)

Source:
StoryMap.js
Returns:

color

Type
ol/colorLike

getSelectTabIndex()

Get the selected tab index

Source:
StoryMap.js
Returns:

index

Type
number

getSteps()

Get StoryMap steps whe type=etape

Source:
StoryMap.js
Returns:
Type
Collection

getTab(index)

Get a tab

Parameters:
Name Type Description
index number
Source:
StoryMap.js

getTabLength()

Get the tabs length

Source:
StoryMap.js

getViewerUrl(options)

Get the map viewer url

Parameters:
Name Type Description
options Object
Source:
StoryMap.js
Returns:
Type
string

hasControl(name)

Story has a control

Parameters:
Name Type Description
name string

control id

Source:
StoryMap.js
Returns:
Type
boolean

hasPopup()

Check if StoryMap has a popup

Source:
StoryMap.js

hasVolet()

Check if StoryMap has a volet

Source:
StoryMap.js

load(c)

Load StoryMap from server

Parameters:
Name Type Description
c AtlasDef | string

Story definition or the story id

Source:
StoryMap.js

print(n [, callback])

Print the map

Parameters:
Name Type Argument Description
n number

carte number

callback function <optional>

if defined perform a fast print and returns the resulting canvas as callback argument

Source:
StoryMap.js

read(options [, atlas])

Read the carte

Parameters:
Name Type Argument Default Description
options string | *

carte url or carte options object

atlas AtlasDef <optional>
{}
Source:
StoryMap.js

readData(data, [, id] [, c])

Read a storymap from data

Parameters:
Name Type Argument Description
data, Object
id string <optional>
c Object <optional>

carte desc

Source:
StoryMap.js

removeTab(index)

Add a new tab to the story

Parameters:
Name Type Description
index number
Source:
StoryMap.js

reorderTabs()

Reorder tab

Source:
StoryMap.js

reset()

Reset story, remove existing maps and set a new standard story

Source:
StoryMap.js

selectTab(index)

Add a new tab to the story

Parameters:
Name Type Description
index number
Source:
StoryMap.js

setCarte(carte, n)

Set carte

Parameters:
Name Type Description
carte mcutils.Carte
n number

carte number 0 or 1

Source:
StoryMap.js

setCompare(mode)

Set compare mode

Parameters:
Name Type Description
mode string
Source:
StoryMap.js

setControl(controlName, enable)

Set control a control on the map

Parameters:
Name Type Description
controlName string
enable boolean | Object
Source:
StoryMap.js

setControls( [controls])

Set controls

Parameters:
Name Type Argument Description
controls Object <optional>

{ controlName : boolean } object to set the control in the map, if none update the current controls

Source:
StoryMap.js

setDescription(description)

Set story description

Parameters:
Name Type Description
description string
Source:
StoryMap.js

setIndicators( [indicators])

Add indicators (user variables) to the story (differentiel model) Use story.get('indicator') to get current value

Parameters:
Name Type Argument Description
indicators Array.<Object> <optional>
Source:
StoryMap.js

setInfoVolet(md, sel2)

Display markdown in the tab or a dialog

Parameters:
Name Type Description
md string
sel2 boolean

second selection (model differentiel)

Source:
StoryMap.js

setLayerSelection( [title] [, layers])

Set layers that can be selected in a differentiel model

Parameters:
Name Type Argument Description
title string <optional>
layers Array.<ol/Layer> <optional>

default: all selectable layers

Source:
StoryMap.js

setLayout()

Set the layout

Parameters:
Name Type Argument Description
layout.theme string <optional>
layout.colors Array.<ol.color> | string <optional>

[bgColor, txtColor, darkColor, lightColor] used if theme='custom'

layout.voletPosition string
layout.voletWidth number
Source:
StoryMap.js

Set logo

Parameters:
Name Type Description
src string
Source:
StoryMap.js

setModel( [model])

Set model

Parameters:
Name Type Argument Description
model string <optional>

model name, if none update the current one

Source:
StoryMap.js

setPopup( [options], type, closeBox, maxWidth, maxHeight, anime, shadow)

Set popup options

Parameters:
Name Type Argument Description
options Object <optional>

if not defined set current options

type string
closeBox boolean
maxWidth number
maxHeight number
anime boolean
shadow boolean
Source:
StoryMap.js

setSelectColor(select, color)

Set select color

Parameters:
Name Type Description
select string

interaction name (select1 or select2)

color ol/colorLike
Source:
StoryMap.js

setStep(n [, anim])

Show step

Parameters:
Name Type Argument Default Description
n number

step number

anim boolean <optional>
true
Source:
StoryMap.js

setTabTitle(index, title, description)

Change tab title

Parameters:
Name Type Description
index number
title string
description string
Source:
StoryMap.js

setTarget(target)

Set the story target

Parameters:
Name Type Description
target string | Element

target id or target element

Source:
StoryMap.js

setTips( [options], hover, shadow)

Set popup tips

Parameters:
Name Type Argument Description
options Object <optional>

if not defined set current options

hover boolean
shadow boolean
Source:
StoryMap.js

setTitle(options)

Set Title

Parameters:
Name Type Description
options Object
Properties
Name Type Argument Description
title string <optional>
subTitle string <optional>
title1 string <optional>
title2 string <optional>
Source:
StoryMap.js

showInfoDialog(md [, delay])

Show info dialog

Parameters:
Name Type Argument Description
md string
delay number <optional>

delay (ms) before auto close, default no auto close

Source:
StoryMap.js

showTabTitle(index, show)

Show tab map title

Parameters:
Name Type Description
index number
show boolean

show the map title

Source:
StoryMap.js

showTitle( [b])

Show/hide title

Parameters:
Name Type Argument Description
b boolean <optional>

if not defined returns true if shown

Source:
StoryMap.js
Returns:
Type
boolean

showTOC(current)

Show Table of content

Parameters:
Name Type Description
current number

step number

Source:
StoryMap.js

start()

Start playing the StoryMap

Source:
StoryMap.js

switcherModel()

Render the switcher model Use Storymap~Storymap.setControl('switcherModel', model) to set the model value

Source:
StoryMap.js

updateMapSize()

Update map

Source:
StoryMap.js

useUrlPosition()

Use the position passed by the url

Source:
StoryMap.js

write()

Save a storymap

Source:
StoryMap.js
Returns:
Type
Object