I''m stepping through a variant of the tutorial for the ym4r/GM mapping library here: http://thepochisuperstarmegashow.com/2006/06/02/ym4r-georuby-spatial-adapter-demo/ and with heavily simplified code I''m basically doing this in the controller (assume @map and @zoom are all good): @center = GLatLng.new([ result.latitude, result.longitude ]) and in the .rjs file: page << @map.set_center(@center, @zoom) And using Firebug to look at the javascript that''s returned, I get this: map.setCenter(#<Ym4r::GmPlugin::GLatLng:0xb7530778>,12); which makes it pretty clear that the GLatLng object is having to_s called on it rather than the ym4r''s MappingObject.to_javascript method. I''m still debugging but thought perhaps others have hit this issue. As far as I can tell this is exactly how both tutorials walk through doing this, so I''m not sure what''s going on. Appreciate any suggestions or will let folks know what I find. - Walter Korman -- http://www.lemurware.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
shaper wrote:> And using Firebug to look at the javascript that''s returned, I get > this: > > map.setCenter(#<Ym4r::GmPlugin::GLatLng:0xb7530778>,12); > > which makes it pretty clear that the GLatLng object is having to_s > called on it rather than the ym4r''s MappingObject.to_javascript method. > I''m still debugging but thought perhaps others have hit this issue. > As far as I can tell this is exactly how both tutorials walk through > doing this, so I''m not sure what''s going on.Solution: don''t have both the ym4r_gm and ym4r_mapstraction plugins installed in the same app at the same time. Removing the mapstraction plugin fixes the problem. It appears there is an ambiguous reference to the MappingObject, which resides in mapping.rb in both plugins. Insidious and evil. Foolish me for having both installed as I toyed about. May others learn from my mistake. - Walter --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
I use the plug-in with great success, along with RJS. I think some of the tutorials are a bit out of date. Personally, I use this to set the map center: @map.center_zoom_init([@last_location.latitude, @last_location.longitude], 15) I believe the init method is required to be called at least once, no?> From: shaper <lemurware-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > Reply-To: <rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > Date: Wed, 20 Sep 2006 20:03:05 -0000 > To: "Ruby on Rails: Talk" <rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > Subject: [Rails] ym4r/GM GLatLng and RJS > > > I''m stepping through a variant of the tutorial for the ym4r/GM mapping > library here: > > http://thepochisuperstarmegashow.com/2006/06/02/ym4r-georuby-spatial-adapter-d > emo/ > > and with heavily simplified code I''m basically doing this in the > controller (assume @map and @zoom are all good): > > @center = GLatLng.new([ result.latitude, result.longitude ]) > > and in the .rjs file: > > page << @map.set_center(@center, @zoom) > > And using Firebug to look at the javascript that''s returned, I get > this: > > map.setCenter(#<Ym4r::GmPlugin::GLatLng:0xb7530778>,12); > > which makes it pretty clear that the GLatLng object is having to_s > called on it rather than the ym4r''s MappingObject.to_javascript method. > I''m still debugging but thought perhaps others have hit this issue. > As far as I can tell this is exactly how both tutorials walk through > doing this, so I''m not sure what''s going on. > > Appreciate any suggestions or will let folks know what I find. > > - Walter Korman -- http://www.lemurware.com > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
shaper wrote:> shaper wrote: >> And using Firebug to look at the javascript that''s returned, I get >> this: >> >> map.setCenter(#<Ym4r::GmPlugin::GLatLng:0xb7530778>,12); >> >> which makes it pretty clear that the GLatLng object is having to_s >> called on it rather than the ym4r''s MappingObject.to_javascript method. >> I''m still debugging but thought perhaps others have hit this issue. >> As far as I can tell this is exactly how both tutorials walk through >> doing this, so I''m not sure what''s going on. > > Solution: don''t have both the ym4r_gm and ym4r_mapstraction plugins > installed in the same app at the same time. Removing the mapstraction > plugin fixes the problem. It appears there is an ambiguous reference > to the MappingObject, which resides in mapping.rb in both plugins. > Insidious and evil. Foolish me for having both installed as I toyed > about. May others learn from my mistake. > > - WalterThank you for posting this! I''ve been struggling with the same problem…now on to the next one! :P -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.