ruby on rails - js error when trying to dynamically update gmaps -


trying gmaps update in place once new location typed out. (anyone know tutorial actually? :p)

anyways when running gmaps4rails.replacemarkerst method, seem bring js error seen when using chrome's inspection tool seen below. ideas?

http://stuff.saikonet.org/images/misc/2011-07-22-030217_1024x768_scrot.png

ok gotcha, problem not replace_marker function.

indeed, using old document-ready buddy, google maps isn't yet created. yep failing.

that's gmaps4rails.callback makes it's entry.

after declaration of map (for obvious reason: gmaps4rails must defined):

<% content_for :scripts %> <script> gmaps4rails.callback = function() {   gmaps4rails.replacemarkers([{"lng": "-92.5294574", "lat": "45.1969796"}]); }; </script> <% end %> 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -