0.3.0 • Published 11 months ago

mapycz-api v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

mapy.cz interface library

To build this interface requires decoding fastrpc protocol (see fastrpc.ts), adopted by mapy.cz for RPC, and encoding/decoding geo coordinates to/from strings (see coords.ts).

Routes on the map

Build route of given type (see Route.RouteType) from start point to end point on the map:

import { Route } from "mapy";

const response = await Route.request(
  {x: 12.933840,y: 47.571277},
  {x:12.8870615, y:47.5015969},
  "turist2"
);

Point of interest

Look up POI by name:

import { Suggest } from "mapy";

const results = await Suggest.request({
  phrase: "Watzmannhaus",
  lang: "en"
});
const obj = results[0].userData;
console.log(obj.longitude, obj.latitude, obj.id, obj.source);

Get details (Wikidata, mostly) for POI:

import { Detail } from "mapy";

const source = "osm"; // see Suggest.request output
const id = 129440502; // see Suggest.request output

const details = await Detail.request(source, id, {
  "fetchPhoto": true, "ratios": ["default", "1x1", "16x9"],
  "wikimedia": true,
  "lang": ["en"]
});
0.3.0

11 months ago

0.2.6

11 months ago

0.2.3

11 months ago

0.2.5

11 months ago

0.2.4

11 months ago

0.2.2

12 months ago

0.2.1

12 months ago

0.2.0

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago