[Seaside] Google Maps center coordinates

dtrussardi at tiscali.it dtrussardi at tiscali.it
Tue Mar 2 11:20:26 UTC 2010


Thanks James,
i have change the
googleMap GMUsingLatLong>>#'googleMap'


	^GoogleMap new
		setCenter: 45.5267 @ -122.8390 zoom: 11;
		setUIToDefault;
		addScript: self markerScript;
		on: 'zoomEnd' do: [:x :y :z |
			zoomLevelPrc := x.
			zoomLevelAtt := y.
		
		]; 
		on: 'moveend' do: [:x :y :z |
			test:= 'go'.
		];
		yourself.
With this the moveend event is intercept.

Now i d'ont know how i can define the center cordinates.

I think  moveend function  d'ont have parameters.


How i can  run    var center = map.getCenter(); 

Any pointers would be greatly appreciated !
Dario,

|>	See GMUsingLatLong>>#'googleMap' for an example of a callback from the browser to Smalltalk. You could modify the callback so that it persists the arguments instead of simply generating an a|>	lert to display in the browser. Basically, you would send #'on:do:' to the map and use the 'moveend' event.

	James

On Mar 1, 2010, at 9:04 AM, dtrussardi at tiscali.it wrote:

> Hi, 
> 
> i work with Google Maps into  seaside based on http://seaside.gemstone.com/ss/GoogleMaps .
> 
> I rendering the map and all work fine.
> 
> The user can move the map with no problem.
> 
> I'm interested, when user end the moving of the map, to sender  the new center  coordinates  of the map, to my seaside application.
> 
> It's possibly ? 
> 
> Into documentation i found this script:
> 
> 
> 	googleMap
> 
> 	^GoogleMap new
> 		setCenter: 45.5267 @ -122.8390 zoom: 11;
> 		setUIToDefault;
> 		
> 		addScript: 'GEvent.addListener(map, "moveend", function() {  var center = map.getCenter(); alert(center.toString());});';
> 		yourself.
> 
> 
> It's work fine when the user end the move,  it alert the new center coordinates.
> 
> 
> Now how i can send this data to my application ?
> 
> 
> 
> Thanks for any considerations !!!
> 
> 	Dario
> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100302/97e6e002/attachment.htm


More information about the seaside mailing list