Class: Carte

mcutils. Carte

Carte object


new Carte(options)

Constructor

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

GPP api key

url string

carte file url

id string

carte id

Source:
Carte.js
Fires:
  • event:loading
  • read:start
  • event:read
  • event:error
  • event:authenticate

Methods


addSymbolLib(options, name [, feature] [, style] [, type])

Add a feature style to the symbol lib

Parameters:
Name Type Argument Description
options options
name string

symbol name

feature Feature <optional>

feature the feature to get symbol, if none give a style / type

style ignStyle <optional>

style to apply (if no feature)

type string <optional>

geometry type Point|LineString|Polygon

Source:
Carte.js
Returns:

the symbol or false

Type
SymbolLib

authenticate( [cback] [, errro])

Authenticate carte when layers are private / Espace co

Parameters:
Name Type Argument Description
cback function <optional>

a callback function when authenticated

errro boolean <optional>

true if an error occured (internal)

Source:
Carte.js
Fires:
  • event:authenticate

dialogInfo()

Show carte info dialog

Source:
Carte.js

getControl(name)

Get map control

Parameters:
Name Type Description
name string
Source:
Carte.js
Returns:
Type
Control

getDialog()

Get a dialog

Source:
Carte.js

getInteraction(name)

Get interaction

Parameters:
Name Type Description
name string
Source:
Carte.js
Returns:
Type
ol.interaction.Interaction

getMap()

Get the ol map

Source:
Carte.js
Returns:
Type
Map

getSelect()

Get select interaction

Source:
Carte.js
Returns:
Type
Select

getSymbolLib( [what])

Get the list of symbol lib

Parameters:
Name Type Argument Description
what number | string <optional>

the index or the name of the style, if non return the whole list

Source:
Carte.js
Returns:

return null if not found

Type
Collection.<symbolLib> | symbolLib

getToolbar()

Get Tool bar

Source:
Carte.js
Returns:
Type
Control

getViewerUrl(carte)

Get the map viewer url

Parameters:
Name Type Description
carte Object
Properties
Name Type Argument Default Description
showTitle boolean <optional>
true
noZoom boolean <optional>
false
position Array.<number> <optional>
Source:
Carte.js
Returns:

viewer url

Type
string

hasControl(name)

Map has control

Parameters:
Name Type Description
name string

control id

Source:
Carte.js
Returns:
Type
boolean

load(c)

Load carte from server

Parameters:
Name Type Description
c AtlasDef | string

Carte definition or the carte id

Source:
Carte.js

notification(what [, duration])

Display a notification on the map

Parameters:
Name Type Argument Default Description
what string | node | undefined

the notification to show, default get the last one

duration number <optional>
3000

duration in ms, if -1 never hide

Source:
Carte.js

popupFeature(feature, coord)

Show a popup

Parameters:
Name Type Description
feature Feature
coord ol.coordinate
Source:
Carte.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:
Carte.js

setParent(parent)

Set parent Storymap

Parameters:
Name Type Description
parent Story
Source:
Carte.js

setReady()

Show map on ready

Source:
Carte.js

setSelection(feature [, select])

Set current selection

Parameters:
Name Type Argument Description
feature Feature
select string <optional>

name: select, select1 or select2

Source:
Carte.js

setSelectStyle(options)

Get select interaction

Parameters:
Name Type Description
options Object
Properties
Name Type Description
type string

selection type default|zoom|overlay

points boolean

show points on lines

Source:
Carte.js

showControl(name [, show])

Show/hide a control

Parameters:
Name Type Argument Default Description
name string

control id

show boolean <optional>
true
Source:
Carte.js

write()

Save a storymap

Source:
Carte.js
Returns:
Type
Object

zoomToClusterExtent(features)

Zoom map to features extend

Parameters:
Name Type Description
features Array.<ol.Feature>

features you want to zoom to

Source:
Carte.js