English 中文(简体)
gmap4rails not showmap
原标题:gmaps4rails not showing map

Following the YouTube video on getting to run Gmaps4rails, I cannot get it to show a map. (Rails 3.1.3, gmaps4rails 1.3.2)

The page includes the correct javascript assets in the head ...

<script src="/assets/gmaps4rails/gmaps4rails.base.js?body=1" type="text/javascript"></script>
<script src="/assets/gmaps4rails/gmaps4rails.bing.js?body=1" type="text/javascript"></script>
<script src="/assets/gmaps4rails/gmaps4rails.googlemaps.js?body=1" type="text/javascript"></script>
<script src="/assets/gmaps4rails/gmaps4rails.mapquest.js?body=1" type="text/javascript"></script>
<script src="/assets/gmaps4rails/gmaps4rails.openlayers.js?body=1" type="text/javascript"></script>

... the correct placeholder for the map is included ...

<div class="map_container"> 
  <div id="map" class="gmaps4rails_map"></div>
</div>

发言稿在我身体结束时提出:

<script type="text/javascript" src="//maps.google.com/maps/api/js?v=3.5&sensor=false&amp;libraries=geometry"></script>
<script type="text/javascript" src="//google-maps-utility-library-v3.googlecode.com/svn/tags/infobox/1.1.9/src/infobox_packed.js"></script>
<script type="text/javascript" src="//google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0.5/src/markerclusterer_packed.js"></script>
<script type="text/javascript" src="//google-maps-utility-library-v3.googlecode.com/svn/trunk/richmarker/src/richmarker-compiled.js"></script>  

<script type="text/javascript" charset="utf-8">

Gmaps.map = new Gmaps4RailsGoogle();
Gmaps.load_map = function() {
Gmaps.map.map_options.auto_adjust = true;
Gmaps.map.initialize();
Gmaps.map.markers = [{"lng": "4.481594", "lat": "51.194179"}];
Gmaps.map.markers_conf.do_clustering = true;
Gmaps.map.create_markers();
Gmaps.map.adjustMapToBounds();
Gmaps.map.callback();
};    
window.onload = function() { Gmaps.loadMaps(); };

</script>

所有部分似乎都已到位,但没有做任何事情。 我不敢肯定如何去掉。 我是否对一些批评?

最佳回答

The stylesheets for gmaps4rails were not included in my page, since I had overwritten the default application.css by my own styling. As a result, the maps did not show up.

必须确保<条码>gmaps4rails.cs 解决这个问题。

<%= stylesheet_link_tag "gmaps4rails" %>
问题回答

Your content looks pretty similar to what I have; unfortunately I cannot see anything amiss right away.

回答你提问的最后一个部分:你是否利用了你的浏览器的 de子,看看在翻译过程中是否出现了任何联合材料错误?





相关问题
Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

multiple ruby extension modules under one directory

Can sources for discrete ruby extension modules live in the same directory, controlled by the same extconf.rb script? Background: I ve a project with two extension modules, foo.so and bar.so which ...

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

热门标签