Glen:

Your question is more php/ajax/js than G. Maps related.

1.
If you simply add above code snippet after following line in
testmap.php

         google.maps.event.addListener(marker2, 'drag', redraw);

You should be able to see coordinates for marker1 (before or after
drag operation) on marker click.

2.
Still, You will not see coordinates for marker2. Hint:To avoid adding
the same code for marker2, you can define marker as global variable.

3.
Later,  you can change that code, or add another listener that will
trigger saving new data....



 On Oct 17, 11:35 am, Glen Bass <[email protected]> wrote:
> HelloRadina:
>
> I have these two scripts
>
> http://www.ecoexam.com/Client/testmap.phphttp://www.ecoexam.com/Client/testmap2.php
>
> Testmap.php is a sample script for drawing a box in V3, Test map two
> is an
> altered sample script that denotes the separate locations of marker1
> and
> marker2 but does not draw a box.
>
> My goal is to draw the box and save the positions of marker1 and
> marker2
> using php. Currently the testmap2 code allows me to do this, but I
> have
> failed in my efforts to add a dynamic box, equally as frustrating is
> that
> doing the opposite with testmap.php is being just as difficult.
> I am sure that my frustrations rest in the code details but I cant
> seem to
> get it right.
>
> Best Regards
>
> Glen
>
> On Oct 14, 5:03 pm,Radina<[email protected]> wrote:
>
>
>
> > Glen:
>
> > If you just want to see new coordinates, you can try:
>
> > var infowindow = new google.maps.InfoWindow();
>
> > google.maps.event.addListener(marker1, 'click', function()
> > {
> >                 var latitude = marker1.position.lat();
> >         infowindow.setContent("lat = " + latitude + "<br />" +
> >                               "lng = " +  marker1.position.lng());
> >         infowindow.open(map,marker1);
>
> > });
>
> > Thanks,Radina
> > On Oct 13, 4:29 pm, "[email protected]" <[email protected]>
> > wrote:
>
> > > On Oct 13, 3:36 pm, Glen Bass <[email protected]> wrote:
>
> > > > Hello:
>
> > > > I am attempting to create a worksheet that the user will expand a box
> > > > to contain a geographic area. I found this sample code and am unable
> > > > to determine the two sets of coordinates for each of my markers for
> > > > use in PHP.
>
> > > What have you tried to do?  I don't see any code in that page to send
> > > the results back to the server (where PHP runs).  I do see that the
> > > redraw function is accessing the updated coordinates.
>
> > >   -- Larry
>
> > > > The link for the testpage is below. Any help is appreciated
>
> > > >http://www.ecoexam.com/Client/testmap.php
>
> > > > Best Regards
>
> > > > Glen- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to