Skip to content

Commit ff355bb

Browse files
committed
Update osm_tileobj documentation
1 parent b25046e commit ff355bb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

doc/osm_tileobj.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ This module provides a thin object-style wrapper around *osm_tile* module method
66
```lua
77
osm_tile = require 'osm.tileobj'
88

9-
local tile = osm_tile.new_from_uri('/mystyle1/18/233816/100256.png')
9+
local tile, err = osm_tile.new_from_uri('/mystyle1/18/233816/100256.png')
10+
if err then
11+
ngx.log(ngx.ERR, 'unable to create tile object: '..err)
12+
end
13+
1014
if tile:is_inside_maps({'mystyle1', 'mystyle2'}) then
1115
ngx.log(ngx.ERR, 'tile'..tile..' belongs to selected styles')
1216
end
@@ -22,7 +26,7 @@ end
2226
new_from_uri
2327
------------
2428

25-
**syntax:** *tile = new_from_uri(uri, metatiles_dir?)*
29+
**syntax:** *tile, err = new_from_uri(uri, metatiles_dir?)*
2630

2731
Returns new tile object with attributes:
2832

@@ -32,6 +36,8 @@ Returns new tile object with attributes:
3236
* content_type (string): content_type (based on ext)
3337
* is_vector (bool): true if given uri ends with '.mvt'
3438

39+
If something goes wrong, returns nil and error message.
40+
3541
*metatiles_dir* is the optional argument ('/var/lib/mod_tile' if not set)
3642

3743
is_inside_maps

0 commit comments

Comments
 (0)