설명
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.
호환성
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.
번역
The plugin is translated to:
- 프랑스어
- 독일어
- 네덜란드
- 러시아어
- 우크라이나어
There is a POT file under the lang
directory holding all translation strings, so it should be pretty easy to translate to other languages.
웹사이트
http://code.fish
Please Vote and Enjoy
Your votes really make a difference! Thanks.
라이선스
This plugin is licensed under the GPLv2. See http://www.gnu.org/licenses/gpl-2.0.html
스크린샷
설치
- Download the source
- Extract the archive into the plugin folder in your WordPress installation (usually
/wp-content/plugins/
directory) - 워드프레스의 ‘플러그인’ 메뉴에서 플러그인을 활성화하세요.
- 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.To get the map data in the front-end code, simply request the field value with ACF API call and you will get the latitude, longitude, address, map center and map zoom.
<?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']; ?>
- Q. Can I upgrade the Google Map fields I had created using just ACF with this plugin?
-
A. Yes, you can. First, you should delete the built-in Google Map fields you want to upgrade in the corresponding field groups under Custom Fields.
Then you should create replacement Google Map Extended fields with the same Field Name.
Once done and field group saved, you can refresh the back-end pages making use of ACF Google Map fields and enjoy the extended functionality. - Q. Can I change the map’s look/behavior in the back-end using 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. - Q. How do I get the plugin to show a map on the website?
-
A. You should do some front-end coding to do that, as this plugin (likewise Advanced Custom Fields itself) gives you the back-end features only and stores the data in your website’s database.
Please see code examples at ACF website.
후기
기여자 & 개발자
자국어로 “ACF: Google Map Extended”(을)를 번역하세요.
개발에 관심이 있으십니까?
변경이력
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