that can be interpreted by Google Maps. However, I don't have the
coordinate information for my data, so I need to geocode the address.
However, Google Maps only uses JavaScript for geocoding addresses, and I've
been unsuccessful in inserting the JavaScript function into the PHP code.
Any help would be greatly appreciated.
This is the JavaScript function used to geocode the address.
Code: Select all
function showAddress(address) {
geocoder.getLatLng(
address,
function(point) {
var marker = new GMarker(point);
map.addOverlay(marker);
}
);
}This is the relevant part of the PHP code that defines the coordinates.
Code: Select all
$Coordinates->appendChild($dom->createTextNode(/* Insert JavaScript here */));