# rdview-service

> Rdview service for loading road photos

Latest version **2.0.0** (published 2019-08-21) · ISC license · 0 weekly downloads

## Install

```sh
npm install rdview-service
pnpm add rdview-service
yarn add rdview-service
bun add rdview-service
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2019-08-21 |
| First published | 2017-12-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 72.2 KB |
| Known vulnerabilities | 0 (+24 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | beldorcentr.a |
| Keywords | rdview, road, photo |

## Links

- npm: https://www.npmjs.com/package/rdview-service
- npm.io page: https://npm.io/package/rdview-service

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.18.0

## Recent versions

- 2.0.0 (latest) — 2019-08-21
- 1.1.2 — 2018-08-23
- 1.1.1 — 2018-08-15
- 1.1.0 — 2018-08-02
- 1.0.0 — 2017-12-22

## README

# Rdview service

Service for [rdview](https://i.centr.by/rdview) to receive photos from roads.

## Description

Serivice uses rdview api and provides photos from roads of Belarus. Required [authorization](https://i.centr.by/oauth/)

Photo types - 2D and 3D equirectangular panoramas.

[Usage example](https://github.com/beldorcentr/rdview-front)

## Installation

```
npm install rdview-service
```

## Usage

```
// js
import { RdviewService } from 'rdview-service';

// ts
import {
  RdviewService, Passage, View, Road, Segment, CurrentPosition
} from 'rdview-service';


const rdviewService = new RdviewService({
  // default: apiUrl: 'https://i.centr.by/rdview/api',
  authorization: 'Bearer YOUR_OAUTH_TOKEN'
});

rdviewService.initByCoordinates(52.34, 28.9)
  .then(currentPosition => handleNewPosition(currentPosition));

// moving
rdviewService.getNextView()
  .then(currentPosition => handleNewPosition(currentPosition));

// change passage
rdviewService.setPassage(passageId)
  .then(currentPosition => handleNewPosition(currentPosition));

function handleNewPosition(position) {
  // position.road.name
  // position.currentView.km
  // position.currentView.lat
  // position.currentView.lon
  // position.currentView.azimuth
  // position.currentView.date
  // position.currentView.imgUrl
  // position.currentView.viewType
  // position.passages[0].id
}
```

viewType: 'twoDimensional' or 'equirectangularPanorama'

Full documentation in [DOCUMENTATION.md](DOCUMENTATION.md)

---
_Source: https://npm.io/package/rdview-service · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
