Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
niektenhoopen committed Aug 13, 2023
1 parent 15c4df3 commit 8fc0c54
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 2.2.0 - 2023-08-13
### Added
- Save zoom level (Issue #21)
- Ability to set a default zoom level (Issue #21)
- Ability to set a default map center

### Changed
- Bugfix: an empty value would still pass required field validation (Issue #22)

## 2.1.2 - 2022-05-03
### Changed
- Move ECS to dev dependencies
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ To install the plugin, follow these instructions.
{{ entry.fieldName | coordinates }} => 52.3584159,4.8810756
{{ entry.fieldName | latitude }} => 52.3584159
{{ entry.fieldName | longitude }} => 4.8810756
{{ entry.fieldName | zoomLevel }} => 13
{{ entry.fieldName | address }} => Paulus Potterstraat 7, 1071 CX Amsterdam, Netherlands
```
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nthmedia/entry-gps-coordinates",
"description": "Entry GPS Coordinates plugin for Craft CMS 3.x",
"type": "craft-plugin",
"version": "2.1.2",
"version": "2.2.0,
"keywords": [
"gps coordinates",
"gps",
Expand Down
7 changes: 7 additions & 0 deletions src/twigextensions/EntryGpsCoordinatesTwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function getFilters()
new TwigFilter('searchQuery', [$this, 'searchQuery']),
new TwigFilter('latitude', [$this, 'latitude']),
new TwigFilter('longitude', [$this, 'longitude']),
new TwigFilter('zoomLevel', [$this, 'zoomLevel']),
];
}

Expand All @@ -58,6 +59,7 @@ public function getFunctions()
new TwigFunction('searchQuery', [$this, 'searchQuery']),
new TwigFunction('latitude', [$this, 'latitude']),
new TwigFunction('longitude', [$this, 'longitude']),
new TwigFunction('zoomLevel', [$this, 'zoomLevel']),
];
}

Expand Down Expand Up @@ -110,4 +112,9 @@ public function address(?EntryCoordinatesModel $value = null)
{
return $value->address;
}

public function zoomLevel(?EntryCoordinatesModel $value = null)
{
return $value->zoomLevel;
}
}

0 comments on commit 8fc0c54

Please sign in to comment.