ycdev/php-osm-static-aero
Composer 安装命令:
composer require ycdev/php-osm-static-aero
包简介
PHP library to generate static aeronautical maps from OpenStreetMap (OSM) with markers, lines and drawings.
README 文档
README
PHP OSM Static Aero
PHP library to generate static aeronautical maps from OpenStreetMap with markers, lines, circles and polygons.
This project is a fork of php-osm-static-api by Franck ALARY (DantSu), adapted for aeronautical paper map generation.
This project uses the Tile Server of the OpenStreetMap Foundation which runs entirely on donated resources, see Tile Usage Policy for more information.
Requirements
- PHP >= 7.0
- Extension
gd - Extension
curl
Installation
composer require ycdev/php-osm-static-aero
How to use
Generate OpenStreetMap static image with markers and polygon :
use \Ycdev\OsmStaticAero\OpenStreetMap; use \Ycdev\OsmStaticAero\LatLng; use \Ycdev\OsmStaticAero\Polygon; use \Ycdev\OsmStaticAero\Markers; \header('Content-type: image/png'); (new OpenStreetMap(new LatLng(44.351933, 2.568113), 17, 600, 400)) ->addMarkers( (new Markers(__DIR__ . '/resources/marker.png')) ->setAnchor(Markers::ANCHOR_CENTER, Markers::ANCHOR_BOTTOM) ->addMarker(new LatLng(44.351933, 2.568113)) ->addMarker(new LatLng(44.351510, 2.570020)) ->addMarker(new LatLng(44.351873, 2.566250)) ) ->addDraw( (new Polygon('FF0000', 2, 'FF0000DD')) ->addPoint(new LatLng(44.351172, 2.571092)) ->addPoint(new LatLng(44.352097, 2.570045)) ->addPoint(new LatLng(44.352665, 2.568107)) ->addPoint(new LatLng(44.352887, 2.566503)) ->addPoint(new LatLng(44.352806, 2.565972)) ->addPoint(new LatLng(44.351517, 2.565672)) ) ->getImage() ->displayPNG();
Align and zoom the map to drawings and markers :
->fitToDraws(int $padding = 0)->fitToMarkers(int $padding = 0)->fitToMarkersAndDraws(int $padding = 0)->fitToPoints(LatLng[] $points, int $padding = 0)
$padding sets the amount of padding in the borders of the map that shouldn't be accounted for when setting the view to fit bounds. This can be positive or negative according to your needs.
Documentation
| Class | Description |
|---|---|
| Circle | Draw circle on the map. |
| Geometry2D | 2D geometry utility methods. |
| Image | GD-based image editing with tile caching. |
| LatLng | Define latitude and longitude for map, lines, markers. |
| Line | Draw line on the map. |
| MapData | Convert latitude and longitude to image pixel position. |
| Markers | Display markers on the map. |
| OpenStreetMap | Main class to generate static map images. |
| Polygon | Draw polygon on the map. |
| TileLayer | Define tile server url and related configuration. |
| XY | Define X and Y pixel position for map, lines, markers. |
Credits
This project is based on php-osm-static-api originally created by Franck ALARY (DantSu), licensed under the MIT License.
Contributing
Please fork this repository and contribute back using pull requests.
Any contributions, large or small, major features, bug fixes, are welcomed and appreciated but will be thoroughly reviewed.
ycdev/php-osm-static-aero 适用场景与选型建议
ycdev/php-osm-static-aero 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「image」 「map」 「static」 「osm」 「OpenStreetMap」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ycdev/php-osm-static-aero 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ycdev/php-osm-static-aero 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ycdev/php-osm-static-aero 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Maps in minutes. Powered by the Google Maps API.
Yii2 map input widget. Allows you to select geographcal coordinates via a human-friendly inteface.
Yii2 LightBox image galary widget uses Lightbox v2.10.0 by Lokesh Dhakar
The Yii2 extension uses jQuery jquery.carousel-1.1.min.js and makes image carousel from php array of structure defined.
The Yii2 extension uses jQuery PrettyPhoto and OwlCarousel js and makes image galary from php array of structure defined.
The enumeration type for PHP
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 29
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-15