Skip to content

Commit 9366df3

Browse files
committed
update 'dantsu/php-osm-static-api' to v0.4
1 parent 04995b5 commit 9366df3

22 files changed

+264
-534
lines changed

README.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,60 +31,60 @@ composer require dantsu/french-cadastral-map-static-api
3131
Generate French Cadastral map static image with marker and line :
3232

3333
```php
34-
use \DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralMap;
35-
use \DantSu\FrenchCadastralMapStaticAPI\LatLng;
36-
use \DantSu\FrenchCadastralMapStaticAPI\Line;
37-
use \DantSu\FrenchCadastralMapStaticAPI\Markers;
34+
use \DantSu\OpenStreetMapStaticAPI\OpenStreetMap;
35+
use \DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer;
36+
use \DantSu\OpenStreetMapStaticAPI\LatLng;
37+
use \DantSu\OpenStreetMapStaticAPI\Polygon;
38+
use \DantSu\OpenStreetMapStaticAPI\Markers;
3839

3940
\header('Content-type: image/png');
40-
(new FrenchCadastralMap(12202, new LatLng(44.351933, 2.568113), 17, 600, 400))
41-
->setLayers([
42-
FrenchCadastralMap::LAYER_AMORCES_CAD,
43-
FrenchCadastralMap::LAYER_CADASTRAL_PARCEL,
44-
FrenchCadastralMap::LAYER_SUBFISCAL,
45-
// FrenchCadastralMap::LAYER_CLOTURE,
46-
FrenchCadastralMap::LAYER_DETAIL_TOPO,
47-
FrenchCadastralMap::LAYER_HYDRO,
48-
FrenchCadastralMap::LAYER_BUILDING,
49-
FrenchCadastralMap::LAYER_BORNE_REPERE,
50-
// FrenchCadastralMap::LAYER_VOIE_COMMUNICATION,
51-
// FrenchCadastralMap::LAYER_LIEUDIT
52-
])
53-
->setDisplayOpenStreetMap(true)
41+
(new OpenStreetMap(new LatLng(44.351933, 2.568113), 17, 600, 400))
42+
->addLayer(
43+
new FrenchCadastralTileLayer(
44+
12202,
45+
[
46+
FrenchCadastralTileLayer::LAYER_AMORCES_CAD,
47+
FrenchCadastralTileLayer::LAYER_CADASTRAL_PARCEL,
48+
FrenchCadastralTileLayer::LAYER_SUBFISCAL,
49+
// CadastralTileLayer::LAYER_CLOTURE,
50+
FrenchCadastralTileLayer::LAYER_DETAIL_TOPO,
51+
FrenchCadastralTileLayer::LAYER_HYDRO,
52+
FrenchCadastralTileLayer::LAYER_BUILDING,
53+
FrenchCadastralTileLayer::LAYER_BORNE_REPERE,
54+
// CadastralTileLayer::LAYER_VOIE_COMMUNICATION,
55+
// CadastralTileLayer::LAYER_LIEUDIT
56+
]
57+
)
58+
)
5459
->addMarkers(
5560
(new Markers(__DIR__ . '/resources/marker.png'))
5661
->setAnchor(Markers::ANCHOR_CENTER, Markers::ANCHOR_BOTTOM)
5762
->addMarker(new LatLng(44.351933, 2.568113))
5863
->addMarker(new LatLng(44.351510, 2.570020))
5964
->addMarker(new LatLng(44.351873, 2.566250))
6065
)
61-
->addLine(
62-
(new Line('FF0000', 2))
66+
->addDraw(
67+
(new Polygon('FF0000', 2, '00FF00CC'))
6368
->addPoint(new LatLng(44.351172, 2.571092))
6469
->addPoint(new LatLng(44.352097, 2.570045))
6570
->addPoint(new LatLng(44.352665, 2.568107))
6671
->addPoint(new LatLng(44.352887, 2.566503))
6772
->addPoint(new LatLng(44.352806, 2.565972))
6873
->addPoint(new LatLng(44.351517, 2.565672))
69-
->addPoint(new LatLng(44.351172, 2.571092))
7074
)
7175
->getImage()
7276
->displayPNG();
7377
```
7478

75-
![Exported French Cadastral image](./src/samples/resources/sample1.png)
79+
![Exported French Cadastral image](./src/samples/resources/sample_1.png)
7680

7781
## Documentation
7882

