informatique:wordpress:acf:acf-openstreetmap-field
Ceci est une ancienne révision du document !
Table des matières
acf-openstreetmap-field
Un plugin ACF pour intégrer une carte à partir d'OpenStreetMap et Leaflet.
Proposed changes
different geocoders
The plugin already use leaflet-control-geocoder so it miss the UI, decoding and storing stuff
Surcharge de la Localisation du résultat
In include/ACFFieldOpenstreetmap/Core/Core.php
Override geocode results format translation in wp-config
Geocode results format are set with translation for localisation. But in some case we want specific formats.
In wp-config.php
we can override the 3 formats for the address like:
define('ACF_OSM_I18N_ADDR_STREET','{building} {house_number} {road}'); define('ACF_OSM_I18N_ADDR_CITY','{village} {town} {city}'); define('ACF_OSM_I18N_ADDR_COUNTRY','');
'address_format' => [ 'street' => defined('ACF_OSM_I18N_ADDR_STREET') ? constant('ACF_OSM_I18N_ADDR_STREET') : __( '{building} {road} {house_number}' , 'acf-openstreetmap-field' ), 'city' => defined('ACF_OSM_I18N_ADDR_CITY') ? constant('ACF_OSM_I18N_ADDR_CITY') : __( '{postcode} {city} {town} {village} {hamlet}' , 'acf-openstreetmap-field' ), 'country' => defined('ACF_OSM_I18N_ADDR_COUNTRY') ? constant('ACF_OSM_I18N_ADDR_COUNTRY') : __( '{state} {country}' , 'acf-openstreetmap-field' ) ]
Set map view with zoom after geocoding
-
- mcguffin closed this as completed in 648a42a
informatique/wordpress/acf/acf-openstreetmap-field.1735035206.txt.gz · Dernière modification : 24/12/2024 11:13 de cyrille