bame/staticmap
Composer 安装命令:
composer require bame/staticmap
包简介
A library to build static map images based on OpenStreetMap.
README 文档
README
PHP library for generating static map images.
Originally from dfacts/staticmaplite
Some information can be found here: https://wiki.openstreetmap.org/wiki/StaticMapLite
Changes from original staticMapLite
staticMapLite was only slightly modified to be reusable, it should be mostly backwards compatible and the staticmap.php script uses this class to provide the same functionality
Installation
composer require bame/staticmap
Additional features
StaticMap
The new class StaticMap is added to be able to reuse the code modularily. It also allows to add a custom tile source and disabling the cache.
Disable to tile cache only, if you have permission from the tile server administrator.
TripleZoomMap
Generates map around a POI with 3 zoom levels:
+------------++-------------------------+
| || |
| overview || detail |
| || |
| || |
+------------+| (My Place) |
+------------+| v |
| || |
| closer || |
| || |
| || |
+------------++-------------------------+
Each frame has a different color and the area of the previous zoom level is marked.
Example call:
$colors = [ [0x00, 0x6B, 0x3F], [0xF9, 0xDD, 0x16], [0xE2, 0x3D, 0x28], ]; $map = new TripleZoomMap(8.977596, 38.76179, 700, 320, 'Bandira Addis Map', $colors, 'https://a.africa.tiles.openplaceguide.org/styles/bright/{Z}/{X}/{Y}.png', 'opg-pages'); $map->sendHeader(); return imagepng($map->getImage());
统计信息
- 总下载量: 327
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2023-04-15