Why is this script not working?

I think the issue that the Google maps API isn’t loading correctly. You need to make sure that the both jQuery and Google maps API are being loaded. https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js http://maps.google.com/maps/api/js It can be any recent version of jQuery, and from any source. Assuming that your jQuery function is contained within your google-maps-address.js file the following … Read more

Google Map JavaScript error after migrating

Google API’s now requires API key for new domains, you should create an API key as per instructions here: https://developers.google.com/maps/documentation/javascript/get-api-key and edit the line in the plugin that loads the Google Maps API to include your key as the value of a ‘key’ parameter. Wherever you find one of these: “https://maps.googleapis.com/maps/api/js“ or “http://maps.googleapis.com/maps/api/js” in the … Read more

Google Map not displayed [closed]

It might be that you haven’t set your Google Maps API key. Or, if you have already set an API key then it might be due to any restrictions that you may have set for the API key such as restricting it to a specific domain. You can obtain a Google Maps API key from … Read more

Custom Backend data for map to JSON file?

Use the JSON REST API – http://v2.wp-api.org – It lives as a plugin now but will eventually be part of WP Core – https://wordpress.org/plugins/rest-api/ To manually output JSON, use a combination of wp-ajax to handle requests and wp_json_encode() / wp_send_json_success for simple PHP Objects and Arrays. See https://codex.wordpress.org/AJAX_in_Plugins

google map Info window [closed]

Divi don’t have a option to pop up marker on load, but you can do it this way: Open file divi\includes\builder\scripts\frontend-builder-scripts.js find this: google.maps.event.addListener(marker, ‘click’, function() { if( infowindow_active ) { infowindow_active.close(); } infowindow_active = infowindow; infowindow.open( $this_map_container.data(‘map’), marker ); }); } }); } and replace with this: google.maps.event.addListener(marker, ‘click’, function() { if( infowindow_active ) … Read more

How to handle multiple distance matrix api request in loop to reduce load and request time?

I need to pass the lat and long for two address function calculate_distance($lat1, $lon1, $lat2, $lon2, $unit) { $theta = $lon1 – $lon2; $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); $dist = acos($dist); $dist = rad2deg($dist); $miles = $dist * 60 * 1.1515; $unit = strtoupper($unit); if ($unit == “K”) { … Read more