gmaps4rails 1.1.6 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,8 +4,10 @@ Gmaps.loadMaps = ->
4
4
  #loop through all variable names.
5
5
  #there should only be maps inside so it trigger their load function
6
6
  for key, value of Gmaps
7
- if key != "loadMaps"
8
- window["load_" + key]()
7
+ searchLoadIncluded = key.search(/load/)
8
+ if searchLoadIncluded == -1
9
+ load_function_name = "load_" + key
10
+ Gmaps[load_function_name]()
9
11
 
10
12
  window.Gmaps = Gmaps
11
13
 
@@ -14,7 +14,7 @@ if enable_css == true and options[:scripts].nil? %>
14
14
  <% when "bing" %>
15
15
  <script type="text/javascript" src="http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0"></script>
16
16
  <% else %>
17
- <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&amp;libraries=geometry<%= g_libraries(options[:map_options].try(:[], :libraries)) %>"></script>
17
+ <script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3.5&sensor=false&amp;libraries=geometry<%= g_libraries(options[:map_options].try(:[], :libraries)) %>"></script>
18
18
  <script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/tags/infobox/1.1.5/src/infobox.js"></script>
19
19
  <script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0.1/src/markerclusterer.js"></script>
20
20
  <script type="text/javascript" src="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/richmarker/src/richmarker-compiled.js"></script>
@@ -15,12 +15,12 @@ module Gmaps4rails
15
15
  copy_file '../../../public/stylesheets/gmaps4rails.css', 'app/assets/stylesheets/gmaps4rails.css'
16
16
  else
17
17
  #I don't copy manifests, kind of useless
18
- copy_file '../../../public/javascripts/gmaps4rails/gmaps4rails.base.js', 'public/javascripts/gmaps4rails.base.js'
19
- copy_file '../../../public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js', 'public/javascripts/gmaps4rails.googlemaps.js'
20
- copy_file '../../../public/javascripts/gmaps4rails/gmaps4rails.bing.js', 'public/javascripts/gmaps4rails.bing.js'
21
- copy_file '../../../public/javascripts/gmaps4rails/gmaps4rails.openlayers.js', 'public/javascripts/gmaps4rails.openlayers.js'
22
- copy_file '../../../public/javascripts/gmaps4rails/gmaps4rails.mapquest.js', 'public/javascripts/gmaps4rails.mapquest.js'
23
- copy_file '../../../public/stylesheets/gmaps4rails.css', 'public/stylesheets/gmaps4rails.css'
18
+ copy_file '../../../public/javascripts/gmaps4rails/gmaps4rails.base.js', 'public/javascripts/gmaps4rails/gmaps4rails.base.js'
19
+ copy_file '../../../public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js', 'public/javascripts/gmaps4rails/gmaps4rails.googlemaps.js'
20
+ copy_file '../../../public/javascripts/gmaps4rails/gmaps4rails.bing.js', 'public/javascripts/gmaps4rails/gmaps4rails.bing.js'
21
+ copy_file '../../../public/javascripts/gmaps4rails/gmaps4rails.openlayers.js', 'public/javascripts/gmaps4rails/gmaps4rails.openlayers.js'
22
+ copy_file '../../../public/javascripts/gmaps4rails/gmaps4rails.mapquest.js', 'public/javascripts/gmaps4rails/gmaps4rails.mapquest.js'
23
+ copy_file '../../../public/stylesheets/gmaps4rails.css', 'public/stylesheets/gmaps4rails.css'
24
24
  end
25
25
  copy_file '../../../public/images/marker.png', 'public/images/marker.png'
26
26
  end
@@ -252,7 +252,7 @@ module Gmaps4rails
252
252
 
253
253
  #means we are creating a new map
254
254
  result << "#{map_id} = new #{Gmaps4rails.get_constructor hash[:map_options] }" + ";"
255
- result << "function #{Gmaps4rails.js_function_name hash }() {"
255
+ result << "Gmaps.#{Gmaps4rails.js_function_name hash } = function() {"
256
256
  result << Gmaps4rails.create_map_js(hash[:map_options], map_id) unless hash[:map_options].nil?
257
257
  result << "#{map_id}.initialize();"
258
258
 
@@ -270,6 +270,7 @@ module Gmaps4rails
270
270
  result << "#{map_id}.callback();"
271
271
 
272
272
  result << "};"
273
+ # result << "debugger;"
273
274
  if hash[:last_map].nil? || hash[:last_map] == true
274
275
  result << "window.onload = function() { Gmaps.loadMaps(); };"
275
276
  end
@@ -278,4 +279,4 @@ module Gmaps4rails
278
279
  ')
279
280
  end
280
281
 
281
- end
282
+ end
@@ -2,11 +2,12 @@
2
2
  var Gmaps;
3
3
  Gmaps = {};
4
4
  Gmaps.loadMaps = function() {
5
- var key, value, _results;
5
+ var key, load_function_name, searchLoadIncluded, value, _results;
6
6
  _results = [];
7
7
  for (key in Gmaps) {
8
8
  value = Gmaps[key];
9
- _results.push(key !== "loadMaps" ? window["load_" + key]() : void 0);
9
+ searchLoadIncluded = key.search(/load/);
10
+ _results.push(searchLoadIncluded === -1 ? (load_function_name = "load_" + key, Gmaps[load_function_name]()) : void 0);
10
11
  }
11
12
  return _results;
12
13
  };
@@ -193,6 +193,7 @@
193
193
  return _results;
194
194
  };
195
195
  Gmaps4RailsGoogle.prototype.clearMarker = function(marker) {
196
+ console.log(marker);
196
197
  return marker.serviceObject.setMap(null);
197
198
  };
198
199
  Gmaps4RailsGoogle.prototype.showMarker = function(marker) {
metadata CHANGED
@@ -1,41 +1,49 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: gmaps4rails
3
- version: !ruby/object:Gem::Version
4
- version: 1.1.6
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
5
  prerelease:
6
+ segments:
7
+ - 1
8
+ - 1
9
+ - 7
10
+ version: 1.1.7
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Benjamin Roth
9
14
  - David Ruyer
10
15
  autorequire:
11
16
  bindir: bin
12
17
  cert_chain: []
13
- date: 2011-09-20 00:00:00.000000000Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
18
+
19
+ date: 2011-09-22 00:00:00 Z
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
16
22
  name: crack
17
- requirement: &2152433280 !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
18
25
  none: false
19
- requirements:
20
- - - ! '>='
21
- - !ruby/object:Gem::Version
22
- version: '0'
26
+ requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ hash: 3
30
+ segments:
31
+ - 0
32
+ version: "0"
23
33
  type: :runtime
24
- prerelease: false
25
- version_requirements: *2152433280
26
- description: ! 'Enables easy display of items (taken from a Rails 3 model) on a Google
27
- Maps (JS API V3), OpenLayers, Mapquest and Bing. Geocoding + Directions included.
28
- Provides much options: markers customization, infowindows, auto-adjusted zoom, polylines,
29
- polygons, circles etc... See wiki on github for full description and examples.'
30
- email:
34
+ version_requirements: *id001
35
+ description: "Enables easy display of items (taken from a Rails 3 model) on a Google Maps (JS API V3), OpenLayers, Mapquest and Bing. Geocoding + Directions included. Provides much options: markers customization, infowindows, auto-adjusted zoom, polylines, polygons, circles etc... See wiki on github for full description and examples."
36
+ email:
31
37
  - apnea.diving.deep@gmail.com
32
38
  - david.ruyer@gmail.com
33
39
  executables: []
40
+
34
41
  extensions: []
35
- extra_rdoc_files:
42
+
43
+ extra_rdoc_files:
36
44
  - LICENSE.txt
37
45
  - README.rdoc
38
- files:
46
+ files:
39
47
  - app/assets/javascripts/gmaps4rails/all_apis.js
40
48
  - app/assets/javascripts/gmaps4rails/bing.js
41
49
  - app/assets/javascripts/gmaps4rails/gmaps4rails.base.js.coffee
@@ -66,27 +74,36 @@ files:
66
74
  - README.rdoc
67
75
  homepage: http://github.com/apneadiving/Google-Maps-for-Rails
68
76
  licenses: []
77
+
69
78
  post_install_message:
70
79
  rdoc_options: []
71
- require_paths:
80
+
81
+ require_paths:
72
82
  - lib
73
- required_ruby_version: !ruby/object:Gem::Requirement
83
+ required_ruby_version: !ruby/object:Gem::Requirement
74
84
  none: false
75
- requirements:
76
- - - ! '>='
77
- - !ruby/object:Gem::Version
78
- version: '0'
79
- required_rubygems_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ hash: 3
89
+ segments:
90
+ - 0
91
+ version: "0"
92
+ required_rubygems_version: !ruby/object:Gem::Requirement
80
93
  none: false
81
- requirements:
82
- - - ! '>='
83
- - !ruby/object:Gem::Version
84
- version: '0'
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ hash: 3
98
+ segments:
99
+ - 0
100
+ version: "0"
85
101
  requirements: []
102
+
86
103
  rubyforge_project:
87
104
  rubygems_version: 1.8.6
88
105
  signing_key:
89
106
  specification_version: 3
90
- summary: Enables easy display of items (taken from a Rails 3 model) on a Google Maps
91
- (JS API V3), OpenLayers, Mapquest and Bing. Geocoding + Directions included.
107
+ summary: Enables easy display of items (taken from a Rails 3 model) on a Google Maps (JS API V3), OpenLayers, Mapquest and Bing. Geocoding + Directions included.
92
108
  test_files: []
109
+