Note that there are some explanatory texts on larger screens.

plurals
  1. POgmaps4rails 1.4.8, infobox plugin 1.9, rails 3.2.2
    primarykey
    data
    text
    <p>I had the gmaps4rails gem version 1.4.5 working nicely on my Rails 3.2.2 app. I just grabbed the example infobox setup that was described in the 1.4.5 documentation at the time. Looked beautiful!</p> <p>So I finally get around to checking it on IE8, and the infobox's background is absent, on Safari and Firefox I get a nice yellow with %75 opacity, on IE8 I get NO background at all.</p> <p>After futzing around with the CSS, I gave up, and decided to grab the latest version of gmaps4rails 1.4.8. I notice it now supports the google infobox.js plugin. So I track it down, and find there are multiple versions, not knowing which version works with gmaps4rails 1.4.8, I choose infobox.js 1.9, the latest.</p> <p>So I stick it in the app/assets/googlemaps.js manifest like so:</p> <pre><code>//= require infobox.js //= require ./gmaps4rails.base.js.coffee //= require ./gmaps4rails.googlemaps.js.coffee </code></pre> <p>I've tried several different permutations of when the infobox.js get's included.</p> <p>I fire the whole thing off like so in usamap.html.erb:</p> <pre><code>&lt;%= javascript_include_tag "lbrokers" %&gt; &lt;%= gmaps("markers" =&gt; {"data" =&gt; @json, "options" =&gt; {"custom_infowindow_class" =&gt; "infobox", "auto_adjust"=&gt;false}}) %&gt; </code></pre> <p>With the lbrokers.js manifest looking like:</p> <pre><code>//= require gmaps4rails/googlemaps.js </code></pre> <p>When I hit that page, I get this:</p> <pre><code>google is not defined http://localhost:3000/assets/infobox.js?body=1 Line 128 </code></pre> <p>It was several months between the time I initially set up gmaps4rails, and now. Even though I installed the 1.4.8 Gem, what I REALLY did was just grab the gmaps4rails.base.js.coffee and gmaps4rails.googlemaps.js.coffee from gmaps4rails 1.4.8 on Github and pasted their contents into the previous files in app/assets/javascripst/gmaps4rails. This is the layout file rendered prior to calling usamap.html.erb:</p> <pre><code>&lt;% content_for :html_foot do %&gt; &lt;%= yield :scripts %&gt; &lt;script type="text/javascript"&gt; $(document).ready(function() { var centerpoint = new google.maps.LatLng(38, -97); gMap = new google.maps.Map(document.getElementById('map')); gMap.setCenter(centerpoint); }); Gmaps.map.infobox = function(boxText) { return { content: boxText ,disableAutoPan: false ,maxWidth: 0 ,pixelOffset: new google.maps.Size(-140, 0) ,zIndex: null ,boxStyle: { background: "url('http://google-maps-utility-library-v3.googlecode.com/svn/tags/infobox/1.1.5/examples/tipbox.gif') no-repeat" ,opacity: 0.75 ,width: "380px" } ,closeBoxMargin: "10px 2px 2px 2px" ,closeBoxURL: "http://www.google.com/intl/en_us/mapfiles/close.gif" ,infoBoxClearance: new google.maps.Size(1, 1) ,isHidden: false ,pane: "floatPane" ,enableEventPropagation: false }}; &lt;/script&gt; &lt;% end %&gt; </code></pre> <p>That's the same infobox setup that worked fine on gmaps4rails 1.4.5. Now that I'm using the infobox.js plugin, noworky!</p> <p>I have gone way wrong somewhere, either infobox.js 1.9 was the wrong choice. Or I screwed up by just copying the two gmaps4rails coffee scripts and pasting them in app/assets/javascripts/gmaps4rails.</p> <p>Or ?????</p> <p>Anybody?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload