I need some help with, probably, an easy to solve problem.
I use the following bit of code:
<script type="text/javascript">
var map = null;
var geocoder = null;
function initialize() {
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(37.4419, -122.1419), 1);
map.setUIToDefault();
geocoder = new GClientGeocoder();
}
}
function showAddress(address) {
if (geocoder) {
geocoder.getLatLng(
address,
function(point) {
if (!point) {
alert(address + " Not found.");
} else {
map.setCenter(point, 15);
}
}
);
}
}
</script>
The map plus some geocoding is all working fine - no problems there.
What I want to capture from the map is the map's center lat/long- and
zoom-values.
I want to pass these values into the following hidden form elements:
<input type="hidden" id="centerLatLng" name="CenterLatLng">
<input type="hidden" id="zoomm" name="zoom">
What code do I need to add to the script, and where in the script, to
be able to capture and pass the lat/lng- and zoom-values to the form
elements?
I have been looking at examles with GetBYelementId and such but can't
get it to work.
Help!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en
-~----------~----~----~----~------~----~------~--~---