Download the PHP package nr/fieldtypegeocoder without Composer
On this page you can find all versions of the php package nr/fieldtypegeocoder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nr/fieldtypegeocoder
More information about nr/fieldtypegeocoder
Files in nr/fieldtypegeocoder
Package fieldtypegeocoder
Short Description Collect and store Geocode information from several providers
License MIT
Informations about the package fieldtypegeocoder
FieldtypeGeocoder
What it does
Retrieve, collect and store geolocation data from external geocoding services. Under the hood, the module uses the great PHP Library geocoder-php by William Durand and Tobias Nyholm and adds some processwire magic. Thanks to Ryan (FieldtypeMapMarker) and mats (FieldtypeLeafletMapMarker), from which we drew a lot of inspiration developing this module!
Features
- Fulltext search in formatted Address
- Proximity search
- Search in geojson
- Easily hookable geocoding providers (supported providers)
- Normalized geocoder object from geocoder-php
- Supports The GraphQL-Module by dadish
Installation
- Copy the files for this module to /site/modules/FieldtypeGeocoder/
-
Execute the following command in the /site/modules/FieldtypeGeocoder/ directory.
- In processwire admin: Modules > Refresh and install Fieldtype > Geocoder.
- Insert the api-key for your geocoding provider. The default provider is OpenCage. OpenCage uses various other geocoding services. You can change the provider with a processwire hook. read more
- Create a new field of type Geocoder, and name it whatever you like. In our examples we named it simply "geocoder".
- Add the field to a template and start geocoding!
- For GraphQL install the modul
GraphQLFieldtypeGeocoder
- For GraphQL install the modul
Install via composer
- Execute the following command in your website root directory.
Requirements
- PHP >= 7.4
- PHP Extensions: json, curl, intl
Module Configuration
Modules
> Configure
> FieldtypeGeocoder
Insert you api key here. The default
Field Configuration
Fields
> your_field
> input
Each field can have a default map center
API Reference
Seach in input
Search in formatted address
Search in properties
Search and order by proximity
Search by status
The Geocoder Object
Hooks / Change provider
You can hook some methods to change or override the geocoding provider. Here you can find a full list of supported providers.
- Download, unzip provider package.
- Move the files in your folder structure (
Provider.php
andProviderAddress.php
)*. - Load all files with
require_once()
command.
*Replace "Provider" with the provider name e.g. Google or Mapbox etc.
Example 1: Google Maps Provider Package
- Geocoding Api Documentation and examples
- Maps Platform Configure your api-key
Example 2: Mapbox Search Provider Package
- Geocoding Api Documentation and examples
- Playground Playground (👍)
- Access Tokens Create and manage your keys
Todos
- Update provider-string if you use the autocomplete function from the inputfield or move the marker.
- Refactor the inputfield javascript for other maps or mapstyles
- Add warnings if a vendor package is not found!
Feedback
If you have any feedback, please reach out to us at [email protected] or create an issue in the github projekt.
All versions of fieldtypegeocoder with dependencies
php-http/curl-client Version ^2.2
nyholm/psr7 Version ^1.8
geocoder-php/open-cage-provider Version ^4.6
ext-json Version *
ext-curl Version *