Skip to content

Commit 15e6dd1

Browse files
committed
initial commit
0 parents  commit 15e6dd1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+5528
-0
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: DantSu

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.idea
2+
/.phpdoc
3+
/phpdoc.xml
4+
/phpdocumentor

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Franck ALARY
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# PHP OpenStreetMap Static API
2+
3+
PHP library to easily get static image from OpenStreetMap (OSM), add markers and draw lines.
4+
5+
## ✨ Supporting
6+
7+
⭐ Star this repository to support this project. You will contribute to increase the visibility of this library 🙂
8+
9+
## Installation
10+
11+
Install this library easily with composer :
12+
13+
```cmd
14+
composer require dantsu/php-osm-static-api
15+
```
16+
17+
## How to use
18+
19+
Create a empty image, draw on it and display it :
20+
21+
```php
22+
use \DantSu\OpenStreetMapStaticAPI\OpenStreetMap;
23+
```
24+
25+
## Documentation
26+
27+
| Class | Description |
28+
|--- |--- |
29+
| [BoundingBox](./docs/classes/DantSu/OpenStreetMapStaticAPI/BoundingBox.md) | DantSu\OpenStreetMapStaticAPI\BoundingBox define the bounding box of the static map.|
30+
| [LatLng](./docs/classes/DantSu/OpenStreetMapStaticAPI/LatLng.md) | DantSu\OpenStreetMapStaticAPI\LatLng define latitude and longitude for map, lines, markers.|
31+
| [Line](./docs/classes/DantSu/OpenStreetMapStaticAPI/Line.md) | DantSu\OpenStreetMapStaticAPI\Line draw line on the map.|
32+
| [Markers](./docs/classes/DantSu/OpenStreetMapStaticAPI/Markers.md) | DantSu\OpenStreetMapStaticAPI\Markers display markers on the map.|
33+
| [OpenStreetMap](./docs/classes/DantSu/OpenStreetMapStaticAPI/OpenStreetMap.md) | DantSu\OpenStreetMapStaticAPI\BoundingBox define the bounding box of the static map.|
34+
| [XY](./docs/classes/DantSu/OpenStreetMapStaticAPI/XY.md) | DantSu\OpenStreetMapStaticAPI\XY define X and Y pixel position for map, lines, markers.|
35+
36+
## Contributing
37+
38+
Please fork this repository and contribute back using pull requests.
39+
40+
Any contributions, large or small, major features, bug fixes, are welcomed and appreciated but will be thoroughly reviewed.
41+

composer.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "dantsu/php-osm-static-api",
3+
"type": "library",
4+
"description": "PHP library to easily get static image from OpenStreetMap (OSM), add markers and draw lines.",
5+
"keywords": [
6+
"php",
7+
"osm",
8+
"openstreetmap",
9+
"map",
10+
"static",
11+
"image",
12+
"maps",
13+
"api"
14+
],
15+
"homepage": "https://github.com/DantSu/php-osm-static-api",
16+
"license": "MIT",
17+
"authors": [
18+
{
19+
"name": "Franck ALARY",
20+
"homepage": "https://github.com/DantSu",
21+
"role": "Developer"
22+
}
23+
],
24+
"require": {
25+
"php": "^7.0",
26+
"dantsu/php-image-editor": "^1.0"
27+
},
28+
"autoload": {
29+
"psr-4": {
30+
"DantSu\\OpenStreetMapStaticAPI\\": "src/"
31+
}
32+
}
33+
}

composer.lock

Lines changed: 80 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
2+
# BoundingBox
3+
4+
DantSu\OpenStreetMapStaticAPI\BoundingBox define the bounding box of the static map.
5+
6+
7+
8+
* Full name: `\DantSu\OpenStreetMapStaticAPI\BoundingBox`
9+
10+
**See Also:**
11+
12+
* https://github.com/DantSu/php-osm-static-api - Github page of this project
13+
14+
15+
16+
## Methods
17+
18+
- [__construct](#-__construct)
19+
- [getBottomLeft](#-getbottomleft)
20+
- [getTopRight](#-gettopright)
21+
- [getOutputPxSize](#-getoutputpxsize)
22+
- [convertLatLngToPxPosition](#-convertlatlngtopxposition)
23+
24+
### ->__construct
25+
26+
BoundingBox constructor.
27+
28+
29+
30+
31+
32+
33+
34+
35+
#### Parameters:
36+
37+
| Parameter | Type | Description |
38+
|-----------|------|-------------|
39+
| `bottomLeft` | **\DantSu\OpenStreetMapStaticAPI\LatLng** | Latitude and longitude of bottom left image |
40+
| `topRight` | **\DantSu\OpenStreetMapStaticAPI\LatLng** | Latitude and longitude of top right image |
41+
| `outputPxSize` | **\DantSu\OpenStreetMapStaticAPI\XY** | Width and height of the image in pixel |
42+
43+
44+
45+
46+
---
47+
### ->getBottomLeft
48+
49+
Get latitude and longitude of bottom left image
50+
51+
52+
53+
54+
55+
56+
57+
58+
59+
#### Return Value:
60+
61+
**\DantSu\OpenStreetMapStaticAPI\LatLng** : Latitude and longitude of bottom left image
62+
63+
64+
65+
---
66+
### ->getTopRight
67+
68+
Get latitude and longitude of top right image
69+
70+
71+
72+
73+
74+
75+
76+
77+
78+
#### Return Value:
79+
80+
**\DantSu\OpenStreetMapStaticAPI\LatLng** : Latitude and longitude of top right image
81+
82+
83+
84+
---
85+
### ->getOutputPxSize
86+
87+
Get width and height of the image in pixel
88+
89+
90+
91+
92+
93+
94+
95+
96+
97+
#### Return Value:
98+
99+
**\DantSu\OpenStreetMapStaticAPI\XY** : Width and height of the image in pixel
100+
101+
102+
103+
---
104+
### ->convertLatLngToPxPosition
105+
106+
Convert a latitude and longitude to a XY pixel position in the image
107+
108+
109+
110+
111+
112+
113+
114+
115+
#### Parameters:
116+
117+
| Parameter | Type | Description |
118+
|-----------|------|-------------|
119+
| `latLng` | **\DantSu\OpenStreetMapStaticAPI\LatLng** | Latitude and longitude to be converted |
120+
121+
122+
#### Return Value:
123+
124+
**\DantSu\OpenStreetMapStaticAPI\XY** : Pixel position of latitude and longitude in the image
125+
126+
127+
128+
---
129+
130+
131+
---
132+
> Automatically generated from source code comments on 2021-09-08 using [phpDocumentor](http://www.phpdoc.org/)

0 commit comments

Comments
 (0)