Skip to content

Commit

Permalink
update 'dantsu/php-osm-static-api' to v0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Franck ALARY committed Nov 2, 2022
1 parent 04995b5 commit 9366df3
Show file tree
Hide file tree
Showing 22 changed files with 264 additions and 534 deletions.
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,60 +31,60 @@ composer require dantsu/french-cadastral-map-static-api
Generate French Cadastral map static image with marker and line :

```php
use \DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralMap;
use \DantSu\FrenchCadastralMapStaticAPI\LatLng;
use \DantSu\FrenchCadastralMapStaticAPI\Line;
use \DantSu\FrenchCadastralMapStaticAPI\Markers;
use \DantSu\OpenStreetMapStaticAPI\OpenStreetMap;
use \DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer;
use \DantSu\OpenStreetMapStaticAPI\LatLng;
use \DantSu\OpenStreetMapStaticAPI\Polygon;
use \DantSu\OpenStreetMapStaticAPI\Markers;

\header('Content-type: image/png');
(new FrenchCadastralMap(12202, new LatLng(44.351933, 2.568113), 17, 600, 400))
->setLayers([
FrenchCadastralMap::LAYER_AMORCES_CAD,
FrenchCadastralMap::LAYER_CADASTRAL_PARCEL,
FrenchCadastralMap::LAYER_SUBFISCAL,
// FrenchCadastralMap::LAYER_CLOTURE,
FrenchCadastralMap::LAYER_DETAIL_TOPO,
FrenchCadastralMap::LAYER_HYDRO,
FrenchCadastralMap::LAYER_BUILDING,
FrenchCadastralMap::LAYER_BORNE_REPERE,
// FrenchCadastralMap::LAYER_VOIE_COMMUNICATION,
// FrenchCadastralMap::LAYER_LIEUDIT
])
->setDisplayOpenStreetMap(true)
(new OpenStreetMap(new LatLng(44.351933, 2.568113), 17, 600, 400))
->addLayer(
new FrenchCadastralTileLayer(
12202,
[
FrenchCadastralTileLayer::LAYER_AMORCES_CAD,
FrenchCadastralTileLayer::LAYER_CADASTRAL_PARCEL,
FrenchCadastralTileLayer::LAYER_SUBFISCAL,
// CadastralTileLayer::LAYER_CLOTURE,
FrenchCadastralTileLayer::LAYER_DETAIL_TOPO,
FrenchCadastralTileLayer::LAYER_HYDRO,
FrenchCadastralTileLayer::LAYER_BUILDING,
FrenchCadastralTileLayer::LAYER_BORNE_REPERE,
// CadastralTileLayer::LAYER_VOIE_COMMUNICATION,
// CadastralTileLayer::LAYER_LIEUDIT
]
)
)
->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))
)
->addLine(
(new Line('FF0000', 2))
->addDraw(
(new Polygon('FF0000', 2, '00FF00CC'))
->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))
->addPoint(new LatLng(44.351172, 2.571092))
)
->getImage()
->displayPNG();
```

![Exported French Cadastral image](./src/samples/resources/sample1.png)
![Exported French Cadastral image](./src/samples/resources/sample_1.png)

## Documentation

| Class | Description |
|--- |--- |
| [Circle](./docs/classes/DantSu/FrenchCadastralMapStaticAPI/Circle.md) | DantSu\FrenchCadastralMapStaticAPI\Circle draw circle on the map.|
| [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.|
| [LatLng](./docs/classes/DantSu/FrenchCadastralMapStaticAPI/LatLng.md) | DantSu\FrenchCadastralMapStaticAPI\LatLng define latitude and longitude for map, lines, markers.|
| [Line](./docs/classes/DantSu/FrenchCadastralMapStaticAPI/Line.md) | DantSu\FrenchCadastralMapStaticAPI\Line draw line on the map.|
| [Markers](./docs/classes/DantSu/FrenchCadastralMapStaticAPI/Markers.md) | DantSu\FrenchCadastralMapStaticAPI\Markers display markers on the map.|
| [Polygon](./docs/classes/DantSu/FrenchCadastralMapStaticAPI/Polygon.md) | DantSu\FrenchCadastralMapStaticAPI\Polygon draw polygon on the map.|
| [XY](./docs/classes/DantSu/FrenchCadastralMapStaticAPI/XY.md) | DantSu\FrenchCadastralMapStaticAPI\XY define X and Y pixel position for map, lines, markers.|
| [FrenchCadastralTileLayer](./classes/DantSu/FrenchCadastralMapStaticAPI/FrenchCadastralTileLayer.md) | DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer define french cadastral tile server and related configuration|

For more documentation, see [DantSu/php-osm-static-api](https://github.com/DantSu/php-osm-static-api)

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
],
"require": {
"php": ">=7.0",
"dantsu/php-image-editor": "^1.1",
"dantsu/php-osm-static-api": "^0.3"
"dantsu/php-image-editor": "^1.2",
"dantsu/php-osm-static-api": "^0.4"
},
"autoload": {
"psr-4": {
Expand Down
21 changes: 0 additions & 21 deletions docs/classes/DantSu/FrenchCadastralMapStaticAPI/Circle.md

This file was deleted.

117 changes: 0 additions & 117 deletions docs/classes/DantSu/FrenchCadastralMapStaticAPI/FrenchCadastralMap.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@

# FrenchCadastralTileLayer

DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer define french cadastral tile server and related configuration



* Full name: `\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer`
* Parent class: [TileLayer](../../../classes.md)

**See Also:**

* https://github.com/DantSu/php-french-cadastral-map-static-api - Github page of this project



## Constants

| Constant | Value |
|:--- |:--- |
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_AMORCES_CAD`|'AMORCES_CAD'|
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_CADASTRAL_PARCEL`|'CP.CadastralParcel'|
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_SUBFISCAL`|'SUBFISCAL'|
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_CLOTURE`|'CLOTURE'|
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_DETAIL_TOPO`|'DETAIL_TOPO'|
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_HYDRO`|'HYDRO'|
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_BUILDING`|'BU.Building'|
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_BORNE_REPERE`|'BORNE_REPERE'|
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_VOIE_COMMUNICATION`|'VOIE_COMMUNICATION'|
|`\DantSu\FrenchCadastralMapStaticAPI\FrenchCadastralTileLayer::LAYER_LIEUDIT`|'LIEUDIT'|

## Methods

- [__construct](#-__construct)
- [getTileUrl](#-gettileurl)
- [getAttributionText](#-getattributiontext)

### ->__construct

CadastralTileLayer constructor








#### Parameters:

| Parameter | Type | Description |
|-----------|------|-------------|
| `insee` | **int** | Code insee of the city |
| `cadastralLayers` | **string[]** | Array of cadastral layers. Use constants `FrenchCadastralTileLayer::LAYER_...` |




---
### ->getTileUrl

Get tile url for coordinates and zoom level








#### Parameters:

| Parameter | Type | Description |
|-----------|------|-------------|
| `x` | **int** | x coordinate |
| `y` | **int** | y coordinate |
| `z` | **int** | zoom level |


#### Return Value:

**string** : tile url



---
### ->getAttributionText

Get attribution text









#### Return Value:

**string** : Attribution text



---


---
> Automatically generated from source code comments on 2022-11-02 using [phpDocumentor](http://www.phpdoc.org/)
21 changes: 0 additions & 21 deletions docs/classes/DantSu/FrenchCadastralMapStaticAPI/LatLng.md

This file was deleted.

21 changes: 0 additions & 21 deletions docs/classes/DantSu/FrenchCadastralMapStaticAPI/Line.md

This file was deleted.

Loading

0 comments on commit 9366df3

Please sign in to comment.