@here/olp-sdk-dataservice-read
Wrapper around a subset of the HERE Open Location Platform Data REST API related to reading data from OLP catalogs
Last updated 3 months ago by here-maps .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @here/olp-sdk-dataservice-read 
SYNC missed versions from official npm registry.

DataService Access Library

Overview

This repository contains the complete source code for the HERE OLP SDK for TypeScript Dataservice Read @here/olp-sdk-dataservice-read project. olp-sdk-dataservice-read is a TypeScript library that will fetch request Layer and Partition data from the OLP catalogs.

Directory Layout

Here is an overview of the top-level files of the repository:

|
+- @here/olp-sdk-dataservice-read
                    |
                    +- lib    # Implementation of the project
                    |
                    +- test   # Test code

Development

Prerequisites

The following NPM packages are required to build/test the library:

- node: >= 10.0.0
- npm: >= 6.0.0

Build

Open a command prompt of the working tree's root directory and type:

npm install
npm run build

Test

Open a command prompt of the working tree's root directory and type:

npm run test

Generate a Bundle

If you want to have a compiled project, you can use bundle commands. After running each of the following commands in the @here/olp-sdk-dataservice-read folder from the root folder, you get the JavaScript bundled files.

To get bundled files with a source map, run:

npm run bundle

To get minified version for production, run:

npm run bundle:prod

To get bundled and minified JavaScript files, run:

npm run prepublish-bundle

Use a Bundle from CDN

Add minified JavaScript files to your html and create an object of userAuth and catalogClient:

<!DOCTYPE html>
<html lang="en">
    <head>
        <script src="https://unpkg.com/@here/olp-sdk-fetch/bundle.umd.min.js"></script>
        <script src="https://unpkg.com/@here/olp-sdk-authentication/bundle.umd.min.js"></script>
        <script src="https://unpkg.com/@here/olp-sdk-dataservice-api/bundle.umd.min.js"></script>
        <script src="https://unpkg.com/@here/olp-sdk-dataservice-read/bundle.umd.min.js"></script>
    </head>
    <body>
        <script>
            /**
             * Authentication with olp-sdk-authentication
             */
            const userAuth = new UserAuth({
                env: "here",
                credentials: {
                    accessKeyId: "your-access-key",
                    accessKeySecret: "your-access-secret"
                },
                tokenRequester: requestToken
            });
            /**
             * Create the `OlpClientSettings` object
             */
            const olpClientSettings = new OlpClientSettings({
                environment:
                "here | here-dev | here-cn | here-cn-dev | http://YourCustomEnvironment",
                getToken: () => userAuth.getToken()
            });
            /**
             * Create client to the volatile layer with VolatileLayerClientParams
             */
            const volatileLayerClient = new VolatileLayerClient({
                    catalogHrn: "CatalogHRN",
                    layerId: "LayerId",
                    settings: olpClientSettings
            });
            /**
             * Get some partition from the layer by ID
             */
            volatileLayerClient
                .getPartition("some-partition-id")
                .then(partitionResponse => {
                    partitionResponse.blob().then(partitionBlob => {
                        // your blob here
                    });
                });
        </script>
    </body>
</html>

LICENSE

Copyright (C) 2019 HERE Europe B.V.

For license details, see the LICENSE.

Current Tags

  • 1.4.0                                ...           latest (3 months ago)

10 Versions

  • 1.4.0                                ...           3 months ago
  • 1.3.1                                ...           5 months ago
  • 1.3.0                                ...           5 months ago
  • 1.2.1                                ...           6 months ago
  • 1.2.0                                ...           6 months ago
  • 1.1.0                                ...           8 months ago
  • 1.0.0                                ...           8 months ago
  • 0.9.2                                ...           9 months ago
  • 0.9.1                                ...           10 months ago
  • 0.9.0                                ...           10 months ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (23)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |