apneadiving / Google-Maps-for-Rails

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

Maps not rendering properly on my page #451

Closed abrambailey closed 9 years ago

abrambailey commented 9 years ago

Please see: http://www.hearingtracker.com/hearing-providers/17354-al-turri

Some controls not rendering properly on map.

function initialize() {

      function createSidebarLi(json){
        return ("my unordered list html");
      };

      function bindLiToMarker($a, marker){
        $a.on('click', function(){
          handler.getMap();
          marker.setMap(handler.getMap()); //because clusterer removes map property from marker
          marker.panTo();
          google.maps.event.trigger(marker.getServiceObject(), 'click');
          handler.getMap().setZoom(15);
        })
      };

      function createSidebar(json_array){
        _.each(json_array, function(json){
          var $li = $( createSidebarLi(json) );
          $li.appendTo('#sidebar_container1');
          bindLiToMarker($li, json.marker);
        });
      };

      handler = Gmaps.build('Google');
      handler.buildMap({ internal: {id: 'sidebar_builder'}}, function(){

          var json_array = <%= raw @hash.to_json %>;
          var markers = handler.addMarkers(json_array)

        _.each(json_array, function(json, index){
          json.marker = markers[index];
        });

        createSidebar(json_array);
        handler.bounds.extendWith(markers);
        handler.fitMapToBounds();
        <% if @dispenser.branches.count == 1 %>
          handler.getMap().setZoom(15);
        <% end %>
      });
    }
    google.maps.event.addDomListener(window, "load", initialize);  
apneadiving commented 9 years ago

Sorry but I'm not your css guy.

The wiki contains sections with known issues when using bootstrap or foundation with google maps.

Gmaps4raiks doest add an extra layer of css uncertainty.

abrambailey commented 9 years ago

Whoa there. Sorry didn't even realize this was a CSS issue. You've been so nice in the past!

apneadiving commented 9 years ago

Was not meant to be rude, sorry :)

abrambailey commented 9 years ago

No problem. Thanks I will check the wiki better next time :p