chrisgoddard / acf-address-map-field Goto Github PK
View Code? Open in Web Editor NEWA better map field for Advanced Custom Fields (includes address, phone, website, etc) - compatible version 4 & 5
License: MIT License
A better map field for Advanced Custom Fields (includes address, phone, website, etc) - compatible version 4 & 5
License: MIT License
I was getting a maximum call stack exceeded for zoom_changed. I modified the input.v5.js line 84 to ensure a zoom value is available because it was coming back undefined.
var zoom = this.o.zoom.length > 0 ? parseInt(this.o.zoom) : 10;
// vars
var args = {
zoom : zoom,
center : new google.maps.LatLng(this.o.lat, this.o.lng),
mapTypeId : google.maps.MapTypeId.ROADMAP
};
Getting this error when using Address Map field. Added the API Key correctly as shown here https://www.advancedcustomfields.com/resources/google-map/.
*Note: Default Google Maps ACF field is working correctly and not ginving this error
Console output:
util.js:215 Google Maps API warning: NoApiKeys https://developers.google.com/maps/documentation/javascript/error-messages#no-api-keys uB.j @ util.js:215 (anonymous) @ js?v=3&sensor=false&libraries=places&callback=google.loader.callbacks.maps:134 (anonymous) @ js?v=3&sensor=false&libraries=places&callback=google.loader.callbacks.maps:56 (anonymous) @ js?v=3&sensor=false&libraries=places&callback=google.loader.callbacks.maps:53 (anonymous) @ js?v=3&sensor=false&libraries=places&callback=google.loader.callbacks.maps:56 _.G @ js?v=3&sensor=false&libraries=places&callback=google.loader.callbacks.maps:55 (anonymous) @ js?v=3&sensor=false&libraries=places&callback=google.loader.callbacks.maps:56 _.v @ js?v=3&sensor=false&libraries=places&callback=google.loader.callbacks.maps:35 Xc @ js?v=3&sensor=false&libraries=places&callback=google.loader.callbacks.maps:56 (anonymous) @ js?v=3&sensor=false&libraries=places&callback=google.loader.callbacks.maps:134
*PD: Thanks for your work and for sharing @chrisgoddard !!
The latitude and longitude values get saved backwards in the V5 version. Went into input.v5.js and updated lines 213-214, swapping A & F and it works correctly.
trying to use it in acf_forms() ... works in backend but not frontend. I am guessing a script is left out...
Lemme just say this first - this is exactly what I'm looking for and thanks for sharing.
When I activated the plugin and started using it, it works great and auto dumps in the address, city, etc data, everything except for the longitude.
When i got to print out the array, any address I create only gets an [lat] value and an empty [lng] value
Just wondering if you would know of a fix for this?
I was getting an error in the console "Too much recursion". It was resolved by setting default zoom in the field options. May want to add that to the README or set default zoom in the code so it doesn't error out.
Thanks for a great plugin!
Nice plugin, works just fine on the public side, but for some reason the map isn't showing in the backend of my site.
The site is running on a local dev instance using Wocker/Timber/Underwood. Would being behind a NAT firewall prevent it from showing?
I'm running ACF Pro.
Solved by updating input.v5.js lines 313 & 314. Change class names.
this.$el.find('.latitude').val( lat );
this.$el.find('.longitude').val( lng ).trigger('change');
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.