Outils pour utilisateurs

Outils du site


informatique:wordpress:acf:acf-openstreetmap-field

Ceci est une ancienne révision du document !


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' )  
]
informatique/wordpress/acf/acf-openstreetmap-field.1735035074.txt.gz · Dernière modification : 24/12/2024 11:11 de cyrille

Sauf mention contraire, le contenu de ce wiki est placé sous les termes de la licence suivante : CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki