gmaps4rails 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,11 @@
|
|
1
1
|
<% #thanks to enable_css, user can avoid this css to be loaded
|
2
|
-
if enable_css == true
|
2
|
+
if enable_css == true and options[:scripts].nil? %>
|
3
3
|
<% content_for :head do %>
|
4
4
|
<%= stylesheet_link_tag 'gmaps4rails' %>
|
5
5
|
<% end %>
|
6
6
|
<% end %>
|
7
7
|
<% content_for :scripts do %>
|
8
|
-
<% if enable_js == true
|
8
|
+
<% if enable_js == true and options[:scripts].try(:to_sym) != :none %>
|
9
9
|
<% case options[:map_options].try(:[], :provider) %>
|
10
10
|
<% when "openlayers" %>
|
11
11
|
<script src="http://www.openlayers.org/api/OpenLayers.js"></script>
|
@@ -50,11 +50,9 @@ if enable_css == true && options[:scripts].nil? %>
|
|
50
50
|
<!-- TODO: change this style dynamically -->
|
51
51
|
</div>
|
52
52
|
<% when "bing" %>
|
53
|
-
<div id="<%=
|
54
|
-
<div id="<%= gmaps_map_id(options) %>" class="bing_map"></div>
|
55
|
-
</div>
|
53
|
+
<div id="<%= gmaps_map_id(options) %>" class="<%= gmaps_map_class(options) %>"></div>
|
56
54
|
<% else %>
|
57
|
-
<div class="<%=
|
55
|
+
<div class="<%= gmaps_container_class(options) %>">
|
58
56
|
<div id="<%= gmaps_map_id(options) %>" class="<%= gmaps_map_class(options) %>"></div>
|
59
57
|
</div>
|
60
58
|
<% end %>
|
@@ -25,11 +25,12 @@ module Gmaps4railsHelper
|
|
25
25
|
options[:map_options].try(:[], :id) || Gmaps4rails::DEFAULT_MAP_ID
|
26
26
|
end
|
27
27
|
|
28
|
-
def
|
29
|
-
options[:map_options].try(:[], :
|
28
|
+
def gmaps_container_class(options)
|
29
|
+
options[:map_options].try(:[], :container_class) || "map_container"
|
30
30
|
end
|
31
31
|
|
32
32
|
def gmaps_map_class(options)
|
33
|
-
options[:map_options].try(:[], :
|
33
|
+
default_class = options[:map_options].try(:[], :provider) == "bing" ? "bing_map" : "gmaps4rails_map"
|
34
|
+
options[:map_options].try(:[], :class) || default_class
|
34
35
|
end
|
35
36
|
end
|
@@ -429,7 +429,7 @@ function Gmaps4Rails() {
|
|
429
429
|
////////////////////////////////////////////////////
|
430
430
|
|
431
431
|
//to make the map fit the different LatLng points
|
432
|
-
this.adjustMapToBounds = function(
|
432
|
+
this.adjustMapToBounds = function() {
|
433
433
|
|
434
434
|
//FIRST_STEP: retrieve all bounds
|
435
435
|
//create the bounds object only if necessary
|
@@ -464,6 +464,7 @@ function Gmaps4Rails() {
|
|
464
464
|
//in every case, I've to take into account the bounds set up by the user
|
465
465
|
for (var i = 0; i < this.map_options.bounds.length; ++i) {
|
466
466
|
//create points from bounds provided
|
467
|
+
//TODO:only works with google maps
|
467
468
|
var bound = this.createLatLng(this.map_options.bounds[i].lat, this.map_options.bounds[i].lng);
|
468
469
|
this.boundsObject.extend(bound);
|
469
470
|
}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gmaps4rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 2
|
10
|
+
version: 1.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Benjamin Roth
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-08-
|
19
|
+
date: 2011-08-31 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: crack
|