mirror of
https://github.com/marceloprates/prettymaps.git
synced 2025-08-30 17:50:13 +02:00
Refactor documentation workflow to build and deploy site to a dedicated branch, and remove outdated docs.
This commit is contained in:
21
docs/api.md
21
docs/api.md
@@ -1,21 +0,0 @@
|
||||
# API Reference
|
||||
|
||||
This page documents the main modules and functions of the `prettymaps` library. The API documentation is auto-generated from the code and includes all public classes and functions.
|
||||
|
||||
## Modules
|
||||
|
||||
- **draw**: Core drawing and plotting functions, including map rendering, layer management, and style handling.
|
||||
- **fetch**: Functions for fetching and processing OpenStreetMap data and elevation.
|
||||
- **utils**: Utility functions for logging, timing, and other helpers.
|
||||
|
||||
---
|
||||
|
||||
::: prettymaps.draw
|
||||
|
||||
---
|
||||
|
||||
::: prettymaps.fetch
|
||||
|
||||
---
|
||||
|
||||
::: prettymaps.utils
|
@@ -1,27 +0,0 @@
|
||||
# prettymaps
|
||||
|
||||
A minimal Python library to draw pretty maps from OpenStreetMap data.
|
||||
|
||||
- [Usage](usage.md)
|
||||
- [API Reference](api.md)
|
||||
|
||||
## Features
|
||||
- Draw beautiful maps from OSM data
|
||||
- Highly customizable layers and styles
|
||||
- Preset management
|
||||
- Keypoint highlighting
|
||||
|
||||
## Installation
|
||||
```bash
|
||||
pip install prettymaps
|
||||
```
|
||||
|
||||
## Quick Example
|
||||
```python
|
||||
import prettymaps
|
||||
prettymaps.plot("Porto Alegre")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
Data © OpenStreetMap contributors
|
@@ -1,4 +0,0 @@
|
||||
mkdocs
|
||||
mkdocs-material
|
||||
mkdocstrings
|
||||
mkdocstrings-python
|
@@ -1,64 +0,0 @@
|
||||
# Usage
|
||||
|
||||
## Basic Usage
|
||||
|
||||
The main entry point is the `plot()` function:
|
||||
|
||||
```python
|
||||
import prettymaps
|
||||
prettymaps.plot("Porto Alegre")
|
||||
```
|
||||
|
||||
This will generate a map for the given location using default layers and styles.
|
||||
|
||||
## Customizing Layers and Styles
|
||||
|
||||
You can customize which OpenStreetMap layers are shown and how they are styled:
|
||||
|
||||
```python
|
||||
layers = {
|
||||
"perimeter": {},
|
||||
"streets": {"width": 8},
|
||||
"buildings": {},
|
||||
}
|
||||
style = {
|
||||
"perimeter": {"fc": "#f2efe9"},
|
||||
"streets": {"fc": "#cccccc", "ec": "#333333"},
|
||||
"buildings": {"fc": "#bdbdbd"},
|
||||
}
|
||||
prettymaps.plot("Porto Alegre", layers=layers, style=style)
|
||||
```
|
||||
|
||||
## Using Presets
|
||||
|
||||
Presets are reusable configurations for layers and styles. You can load, save, or update presets:
|
||||
|
||||
```python
|
||||
prettymaps.plot("Porto Alegre", preset="default")
|
||||
```
|
||||
|
||||
You can also create your own presets and save them for later use.
|
||||
|
||||
## Highlighting Keypoints
|
||||
|
||||
You can highlight specific keypoints (e.g., landmarks) on the map:
|
||||
|
||||
```python
|
||||
keypoints = {
|
||||
"tags": {"tourism": "attraction"},
|
||||
"kwargs": {"bbox": {"fc": "yellow"}},
|
||||
}
|
||||
prettymaps.plot("Porto Alegre", keypoints=keypoints)
|
||||
```
|
||||
|
||||
## Saving Maps
|
||||
|
||||
You can save the generated map to a file:
|
||||
|
||||
```python
|
||||
prettymaps.plot("Porto Alegre", save_as="map.png")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
See the [API Reference](api.md) for details on all functions and parameters.
|
Reference in New Issue
Block a user