ycdev/php-osm-static-aero 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub license

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 我们能提供哪些服务?
定制开发 / 二次开发

基于 ycdev/php-osm-static-aero 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 17
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 29
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 23
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-15