9 Commits

Author SHA1 Message Date
e019cb01ba Mention Marco for demo and usage example 2026-01-26 20:04:53 +07:00
eb2878ec6a 1.1.3 2026-01-26 20:02:29 +07:00
602cc44ae2 Improve README 2026-01-26 20:02:11 +07:00
b9615d7b97 Add npm badge to README 2026-01-26 19:52:55 +07:00
63e644c85a 1.1.2 2026-01-26 19:48:22 +07:00
d8e893a5f0 Add keywords 2026-01-26 19:48:09 +07:00
39ca1f18db 1.1.1 2026-01-26 19:43:24 +07:00
8ac75935ac Add repo, homepage to package.json 2026-01-26 19:43:08 +07:00
aa2d0ed58b Fix doc output 2026-01-26 19:40:38 +07:00
7 changed files with 27 additions and 8 deletions

View File

@@ -1,7 +1,13 @@
# @remotestorage/module-places
[![npm version](https://img.shields.io/npm/v/@remotestorage/module-places.svg)](https://www.npmjs.com/package/@remotestorage/module-places)
This module allows you to manage saved places (Points of Interest) using the [remoteStorage](https://remotestorage.io/) protocol.
It leverages [Geohashes](https://www.geohash.es/) to organize data, enabling efficient retrieval of places within specific geographic areas. This structure is particularly optimized for map applications that need to load data only for the visible viewport.
For a demo application, as well as source code using this module, check out [Marco](https://marco.kosmos.org).
## Installation
```bash
@@ -31,6 +37,10 @@ await places.store({
// List all places
const allPlaces = await places.getPlaces();
console.log(allPlaces);
// List places for specific geohash prefixes (e.g. for a map view)
const areaPlaces = await places.getPlaces(['u33d', 'u33e']);
console.log(areaPlaces);
```
## API Reference

2
dist/places.d.ts vendored
View File

@@ -83,7 +83,7 @@ export interface PlacesClient {
/**
* Store a place.
* Generates ID and Geohash if missing.
* Path structure: <geohash-prefix-2>/<geohash-prefix-2>/<id>
* Path structure: `<geohash-prefix-2>/<geohash-prefix-2>/<id>`
*
* @param placeData - The data of the place to store.
* @returns The stored place object.

2
dist/places.js vendored
View File

@@ -71,7 +71,7 @@ const Places = function (privateClient /*, publicClient: BaseClient */) {
/**
* Store a place.
* Generates ID and Geohash if missing.
* Path structure: <geohash-prefix-2>/<geohash-prefix-2>/<id>
* Path structure: `<geohash-prefix-2>/<geohash-prefix-2>/<id>`
*/
store: async function (placeData) {
const place = preparePlace(placeData);

View File

@@ -118,7 +118,7 @@ The geohash of the place.
Store a place.
Generates ID and Geohash if missing.
Path structure: <geohash-prefix-2>/<geohash-prefix-2>/<id>
Path structure: `<geohash-prefix-2>/<geohash-prefix-2>/<id>`
#### Parameters

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "@remotestorage/module-places",
"version": "1.1.0",
"version": "1.1.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@remotestorage/module-places",
"version": "1.1.0",
"version": "1.1.3",
"license": "MIT",
"dependencies": {
"latlon-geohash": "^2.0.0",

View File

@@ -1,7 +1,16 @@
{
"name": "@remotestorage/module-places",
"version": "1.1.0",
"version": "1.1.3",
"description": "Manage favorite/saved places",
"homepage": "https://gitea.kosmos.org/raucao/remotestorage-module-places#remotestoragemodule-places",
"repository": {
"type": "git",
"url": "git+https://gitea.kosmos.org/raucao/remotestorage-module-places.git"
},
"keywords": [
"remotestorage",
"remotestorage-module"
],
"main": "dist/places.js",
"types": "dist/places.d.ts",
"type": "module",

View File

@@ -56,7 +56,7 @@ export interface PlacesClient {
/**
* Store a place.
* Generates ID and Geohash if missing.
* Path structure: <geohash-prefix-2>/<geohash-prefix-2>/<id>
* Path structure: `<geohash-prefix-2>/<geohash-prefix-2>/<id>`
*
* @param placeData - The data of the place to store.
* @returns The stored place object.
@@ -157,7 +157,7 @@ const Places = function (
/**
* Store a place.
* Generates ID and Geohash if missing.
* Path structure: <geohash-prefix-2>/<geohash-prefix-2>/<id>
* Path structure: `<geohash-prefix-2>/<geohash-prefix-2>/<id>`
*/
store: async function (placeData: Partial<Place>) {
const place = preparePlace(placeData);