Skip to main content

flywave-mapview.copyrightelementhandler

Home > @flywave/flywave-mapview > CopyrightElementHandler

CopyrightElementHandler class

Helper class that maintains up-to-date MapView copyright information in DOM element.

Signature:

export declare class CopyrightElementHandler 

Example

// JavaScript const mapView = new MapView({ ... }); CopyrightElementHandler.install("copyrightNotice", mapView);

Constructors

Constructor

Modifiers

Description

(constructor)(element, mapView)

Creates a new CopyrightElementHandler that updates the DOM element with the copyright info of the given mapView.

Note: Generally, the static [[install]] method can be used to create and attach a new CopyrightElementHandler to a MapView

Properties

Property

Modifiers

Type

Description

staticInfo

CopyrightInfo[] | undefined

Static copyright info.

Use when MapView's DataSource's do not provide proper copyright information.

update

() => void

Update copyright info text in controlled HTML element.

Methods

Method

Modifiers

Description

attach(mapView)

Attaches this updates from MapView instance.

destroy()

Destroys this object by removing all event listeners from the attached MapViews.

detach(mapView)

Stop following updates from MapView instance.

install(element, mapView)

static

Install CopyrightElementHandler on DOM element and - optionally - attach to a MapView instance.

setDefaults(defaults)

Set defaults to be used in case DataSource does not provide deatailed copyright information.

setStaticCopyightInfo(staticInfo)

Sets the [[staticInfo]] property.

A CopyrightElementHandler always displays a deduplicated sum of static copyright info and copyright information obtained from attached MapViews.

This information is used when DataSource instances of given MapView do not provide copyright information.