rtorres
rtorres

Reputation: 2981

Unable to render gmaps4rails map

Ok, I've been trying for several hours to render a google map with gmaps4rails and I'm unable to figure it out, so I was hoping to get some ideas here. I think I'm pretty close though.

Here's what I've done:

I think I'm missing something really simple, since the data seems to be in place for the map to be rendered. Any ideas?

Upvotes: 1

Views: 569

Answers (1)

rtorres
rtorres

Reputation: 2981

It turned out to be that I was wrapping the gmaps4rails' map_container div within my own map div and that was throwing off gmaps4rails. I assume gmaps4rails' JS logic inserts and depends on its own div#map. So basically DO NOT wrap your gmaps4rails call in a div with id="map".

In my haml, I had this:

#map
  = gmaps4rails(@mapData)

When I just needed to have this:

= gmaps4rails(@mapData)

Or:

#foo
  = gmaps4rails(@mapData)

Upvotes: 1

Related Questions