Maps API for JavaScript Developer's Guide

H.data.AbstractReader

Class Summary

Extends: H.util.EventTarget

An abstract reader class defines interface for data readers and has general functionality related to fetching data and reader events.

[ For full details, see the Class Details ]

Method Summary

Table 1. Methods
Methods

getLayer () : {H.map.layer.ObjectLayer}

Method returns H.map.layer.ObjectLayer that contains parsed data, and can be added directly to the map. It returns new instance of the class with every invocation. If data hasn't been parsed it will return H.map.layer.ObjectLayer that contains partial information, and reader will add new parsed objects to the layer's provider later on.

getParsedObjects () : {Array<H.map.Object>}

Method returns collection of currently parsed, and converted to H.map.Object data objects. Method returns only currently parsed objects if parsing is ongoing.

getUrl () : {(string | undefined)}

Returns URL of the current file, which is either in process of fetching/parsing or file that has been already parsed.

setUrl (url) : {H.data.AbstractReader}

Method sets reader's URL. Method resets current Reader's state to its initial values (clears data about last parsed objects, etc.), and throws InvalidState exception if Reader's state is not READY or ERROR.

getState () : {H.data.AbstractReader.State}

Returns the reader's processing state for possible states see H.data.AbstractReader.State

parse ()

Method launches parsing of the data file at the current url (see H.data.AbstractReader#setUrl or H.data.AbstractReader). Method uses XHR as a transport therefore same origin policy applies, or server should respond with proper CORS headers.

Events Summary

Table 2. Events
Events

statechange : {H.data.AbstractReader.Event}

Fired when the reader state changes, see H.data.AbstractReader#getState

Class Description

An abstract reader class defines interface for data readers and has general functionality related to fetching data and reader events.

Constructor Details

H.data.AbstractReader(opt_url)

Parameters:
 
opt_url:
{string=} [optional]
 

Method Details

getLayer () : {H.map.layer.ObjectLayer}

Method returns H.map.layer.ObjectLayer that contains parsed data, and can be added directly to the map. It returns new instance of the class with every invocation. If data hasn't been parsed it will return H.map.layer.ObjectLayer that contains partial information, and reader will add new parsed objects to the layer's provider later on.

Returns:
 
{H.map.layer.ObjectLayer}

getParsedObjects () : {Array<H.map.Object>}

Method returns collection of currently parsed, and converted to H.map.Object data objects. Method returns only currently parsed objects if parsing is ongoing.

Returns:
 
{Array<H.map.Object>}

getUrl () : {(string | undefined)}

Returns URL of the current file, which is either in process of fetching/parsing or file that has been already parsed.

Returns:
 
{(string | undefined)}
url

setUrl (url) : {H.data.AbstractReader}

Method sets reader's URL. Method resets current Reader's state to its initial values (clears data about last parsed objects, etc.), and throws InvalidState exception if Reader's state is not READY or ERROR.

Parameters:
 
url:
{string}
 
The new URL
Returns:
 
{H.data.AbstractReader}

getState () : {H.data.AbstractReader.State}

Returns the reader's processing state for possible states see H.data.AbstractReader.State

parse ()

Method launches parsing of the data file at the current url (see H.data.AbstractReader#setUrl or H.data.AbstractReader). Method uses XHR as a transport therefore same origin policy applies, or server should respond with proper CORS headers.

Event Details

statechange: {H.data.AbstractReader.Event}

Fired when the reader state changes, see H.data.AbstractReader#getState

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.