{"id":1066,"date":"2022-08-30T15:11:49","date_gmt":"2022-08-30T15:11:49","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/problem-about-gmaps4rails-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:11:49","modified_gmt":"2022-08-30T15:11:49","slug":"problem-about-gmaps4rails-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/problem-about-gmaps4rails-collection-of-common-programming-errors\/","title":{"rendered":"problem about gmaps4rails-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e4c804835ebccbaf4c75b214f2fb047c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nParam<br \/>\njavascript ruby-on-rails gmaps4rails<br \/>\nstack details ruby 1.9.2p180, rails 3.0.9, gmaps4rails 1.0.2, jquery.json-2.3.min.jsBackground I am a newbie to gmaps4rails and really like the gem. All is working well so far, but I am trying to update markers dynamically for the first time. I am doing the following in application.js:var markers_json = $.toJSON(markers_ar<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/be40e72fe1921a36db99664bb299e74b?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nLuc<br \/>\nruby-on-rails activeadmin gmaps4rails<br \/>\nIn try to use gmaps4rails in my ActiveAdmin \/ Rails app. To do so, I have added the following in my Gemfile:gem &#8216;gmaps4rails&#8217;and ran a &#8220;bundle&#8221;. I updated the &#8216;show&#8217; method in app\/admin\/device.rb file with:show do attributes_table dorow :nameend# Get device location@markers = Location.all.to_gmaps4r<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/MWGFy.jpg?s=32&amp;g=1\" \/><br \/>\ncereallarceny<br \/>\nruby-on-rails ruby ruby-on-rails-3 google-maps gmaps4rails<br \/>\nI have gotten the entire map to display correctly with no issues. However, the map always loads at coordinates of 0,0. I know I&#8217;m passing the longitude and latitude correctly as well.Here&#8217;s the printed json which the gmaps4rails method receives:[{&#8220;lat&#8221;:40.7142,&#8221;lng&#8221;:74.0064}]Below is also the code used in various areas of production&#8230;VIEW<\/li>\n<\/ul>\n<p id=\"rop\"><small>Originally posted 2013-11-09 23:20:57. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Param javascript ruby-on-rails gmaps4rails stack details ruby 1.9.2p180, rails 3.0.9, gmaps4rails 1.0.2, jquery.json-2.3.min.jsBackground I am a newbie to gmaps4rails and really like the gem. All is working well so far, but I am trying to update markers dynamically for the first time. I am doing the following in application.js:var markers_json = $.toJSON(markers_ar Luc ruby-on-rails activeadmin [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1066","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=1066"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1066\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}