I want to add an address meta field that will automatically populate address fields via Google Places. This works as expected via the Meta box Geolocation; After I search for an address fills in the correct address data and it places a marker on the Google Map.
The problem I want to fix now is that the marker is not always 100% accurate and I want to be able to move them over to the other side of the building, or the other side of the street...
Moving the marker however does not adjust the Lat/Long, so saving the post resets the marker back to the Lat/Long that Google found for the supplied address.
I looked around and I think /meta-box/js/map.js this piece of code should do the magic, but I can't extend this in my own javascript for example. I can't find a way to hook into the map since there is no global var available.
google.maps.event.addListener(this.map, 'click', function (event) {
that.marker.setPosition(event.latLng);
that.updateCoordinate(event.latLng);
});
How can I trigger a Google Map event when the map is clicked/marker is moved?