Home Manual Reference Source Repository
import Mapcreator from '@mapcreator/api/src/Mapcreator.js'
public class | source

Mapcreator

Extends:

* → Mapcreator

Base API class

Constructor Summary

Public Constructor
public

constructor(auth: OAuth | string, host: string)

Member Summary

Public Members
public get

auth: OAuth: *

Get authentication provider instance

public set

auth(value: OAuth)

Set authentication provider instance

public get

Test if the client is authenticated with the api and has a valid token

public get

Choropleth accessor

public get

Color accessor

public get

Contract accessor

public get

Dimension set accessor

public get

Dimension accessor

public get

Faq accessor

public get

Featured jobs accessor

public get

Feature accessor

public get

FontFamily accessor

public get

Font accessor

public get

Highlight accessor

public get

host: string: *

The current host

public set

host(value: string)

The remote host

public get

InsetMap accessor

public get

JobShare accessor

public get

JobType accessor

public get

Job accessor

public get

ky: function: *

Mapcreator ky instance This ky instance takes care of the API communication.

public get

Language accessor

public get

LayerFaq accessor

public get

Layer group accessor

public get

Layer accessor

public get

Get logger instance

public get

MapstyleSet accessor

public get

Mapstyle accessor

public get

Message accessor

public get

Notification accessor

public get

Organisation accessor

public get

Permission accessor

public get

Product tour step accessor

public get

Product tour accessor

public get

Role accessor

public get

SvgSet accessor

public get

Svg accessor

public get

Tag accessor

public get

Tag accessor

public get
public get

User accessor

public get

VectorChoropleth accessor

public get

VectorHighlight accessor

public get

Get api version

Method Summary

Public Methods
public

Authenticate with the api using the authentication method provided.

public

Get font styles

public

Get SVG set types

public

Forget the current session This will clean up any stored OAuth states stored using StateContainer and any OAuth tokens stored

public

saveToken(name: string)

Saves the session token so that it can be recovered at a later time.

public

static(Target: string | Class, Constructor: Class?): ResourceProxy

Static proxy generation

public

wrapKy(wrapper: *, args: ...*)

Public Constructors

public constructor(auth: OAuth | string, host: string) source

Params:

NameTypeAttributeDescription
auth OAuth | string

Authentication flow

host string

Remote API host

Public Members

public get auth: OAuth: * source

Get authentication provider instance

Return:

OAuth

OAuth instance

public set auth(value: OAuth) source

Set authentication provider instance

public get authenticated: boolean: * source

Test if the client is authenticated with the api and has a valid token

Return:

boolean

If the client is authenticated with the api

public get choropleths: GeoResourceProxy<Choropleth>: * source

Choropleth accessor

Return:

GeoResourceProxy<Choropleth>

A proxy for accessing the resource

See:

public get colors: ResourceProxy<Color>: * source

Color accessor

Return:

ResourceProxy<Color>

A proxy for accessing the resource

See:

public get contracts: ResourceProxy<Contract>: * source

Contract accessor

Return:

ResourceProxy<Contract>

A proxy for accessing the resource

See:

public get dimensionSets: ResourceProxy<DimensionSet>: * source

Dimension set accessor

Return:

ResourceProxy<DimensionSet>

A proxy for accessing the resource

See:

public get dimensions: ResourceProxy<Dimension>: * source

Dimension accessor

Return:

ResourceProxy<Dimension>

A proxy for accessing the resource

See:

public get faqs: ResourceProxy<Faq>: * source

Faq accessor

Return:

ResourceProxy<Faq>

A proxy for accessing the resource

See:

public get featuredMaps: SimpleResourceProxy<Job>: * source

Featured jobs accessor

Return:

SimpleResourceProxy<Job>

A proxy for accessing the resource

See:

public get features: ResourceProxy<Feature>: * source

Feature accessor

Return:

ResourceProxy<Feature>

A proxy for accessing the resource

See:

public get fontFamilies: ResourceProxy<FontFamily>: * source

FontFamily accessor

Return:

ResourceProxy<FontFamily>

A proxy for accessing the resource

See:

public get fonts: ResourceProxy<Font>: * source

Font accessor

Return:

ResourceProxy<Font>

A proxy for accessing the resource

See:

public get highlights: GeoResourceProxy<Highlight>: * source

Highlight accessor

Return:

GeoResourceProxy<Highlight>

A proxy for accessing the resource

See:

public get host: string: * source

The current host

Return:

string

The current host

public set host(value: string) source

The remote host

public get insetMaps: GeoResourceProxy<InsetMap>: * source

InsetMap accessor

Return:

GeoResourceProxy<InsetMap>

A proxy for accessing the resource

See:

public get jobShares: ResourceProxy<JobShare>: * source

JobShare accessor

Return:

ResourceProxy<JobShare>

A proxy for accessing the resource

See:

public get jobTypes: ResourceProxy<JobType>: * source

JobType accessor

Return:

ResourceProxy<JobType>

A proxy for accessing the resource

See:

public get jobs: ResourceProxy<Job>: * source

Job accessor

Return:

ResourceProxy<Job>

A proxy for accessing the resource

See:

public get ky: function: * source

Mapcreator ky instance This ky instance takes care of the API communication. It has the following responsibilities:

  • Send authenticated requests to the API
  • Transform errors returned from the API into ApiError and ValidationError if possible
  • Wait when the rate limiter responds with a 429 and retry later
  • Prefix urls with the api domain if needed

