Download the PHP package ujamii/geocoder-neos without Composer
On this page you can find all versions of the php package ujamii/geocoder-neos. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ujamii/geocoder-neos
More information about ujamii/geocoder-neos
Files in ujamii/geocoder-neos
Package geocoder-neos
Short Description This package provides a very flexible way of geocoding your node properties.
License
Informations about the package geocoder-neos
Geocoder Mixin for NEOS CMS
This package provides a very flexible way of geocoding your node properties. Imagine you have a document or content type with some physical address data (street, zip code, city) and you want to display this data on a map (for instance with WebExcess.OpenStreetMap) or you need the geo data for some calculations.
Installation
Usage
The package provides a new node type mixin "Ujamii.Geocoder:Mixin.AddressData". Add this mixin to the desired NodeType in your package:
This will add some new properties to the node inspector. When you add address data there, the geodata will be added after you safe your changes. This is done by a pretty feature rich package
Where is the difference to FormatD.GeoIndexable or Wwwision.Neos.AddressEditor?
you may ask. Well, tha latter one also uses the geocoder package, but only make use of exactly one geocoding service: Google Maps. In contrast, this very package just integrates the geocoder package without any restrictions in its configuration. Although I included the Nominatim/OpenStreetMap data provider as default here, you can use something completely different, or with just a different config. This is what this makes this package a little more flexible.
In the object management feature of NEOS is used to configure the geocoder/data provider used to get coordinates from your address data.
As you can see, all the constructor arguments for the used objects are provided and can, of course, be changed by your own package and config.
In the Configuration/Settings.yaml
file, the property config can also be changed. So let's
say you need some more properties, like a country or state. You can just add those to your NodeType or create your own mixin,
which may have Ujamii.Geocoder:Mixin.AddressData
as supertype again. The properties will be joined by a space character when
sent to the data provider.
But you are even free to exchange this part as well. The event after saving your node will check for a configured type, so if you created your own one, just set it in your settings:
Now, let's assume everything is configured the way you like, and you want to display a nice map with those documents added as map markers along with nice tooltips and an info popup (we also added some more properties):
(for this example, install WebExcess.OpenStreetMap, but any other map will work as well)
Using a different provider
Say, you want to use Google Maps as data provider. First, install the package:
Next, adjust the config:
The same steps if you, for instance, dont want to use the default Guzzle 6 adapter. Just add your desired library:
and then configure it in the Objects.yaml
providing optional config as constructor parameters, if you want.
TODOs
- feature: multi language
- feature: add an eel helper with methods for geocoding and reverse geocoding
- feature: Command Controller for filling empty values (like for imported nodes)
License and Contribution
GPLv3
As this is OpenSource, you are very welcome to contribute by reporting bugs, improve the code, write tests or whatever you are able to do to improve the project.
If you want to do me a favour, buy me something from my Amazon wishlist.
All versions of geocoder-neos with dependencies
geocoder-php/nominatim-provider Version ^5.4
php-http/message Version ^1.10