You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This library provides a [OpenStreetMap](https://www.openstreetmap.org/) (OSM) map fetching and tile caching system for ESP32-based devices.
5
+
This library provides a [OpenStreetMap](https://www.openstreetmap.org/) (OSM) map fetching and tile caching system for ESP32-based devices.
8
6
Under the hood it uses [LovyanGFX](https://github.com/lovyan03/LovyanGFX) and [PNGdec](https://github.com/bitbank2/PNGdec) to do the heavy lifting.
9
7
10
8
[](https://www.openstreetmap.org/)
11
9
12
10
A map is composed from downloaded OSM tiles and returned as a LGFX sprite.
13
-
The sprite can be pushed to the screen or used for further composing.
11
+
The sprite can be pushed to the screen, saved to SD or used for further composing.
14
12
Downloaded tiles are cached in psram for reuse.
15
13
16
-
This library should work on any ESP32 type with psram and a LovyanGFX compatible display.
14
+
This library should work on any ESP32 type with psram and a LovyanGFX compatible display.
17
15
The downloaded tile cache gets large very quickly -128kB per tile- so psram is required.
18
16
19
17
This project is not endorsed by or affiliated with the OpenStreetMap Foundation.
20
18
21
-
### Functions
19
+
## License differences between this library and the map data
20
+
21
+
### This library has a MIT license
22
22
23
-
#### Set map resolution
23
+
The `OpenstreetMap-esp32` library -this library- is licensed under the [MIT license](/LICENSE).
24
+
25
+
### The downloaded tile data has a Open Data Commons Open Database License (ODbL)
26
+
27
+
OpenStreetMap® is open data, licensed under the [Open Data Commons Open Database License (ODbL)](https://opendatacommons.org/licenses/odbl/) by the OpenStreetMap Foundation (OSMF).
28
+
29
+
Use of any OSMF provided service is governed by the [OSMF Terms of Use](https://osmfoundation.org/wiki/Terms_of_Use).
30
+
31
+
## Functions
32
+
33
+
### Set map resolution
24
34
25
35
```c++
26
-
voidsetResolution(uint16_t w, uint16_t h);
36
+
voidsetSize(uint16_t w, uint16_t h);
27
37
```
28
38
29
-
- If no resolution is set, a 320 by 240 map will be returned by `fetchMap`.
39
+
- If no size is set a 320px by 240px map will be returned by `fetchMap`.
-`filename` must start with `/` for example `/map.bmp` or `/images/map.bmp`
73
+
-`filename` must start with `/` for example `/map.bmp` or `/images/map.bmp`
63
74
-`result` returns something like `SD Card mount failed` or `Screenshot saved`.
64
75
-`sdPin` is **optional** and used to set a `SS/CS` pin for the SD slot.
65
76
-`frequency` is **optional** and used to set the SD speed.
66
77
67
-
**Note**: The SD card is managed from `begin()` to `end()` inside the `saveMap()` function.
78
+
**Note**: The SD card is managed from `begin()` to `end()` inside the `saveMap()` function.
68
79
Do not mount the SD card before this function but unmount if it is mounted else memory will be leaked.
69
80
70
-
## License differences between this library and the map data
71
-
72
-
### This library has a MIT license
73
-
74
-
The `OpenstreetMap-esp32` library -this library- is licensed under the [MIT license](/LICENSE).
75
-
76
-
### The downloaded tile data has a Open Data Commons Open Database License (ODbL)
77
-
78
-
OpenStreetMap® is open data, licensed under the [Open Data Commons Open Database License (ODbL)](https://opendatacommons.org/licenses/odbl/) by the OpenStreetMap Foundation (OSMF).
79
-
80
-
Use of any OSMF provided service is governed by the [OSMF Terms of Use](https://osmfoundation.org/wiki/Terms_of_Use).
81
-
82
81
## Example code
83
82
84
83
### Example returning the default 320x240 map
@@ -207,10 +206,6 @@ void loop()
207
206
}
208
207
```
209
208
210
-
### Screenshot of a 480x800 map from a esp32-8048s050
0 commit comments