Return:

function

See:

  • https://github.com/sindresorhus/ky

public get languages: ResourceProxy<Language>: * source

Language accessor

Return:

ResourceProxy<Language>

A proxy for accessing the resource

See:

public get layerFaqs: ResourceProxy<LayerFaq>: * source

LayerFaq accessor

Return:

ResourceProxy<LayerFaq>

A proxy for accessing the resource

See:

public get layerGroups: ResourceProxy<LayerGroup>: * source

Layer group accessor

Return:

ResourceProxy<LayerGroup>

A proxy for accessing the resource

See:

public get layers: ResourceProxy<Layer>: * source

Layer accessor

Return:

ResourceProxy<Layer>

A proxy for accessing the resource

See:

public get logger: Logger: * source

Get logger instance

Return:

Logger

Logger instance

public get mapstyleSets: ResourceProxy<MapstyleSet>: * source

MapstyleSet accessor

Return:

ResourceProxy<MapstyleSet>

A proxy for accessing the resource

See:

public get mapstyles: ResourceProxy<Mapstyle>: * source

Mapstyle accessor

Return:

ResourceProxy<Mapstyle>

A proxy for accessing the resource

See:

public get messages: ResourceProxy<Message>: * source

Message accessor

Return:

ResourceProxy<Message>

A proxy for accessing the resource

See:

public get notifications: ResourceProxy<Notification>: * source

Notification accessor

Return:

ResourceProxy<Notification>

A proxy for accessing the resource

See:

public get organisations: ResourceProxy<Organisation>: * source

Organisation accessor

Return:

ResourceProxy<Organisation>

A proxy for accessing the resource

See:

public get permissions: ResourceProxy<Permission>: * source

Permission accessor

Return:

ResourceProxy<Permission>

A proxy for accessing the resource

See:

public get productTourSteps: ResourceProxy<ProductTourStep>: * source

Product tour step accessor

Return:

ResourceProxy<ProductTourStep>

A proxy for accessing the resource

See:

public get productTours: ResourceProxy<ProductTour>: * source

Product tour accessor

Return:

ResourceProxy<ProductTour>

A proxy for accessing the resource

See:

public get roles: ResourceProxy<Role>: * source

Role accessor

Return:

ResourceProxy<Role>

A proxy for accessing the resource

See:

public get svgSets: ResourceProxy<SvgSet>: * source

SvgSet accessor

Return:

ResourceProxy<SvgSet>

A proxy for accessing the resource

See:

public get svgs: ResourceProxy<Svg>: * source

Svg accessor

Return:

ResourceProxy<Svg>

A proxy for accessing the resource

See:

public get tagTypes: ResourceProxy<TagType>: * source

Tag accessor

Return:

ResourceProxy<TagType>

A proxy for accessing the resource

See:

public get tags: ResourceProxy<Tag>: * source

Tag accessor

Return:

ResourceProxy<Tag>

A proxy for accessing the resource

See:

public get url: string source

public get users: ResourceProxy<User>: * source

User accessor

Return:

ResourceProxy<User>

A proxy for accessing the resource

See:

public get vectorChoropleths: GeoResourceProxy<VectorChoropleth>: * source

VectorChoropleth accessor

Return:

GeoResourceProxy<VectorChoropleth>

A proxy for accessing the resource

See:

public get vectorHighlights: GeoResourceProxy<VectorHighlight>: * source

VectorHighlight accessor

Return:

GeoResourceProxy<VectorHighlight>

A proxy for accessing the resource

See:

public get version: string: string source

Get api version

Return:

string

Api version

Public Methods

public async authenticate(): Promise<Mapcreator> source

Authenticate with the api using the authentication method provided.

Return:

Promise<Mapcreator>

Current instance

Throw:

OAuthError

ApiError

If the api returns errors

public getFontStyles(): CancelablePromise<Enum> source

Get font styles

Return:

CancelablePromise<Enum>

Contains all the possible font styles

Throw:

ApiError

If the api returns errors

See:

public getSvgSetTypes(): CancelablePromise<Enum> source

Get SVG set types

Return:

CancelablePromise<Enum>

Contains all the possible SVG set types

Throw:

ApiError

If the api returns errors

See:

public logout(): CancelablePromise source

Forget the current session This will clean up any stored OAuth states stored using StateContainer and any OAuth tokens stored

Throw:

ApiError

If the api returns errors

public saveToken(name: string) source

Saves the session token so that it can be recovered at a later time. The wrapper can find the token most of the time if the name parameter is left blank.

Params:

NameTypeAttributeDescription
name string

name of the token

public static(Target: string | Class, Constructor: Class?): ResourceProxy source

Static proxy generation

Params:

NameTypeAttributeDescription
Target string | Class

Constructor or url

Constructor Class?

Constructor for a resource that the results should be cast to

Return:

ResourceProxy

A proxy for accessing the resource

Example:

api.static('/custom/resource/path/{id}/').get(123);
class FooBar extends ResourceBase {
   static get resourceName() {
     return 'custom';
   }
}

api.static(FooBar)
  .get(1)
  .then(console.log);

api.static('/foo-bar-custom', FooBar).lister();

public wrapKy(wrapper: *, args: ...*) source

Params:

NameTypeAttributeDescription
wrapper *
args ...*