apneadiving / Google-Maps-for-Rails

Enables easy Google map + overlays creation in Ruby apps
https://apneadiving.github.io/
MIT License
2.26k stars 382 forks source link

Google map shows visible tiles and can't be zoomed #61

Closed evnu closed 13 years ago

evnu commented 13 years ago

I am trying to get gmaps running with my mongoid application. I was able to display the map, but it isn't rendered correctly. See this image http://imagebin.org/165962 .

This is my model:

class Upload
  include Mongoid::Document
  include Mongoid::Document::Taggable
  include Gmaps4rails::ActsAsGmappable
  belongs_to :user

  acts_as_gmappable

  field :name, :type => String
  field :description, :type => String
  mount_uploader :file, FileUploader

  field :latitude, :type => Float
  field :longitude, :type => Float
  field :gmaps, :type => Boolean

  validates_presence_of :name
  validates_presence_of :user

# snip
# ...

  # see https://github.com/apneadiving/Google-Maps-for-Rails
  def gmaps4rails_address
    "Berlin, Germany"
  end
end

The controller fills a variable @json:

    @json = Upload.all.to_gmaps4rails

And I use it like this in the view:

<%= gmaps4rails(@json) %>

I don't know how to find the cause of this rendering problem. Can I supply more information?

apneadiving commented 13 years ago

You should give more info.

Please post the resulting html but create a question on stackoverflow. I don't answer questions there, only bugs.

Thanks.