Download the PHP package dantsu/php-osm-static-api without Composer
On this page you can find all versions of the php package dantsu/php-osm-static-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dantsu/php-osm-static-api
More information about dantsu/php-osm-static-api
Files in dantsu/php-osm-static-api
Package php-osm-static-api
Short Description PHP library to easily get static image from OpenStreetMap (OSM), add markers and draw lines.
License MIT
Homepage https://github.com/DantSu/php-osm-static-api
Informations about the package php-osm-static-api
PHP OpenStreetMap Static API
PHP library to easily get static image from OpenStreetMap with markers, lines, circles and polygons.
This project uses the Tile Server of the OpenStreetMap Foundation which runs entirely on donated resources, see Tile Usage Policy for more information.
✨ Supporting
⭐ Star this repository to support this project. You will contribute to increase the visibility of this library 🙂
Installation
Install this library easily with composer :
How to use
Generate OpenStreetMap static image with markers and polygon :
Align and zoom the map to drawings and markers :
->fitToDraws(int $padding = 0)
->fitToMarkers(int $padding = 0)
->fitToDrawsAndMarkers(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 | DantSu\OpenStreetMapStaticAPI\Circle draw circle on the map. |
LatLng | DantSu\OpenStreetMapStaticAPI\LatLng define latitude and longitude for map, lines, markers. |
Line | DantSu\OpenStreetMapStaticAPI\Line draw line on the map. |
MapData | DantSu\OpenStreetMapStaticAPI\MapData convert latitude and longitude to image pixel position. |
Markers | DantSu\OpenStreetMapStaticAPI\Markers display markers on the map. |
OpenStreetMap | DantSu\OpenStreetMapStaticAPI\OpenStreetMap is a PHP library created for easily get static image from OpenStreetMap with markers, lines, polygons and circles. |
Polygon | DantSu\OpenStreetMapStaticAPI\Polygon draw polygon on the map. |
TileLayer | DantSu\OpenStreetMapStaticAPI\TileLayer define tile server url and related configuration |
XY | DantSu\OpenStreetMapStaticAPI\XY define X and Y pixel position for map, lines, markers. |
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.