Maps search box autocomplete with callback JS function?

Try this in your js file: function robbte_map_initialize() { var input = document.getElementById(‘searchTextField’); var autocomplete = new google.maps.places.Autocomplete(input); google.maps.event.addListener(autocomplete, ‘place_changed’, function () { var place = autocomplete.getPlace(); if (!place.geometry) { window.alert(“Select a suggestion from the list”); return; } document.getElementById(‘city2’).value = place.name; document.getElementById(‘cityLat’).value = place.geometry.location.lat(); document.getElementById(‘cityLng’).value = place.geometry.location.lng(); }); } jQuery(document).ready (robbte_map_initialize);

passing markup thought a shortcode attribute

You have quite a bit of markup for that shortcode. Trying to pass all of that as a shortcode is going to be trouble. I pulled it apart to look at it. id=”map” z=”11″ w=”100%” h=”300″ scrollwheel=”false” maptype=”ROADMAP” address=”Southampton, United Kingdom” marker=”true” markerimage=”http://anachronistic.local:9102/wp-content/plugins/_TomRush/inc/js/TinyMCE_additions/modal/../img/icons/music_folk_map.png“ infowindow=”<div class=”marker inside”><img class=”marker icon” alt=”” src=”http://maps.gstatic.com/mapfiles/place_api/icons/geocode-71.png” /><strong>Southampton</strong><br>Southampton, UK<br><span class=”marker extras”>Some User … Read more

Querying posts by latitude and longitude to build a Google Maps with several markers

To connect your meta fields with the “Geo Data Store”-Plugin, you simply take the name of the meta key/field and map it with the filter to the plugin. add_filter( ‘sc_geodatastore_meta_keys’, ‘wpse82502_lat_lng_metakey_mapping’ ); function wpse82502_lat_lng_metakey_mapping( $keys ) { $keys[] = “your_meta_key_field_name”; return $keys; } To get the data from PHP to JS, simply use wp_localize_script().

This page can’t load Google Maps correctly [closed]

Welcome to the new world of Google Maps 🙁 You now have to have your credit card linked to your Google Maps API. They give you $250 a month of “credit” so you will likely not get charged, but you do have to have the card linked. https://venturebeat.com/2018/05/02/google-maps-platform-arrives-with-pay-as-you-go-billing-free-support-and-cloud-requirement-starting-june-11/

Plot location on Google map using full address specified in custom field

Dean, your best bet is to do it through JS on the front end. I use the following function to covert the postcode to a Lat and Lng: function codeAddress(address){ geocoder.geocode({ ‘address’: address }, function(results, status){ if(status == google.maps.GeocoderStatus.OK){ map.setCenter(results[0].geometry.location); map.setZoom(16); var marker = new google.maps.Marker({ map: map, position: results[0].geometry.location }); markersArray.push(marker); // BA Lng, … Read more

Extracting Address from Custom Post via Javascript for Google Maps API

Well, this is kind of easy.. The google-map API needs a format like Your Street 123, 54321 Your City Assuming you have your data like this: <div id=”street”>Your Street 123</div> <div id=”zip”>54321</div> <div id=”city”>Your City</div> Assuming you are using jQuery: (function($){ $.fn.create_gmap_address = function() { var street = $(‘#street’).html(); var zip = $(‘#zip’).html(); var city … Read more

How to pinpoint posts location with Google map v3?

I think you need to check this link. This is the WP plugin which satisfies your all constraint. This plugin would be able to work with current WordPress version 4.2. OR You can check tutorial for google map with wordpress. Let me know if you face any further query/concern. Thanks!