[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tapestry-user
Subject:    Re: [T5] Getting LatLng from Google Map
From:       abangkis <abangkis () gmail ! com>
Date:       2010-01-26 15:48:10
Message-ID: c5aa090d1001260748v7c6aee7cu98829c2a6811c155 () mail ! gmail ! com
[Download RAW message or body]

Hi the easiest way is using hidden textfield (I've got this from
thiago advice).

in your form in tml file you have something like this :

				<t:hidden t:id="hid" value="hiddenValue"/>

while in the java class you need this :

	@Property
	private String hiddenValue;

and in the javascript you just do something like this :

document.mapForm.hid.value = createMarkerData(gmarkers);

in my case every time a user click the map, it store the marker
location to an array. the createMarkerData function iterate this array
and append it to a string. Then the string is accesible through the
hiddenValue variables in the java class.

Hope this helps
Cheers

Abangkis

On Tue, Jan 26, 2010 at 5:29 PM, blueboy6 <blueboy6@gmail.com> wrote:
> 
> Ok, here is my new problem :)
> 
> I implemented google maps to one of my projects and everything is fine. I
> input coordinates and marker shows up and everything else is ok.
> 
> Now problem is that I want to drag marker across map and to get new
> coordinates to my form...
> 
> Problem is that this is all done in javascript and I don't know how to pass
> value from javascript to my page.
> 
> GEvent.addListener(marker, "dragend", function() {
> ??? = marker.getLatLng().lat();
> ??? = marker.getLatLng().lng();
> });
> 
> SO anyone have idea what to do?
> --
> View this message in context: \
> http://old.nabble.com/-T5--Getting-LatLng-from-Google-Map-tp27320566p27320566.html \
> Sent from the Tapestry - User mailing list archive at Nabble.com. 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic