Home > @magiclane/maps-sdk > ContentStoreItem
ContentStoreItem class
A single downloadable content product managed by the ContentStore.
This class models one content product (for example: a map/region, style, or voice pack). Do not construct instances directly; obtain items from the public ContentStore API.
The object exposes identification and localized display text, content type and language, size and downloaded-size metrics, availability/status and progress indicators, preview imagery, additional content-specific parameters and update metadata (version and update size).
Use this object to start/pause/cancel downloads, query state, access previews and delete local content.
Content
Signature:
export declare class ContentStoreItem Constructors
|
Constructor |
Modifiers |
Description |
|---|---|---|
|
Constructs a new instance of the |
Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
|
number |
Gets the available size of the content in bytes. | |
|
|
boolean |
Returns true if the associated content can be deleted. | |
|
|
string |
Get the product chapter name translated to interface language. Relevant for ContentType.roadMap items, where large countries are split in multiple downloadable pieces. All items from the same chapter share the same chapter name. The value is empty when the item is not a road map item or when the country is not split. | |
|
|
Gets the client version of the content (local downloaded version). | ||
|
|
Gets additional parameters for the content item. | ||
|
|
string[] |
Get the country code (ISO 3166-1 alpha-3) list of the product as text. The list is empty for non-road-map products. | |
|
|
number |
Gets the current download progress (0..100). | |
|
|
string |
Get the full path to the local content data file when available. Not downloaded content returns an empty string. | |
|
|
number |
Get the unique id of the item in the content store. | |
|
|
Gets the item image preview as an Img object. Caller must check validity. | ||
|
|
boolean |
Returns true if the item is completely downloaded. | |
|
|
boolean |
Returns true if an image preview is available for this item. | |
|
|
boolean |
Returns true if the item is updatable (has a newer version available). | |
|
|
Get the language of the product. The returned Language may be null if the product has no associated language. | ||
|
|
string |
Get the name of the associated product. The name is automatically translated based on the SDK settings language. | |
|
|
any |
Returns the internal pointer id for this item. | |
|
|
any |
Gets the current progress listener for this item, or null if not set. | |
|
|
Gets the current item status as a ContentStoreItemStatus value. | ||
|
|
number |
Gets the size of the content in bytes. | |
|
|
any |
Get the content type of the product. | |
|
|
ContentStoreItem | null |
Gets the corresponding update item if an update is in progress, or null. | |
|
|
number |
Gets the update size in bytes if an update is available for this item. | |
|
|
Gets the update version if an update is available for this item. |
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
Asynchronously starts or resumes the download of the content store product content. Requires automatic map rendering. Disables the cursor if enabled. | ||
|
Cancels a previous download operation. Partially downloaded content is deleted. | ||
|
Deletes the associated content. Operation is immediate; no notifications are triggered. | ||
|
Releases native resources associated with this object. | ||
|
Gets a binary image preview if available. Returns null if not available. | ||
|
| ||
|
Pauses a previous download operation. Optionally provide an onComplete callback. Returns GemError.success on success, otherwise see GemError for other values. | ||
|
Sets a progress listener for this item. |