[Seaside] Google Maps center coordinates

James Foster Smalltalk at JGFoster.net
Tue Mar 2 16:30:51 UTC 2010


Dario,

I've committed a new version (GoogleMaps-jgf.23.mcz) that provides this feature. See the example in GMSimpleMap.

James

On Mar 2, 2010, at 3:20 AM, dtrussardi at tiscali.it wrote:

> 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
> > 
> > 
> 
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

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


More information about the seaside mailing list