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

Map doesn't display with :container_class option in ie8 #80

Closed inetufo closed 13 years ago

inetufo commented 13 years ago
<%= gmaps({
    :map_options => {:container_class => "map_container", :id => "map", :class => "gmaps4rails_map"}
  })  %>

With the latest code, when i use the above three options the map doesn't display, but in chrome or firefox it's ok.I think it's the compatibility of the js with the browser. Another issue is when i write this

<%= gmaps({
    :map_options => {:container_class => "map_container", :id => "map1", :class => "gmaps4rails_map"}
  })   %>

<%= gmaps({
    :map_options => {:container_class => "map_container", :id => "map2", :class => "gmaps4rails_map"}
  })   %>

only one map displayed

apneadiving commented 13 years ago

Damn, I lost my windows computer few months ago... Will need a VM soon.

Did you even try a basic map?

As for your second problem, you simply forgot :last_map => false

inetufo commented 13 years ago

The basic map seems right in ie8

<%= gmaps() %>

This works

inetufo commented 13 years ago
<%= gmaps({
    :map_options => {:container_class => "map_container", :id => "map1", :class => "gmaps4rails_map", :last_map => false}  
}) %>
<%= gmaps({
    :map_options => {:container_class => "map_container", :id => "map2", :class => "gmaps4rails_map", :last_map => false }  
})  %>

You mean this , i've just tried, but still only one map displayed

apneadiving commented 13 years ago

Mmm did you create the proper css for your custom map?

apneadiving commented 13 years ago

What version of the gem do you use?

inetufo commented 13 years ago

css class "map_container" and "gmaps4rails_map" is the default css class, i tried this in chrome, but only one map displayed

inetufo commented 13 years ago

I use the latest gem 1.0.2. You can have a try

apneadiving commented 13 years ago

Yep will try once at home

inetufo commented 13 years ago

A little weired, this time without :last_map option two maps displayed ...

apneadiving commented 13 years ago

it should have been:

<%= gmaps({
    :map_options => {:container_class => "map_container", :id => "map1", :class => "gmaps4rails_map"},
    :last_map => false  
}) %>
<%= gmaps({
    :map_options => {:container_class => "map_container", :id => "map2", :class => "gmaps4rails_map" }  
})  %>

Like in the wiki.

It may work without this option according to the browser's way of handling multiple window.onload

apneadiving commented 13 years ago

so weird: it happened IE 8 didn't like this line:

Gmaps.map.map_options.class = 'gmaps4rails_map';

But other lines like:

Gmaps.map.map_options.id = 'map';

Are fine...