Este plugin no se ha probado con las últimas 3 versiones mayores de WordPress. Puede que ya no tenga soporte ni lo mantenga nadie, o puede que tenga problemas de compatibilidad cuando se usa con las versiones más recientes de WordPress.

ACF: Google Map Extended

Descripción

This plugin creates a new field for Advanced Custom Fields (ACF)
extending the functionality of the built-in Google Map field with several handy features:

  • Saves map center. You can center your maps wherever you want and indicate that you want to save that place as map center. This can be handy, if you want your front-end map to show some specific place in the center of the map (not necessary the location marker).
  • Saves zoom level.
  • Disables (optionally) map zooming with a scrollwheel. Sometimes you can get annoyed with your maps starting to zoom, when you scroll the post in the admin area. This feature comes handy here.
  • Shows location coordinates. It is easy to get any place’s location coordinates (latitude and longitude) with this plugin by setting a marker to the place you need using user friendly map interface.
  • Compatible with the data format of the Google Map field coming with ACF. See F.A.Q. for details.
  • Saves all maps shown at a page in the global array. This is a bonus for programmers. See F.A.Q. for details.

The plugin makes use of the Google Maps API version 3.
The plugin doesn’t use an API key and is therefore operating under the restrictions of the free Google Maps API,
which should be more than enough for most websites.

Compatibilidad

This ACF field type is compatible with:

  • ACF 4
  • ACF 5 (PRO version)
  • Google Map field coming with ACF 4/5. See F.A.Q.

Traducciones

The plugin is translated to:

  • Francés
  • Alemán
  • Países Bajos
  • Ruso
  • Ucranio

There is a POT file under the lang directory holding all translation strings, so it should be pretty easy to translate to other languages.

Web

http://code.fish

Please Vote and Enjoy

Your votes really make a difference! Thanks.

Licencia

This plugin is licensed under the GPLv2. See http://www.gnu.org/licenses/gpl-2.0.html

Capturas

  • The extended options the plugin provides in the back-end.

  • Field options include optional map zooming disabling with mouse scrollwheel.

  • The plugin in action within a repeater field in the backend.

Instalación

  1. Download the source
  2. Extract the archive into the plugin folder in your WordPress installation (usually /wp-content/plugins/ directory)
  3. Activar el plugin desde el menú «Plugins» de WordPress
  4. Make sure to also have Advanced Custom Fields plugin installed.

FAQ

Q. How do I use this plugin?

A. This plugin mimics the behavior of the Google Map field coming with the woderful Advanced Custom Fields plugin made by Elliot Condon.
Make sure you read the documentation for the original field first.
In order to benefit from the extended functionality set the field type to Google Map Extended, when you create a new custom field with ACF.
If you do everything correctly, you will see a togglable ‘Map data’ label below your map when editting a post/page with your custom fields.

Para obtener los latos de los mapas en el código de front-end, simplemente solicita el valor del campo con la llamada a la API de ACF y obtendrás la latitud, longitud, dirección, centro del mapa y zoom del mapa.

<?php
  $values = get_field('*****FIELD_NAME*****');
  $lat = $values['lat'];
  $lng = $values['lng'];
  $address = $values['address'];
  $map_center_lat = $values['center_lat'];
  $map_center_lng = $values['center_lng'];
  $map_zoom = $values['zoom'];
?>
P. ¿Puedo actualizar con este plugin los campos de Google Map que ya había creado con ACF?

R.Sí que puedes. En primer lugar, debes eliminar los campos nativos de Google Map que quieras actualizar en el grupo correspondiente de Custom Fields.
A continuación, debes crear los campos extendidos Google Map de reemplazo con los mismosNombres del campo.
Una vez hecho esto y el grupo de campos guardado, puedes recargar las páginas del back-end que hacen uso de campos ACF Google Map y disfrutar de la funcionalidad ampliada.

P. ¿Puedo cambiar la apariencia o funcionamiento del mapa en el back-end usando JavaScript?

A. Yes. All maps are saved to the global array called acf_gme_maps. The array contains instances of acf_gme class and is indexed with the field IDs. You can use all class methods or get direct access to the map through map property.
acf_gme[‘acf-field-acf_extended_map-564232b63c93e’].map.setZoom(10)
This code will set the map’s zoom to 10.

P. ¿Cómo puedo hacer que el plugin muestre un mapa en la web?

R. Debes programar un poco en el front para hacer eso, ya que este plugin (lo mismo que Advanced Custom Fields) sólo te da las funciones de back-end y guarda los datos en la base de datos de tu web.

Por favor, mira ejemplos de código en la web de ACF.

Reseñas

3 de septiembre de 2016
Had to uninstall because it throws javascript errors. This killed the ability to upload media OR change the permalink. Too bad this is a cool plugin. I'll keep an eye-out for an update.
3 de septiembre de 2016 4 respuestas
Great plugin. Thank you. I've being 'Listening' the Google Zoom events and updating the additional Map Zoom select drop-box previously, but your solution is so much better. Thank you!
3 de septiembre de 2016
Fantastic plugin that adds much-needed functionality to the ACF Google Map field. I appreciate that the array of key-value pairs is saved in exactly the same way as the default Google Map field, but with the addition of values for zoom, center_lat, and center_lng: array( 'address' => '', 'lat' => '', 'lng' => '', 'zoom' => '', 'center_lat' => '', 'center_lng' => '', ) Ultimately this data allows you to recreate the exact Google Map that the user creates in WP Admin on the front-end of your site - something that simply isn't possible with the default ACF Google Map field. Keep up the great work!
Leer todas las 6 reseñas

Colaboradores y desarrolladores

«ACF: Google Map Extended» es un software de código abierto. Las siguientes personas han colaborado con este plugin.

Colaboradores

Traduce «ACF: Google Map Extended» a tu idioma.

¿Interesado en el desarrollo?

Revisa el código , echa un vistazo al repositorio SVN o suscríbete al registro de desarrollo por RSS.

Registro de cambios

1.0.1

  • Fix minor UI bugs
  • Language: Updated POT file
  • Language: Updated Netherlands translation
  • Language: Updated Russian translation
  • Language: Updated Ukrainian translation
  • Language: Added French translation
  • Language: Added German translation

1.0.0

  • Initial Release