0
# Map Tiles
1
2
Weather map tiles for visualization including precipitation, wind, temperature, and pressure layers. Enables integration of weather overlays into mapping applications.
3
4
## Capabilities
5
6
### Tile Retrieval
7
8
```python { .api }
9
class TileManager:
10
def __init__(self, API_key: str, layer_name: str, config: dict): ...
11
12
def get_tile(self, x: int, y: int, zoom: int) -> Tile:
13
"""
14
Retrieve weather map tile.
15
16
Parameters:
17
- x: Tile X coordinate in OWM reference system
18
- y: Tile Y coordinate in OWM reference system
19
- zoom: Zoom level for the tile
20
21
Returns:
22
Tile object with image data
23
"""
24
25
@property
26
def map_layer(self) -> str:
27
"""The map layer type for tiles"""
28
@property
29
def API_key(self) -> str:
30
"""The API key"""
31
```
32
33
## Usage Examples
34
35
```python
36
from pyowm import OWM
37
from pyowm.tiles.enums import MapLayerEnum
38
39
owm = OWM('your-api-key')
40
41
# Get precipitation tile manager
42
precip_mgr = owm.tile_manager(MapLayerEnum.PRECIPITATION)
43
tile = precip_mgr.get_tile(x=1, y=1, zoom=1)
44
45
# Get wind tile manager
46
wind_mgr = owm.tile_manager(MapLayerEnum.WIND)
47
wind_tile = wind_mgr.get_tile(x=2, y=2, zoom=2)
48
```
49
50
## Map Layers
51
52
```python { .api }
53
class MapLayerEnum:
54
PRECIPITATION = "precipitation"
55
WIND = "wind"
56
TEMPERATURE = "temperature"
57
PRESSURE = "pressure"
58
```
59
60
## Data Types
61
62
```python { .api }
63
class Tile:
64
def __init__(self, x: int, y: int, zoom: int, layer_name: str, image_data, last_update_time: int): ...
65
66
@property
67
def x(self) -> int: ...
68
@property
69
def y(self) -> int: ...
70
@property
71
def zoom(self) -> int: ...
72
@property
73
def layer_name(self) -> str: ...
74
@property
75
def image_data(self): # Image data
76
"""Image data"""
77
@property
78
def last_update_time(self) -> int: ...
79
```