7983
| Class | Description |
8084
|--- |--- |
81-
| [Circle](./docs/classes/DantSu/FrenchCadastralMapStaticAPI/Circle.md) | DantSu\FrenchCadastralMapStaticAPI\Circle draw circle on the map.|
82-
| [FrenchCadastralMap](./docs/classes/DantSu/FrenchCadastralMapStaticAPI/FrenchCadastralMap.md) | DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralMap is a PHP library created for easily get static image from French Cadastral Government map with markers, lines, polygons and circles.|
83-
| [LatLng](./docs/classes/DantSu/FrenchCadastralMapStaticAPI/LatLng.md) | DantSu\FrenchCadastralMapStaticAPI\LatLng define latitude and longitude for map, lines, markers.|
84-
| [Line](./docs/classes/DantSu/FrenchCadastralMapStaticAPI/Line.md) | DantSu\FrenchCadastralMapStaticAPI\Line draw line on the map.|
85-
| [Markers](./docs/classes/DantSu/FrenchCadastralMapStaticAPI/Markers.md) | DantSu\FrenchCadastralMapStaticAPI\Markers display markers on the map.|
86-
| [Polygon](./docs/classes/DantSu/FrenchCadastralMapStaticAPI/Polygon.md) | DantSu\FrenchCadastralMapStaticAPI\Polygon draw polygon on the map.|
87-
| [XY](./docs/classes/DantSu/FrenchCadastralMapStaticAPI/XY.md) | DantSu\FrenchCadastralMapStaticAPI\XY define X and Y pixel position for map, lines, markers.|
85+
| [FrenchCadastralTileLayer](./classes/DantSu/FrenchCadastralMapStaticAPI/FrenchCadastralTileLayer.md) | DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer define french cadastral tile server and related configuration|
86+
87+
For more documentation, see [DantSu/php-osm-static-api](https://github.com/DantSu/php-osm-static-api)
8888

8989
## Contributing
9090

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
],
2424
"require": {
2525
"php": ">=7.0",
26-
"dantsu/php-image-editor": "^1.1",
27-
"dantsu/php-osm-static-api": "^0.3"
26+
"dantsu/php-image-editor": "^1.2",
27+
"dantsu/php-osm-static-api": "^0.4"
2828
},
2929
"autoload": {
3030
"psr-4": {

docs/classes/DantSu/FrenchCadastralMapStaticAPI/Circle.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

docs/classes/DantSu/FrenchCadastralMapStaticAPI/FrenchCadastralMap.md

Lines changed: 0 additions & 117 deletions
This file was deleted.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
2+
# FrenchCadastralTileLayer
3+
4+
DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer define french cadastral tile server and related configuration
5+
6+
7+
8+
* Full name: `\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer`
9+
* Parent class: [TileLayer](../../../classes.md)
10+
11+
**See Also:**
12+
13+
* https://github.com/DantSu/php-french-cadastral-map-static-api - Github page of this project
14+
15+
16+
17+
## Constants
18+
19+
| Constant | Value |
20+
|:--- |:--- |
21+
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_AMORCES_CAD`|'AMORCES_CAD'|
22+
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_CADASTRAL_PARCEL`|'CP.CadastralParcel'|
23+
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_SUBFISCAL`|'SUBFISCAL'|
24+
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_CLOTURE`|'CLOTURE'|
25+
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_DETAIL_TOPO`|'DETAIL_TOPO'|
26+
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_HYDRO`|'HYDRO'|
27+
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_BUILDING`|'BU.Building'|
28+
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_BORNE_REPERE`|'BORNE_REPERE'|
29+
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_VOIE_COMMUNICATION`|'VOIE_COMMUNICATION'|
30+
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_LIEUDIT`|'LIEUDIT'|
31+
32+
## Methods
33+
34+
- [__construct](#-__construct)
35+
- [getTileUrl](#-gettileurl)
36+
- [getAttributionText](#-getattributiontext)
37+
38+
### ->__construct
39+
40+
CadastralTileLayer constructor
41+
42+
43+
44+
45+
46+
47+
48+
49+
#### Parameters:
50+
51+
| Parameter | Type | Description |
52+
|-----------|------|-------------|
53+
| `insee` | **int** | Code insee of the city |
54+
| `cadastralLayers` | **string[]** | Array of cadastral layers. Use constants `FrenchCadastralTileLayer::LAYER_...` |
55+
56+
57+
58+
59+
---
60+
### ->getTileUrl
61+
62+
Get tile url for coordinates and zoom level
63+
64+
65+
66+
67+
68+
69+
70+
71+
#### Parameters:
72+
73+
| Parameter | Type | Description |
74+
|-----------|------|-------------|
75+
| `x` | **int** | x coordinate |
76+
| `y` | **int** | y coordinate |
77+
| `z` | **int** | zoom level |
78+
79+
80+
#### Return Value:
81+
82+
**string** : tile url
83+
84+
85+
86+
---
87+
### ->getAttributionText
88+
89+
Get attribution text
90+
91+
92+
93+
94+
95+
96+
97+
98+
99+
#### Return Value:
100+
101+
**string** : Attribution text
102+
103+
104+
105+
---
106+
107+
108+
---
109+
> Automatically generated from source code comments on 2022-11-02 using [phpDocumentor](http://www.phpdoc.org/)

docs/classes/DantSu/FrenchCadastralMapStaticAPI/LatLng.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

docs/classes/DantSu/FrenchCadastralMapStaticAPI/Line.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)