M
mikethestone
Here's what I have so far.
1) I know if I'm on a google map page for a location, I can paste
"javascriptrompt(window.gApplication.getMap().getCenter());" into
the address bar and copy the lat/long out
2) I can also make an iframe google map for location: "Belarus" on an
html
page with code like this:
<iframe width="300" name='iframe' height="300" frameborder="0"
scrolling="no" marginheight="0" marginwidth="0" src="http://
maps.google.com/maps?
f=q&source=s_q&hl=en&geocode=&q=Belarus&z=10&iwloc=A&output=embed"></
iframe>
How do I do the below... but on from an iframe'd-google map?
I want to pass lat/long values FROM: a google map inside an iframe...
TO: the PHP page that has the iframe code
--I think I'll have to have a form that will put the vars in the
address bar, from JS, on submit
HERE'S AN EXAMPLE OF WHAT I HAVE & WHAT I WANT TO DO:
<script type="text/javascript">
var latitude =
some_google_code_that_pulls_lat_coord_from_iframe_google_map;
var longitude =
some_google_code_that_pulls_long_coord_from_iframe_google_map;
function submitform() { document.forms["myform"].submit(); }
</script>
<form id="myform" action="submit-form.php">
<input type='hidden' name='JS_LATITUDE' value='JS_LATITUDE'>
<input type='hidden' name='JS_LONGITUDE' value='JS_LONGITUDE'>
<a href="javascript: submitform()">Submit</a>
</form>
....
This is an example that was previous talked about on the google maps
group, but they said my q wasn't topical... but this example wasn't
referring to a map in an iframe
....
----------------------------------------
var center = map.getCenter();
var centerLat = center.lat();
var centerLong = center.lng();
Then, as jon mentioned before, you can set the values to hidden
fields.
Or you can simply add the values to a query string.
e.g.http://foo.com/your_code.php?centerLat=...¢erLong=...
When the user submits the form, your PHP codes get the lat/long values
like
<?php
$centerLat = $_REQUEST['centerLat'];
$centerLong = $_REQUEST['centerLong'];
// Store the values in your database.
?>
THANKS!!!!!! A million times over!
1) I know if I'm on a google map page for a location, I can paste
"javascriptrompt(window.gApplication.getMap().getCenter());" into
the address bar and copy the lat/long out
2) I can also make an iframe google map for location: "Belarus" on an
html
page with code like this:
<iframe width="300" name='iframe' height="300" frameborder="0"
scrolling="no" marginheight="0" marginwidth="0" src="http://
maps.google.com/maps?
f=q&source=s_q&hl=en&geocode=&q=Belarus&z=10&iwloc=A&output=embed"></
iframe>
How do I do the below... but on from an iframe'd-google map?
I want to pass lat/long values FROM: a google map inside an iframe...
TO: the PHP page that has the iframe code
--I think I'll have to have a form that will put the vars in the
address bar, from JS, on submit
HERE'S AN EXAMPLE OF WHAT I HAVE & WHAT I WANT TO DO:
<script type="text/javascript">
var latitude =
some_google_code_that_pulls_lat_coord_from_iframe_google_map;
var longitude =
some_google_code_that_pulls_long_coord_from_iframe_google_map;
function submitform() { document.forms["myform"].submit(); }
</script>
<form id="myform" action="submit-form.php">
<input type='hidden' name='JS_LATITUDE' value='JS_LATITUDE'>
<input type='hidden' name='JS_LONGITUDE' value='JS_LONGITUDE'>
<a href="javascript: submitform()">Submit</a>
</form>
....
This is an example that was previous talked about on the google maps
group, but they said my q wasn't topical... but this example wasn't
referring to a map in an iframe
....
----------------------------------------
var center = map.getCenter();
var centerLat = center.lat();
var centerLong = center.lng();
Then, as jon mentioned before, you can set the values to hidden
fields.
Or you can simply add the values to a query string.
e.g.http://foo.com/your_code.php?centerLat=...¢erLong=...
When the user submits the form, your PHP codes get the lat/long values
like
<?php
$centerLat = $_REQUEST['centerLat'];
$centerLong = $_REQUEST['centerLong'];
// Store the values in your database.
?>
THANKS!!!!!! A million times over!