gmaps4rails 0.8.5 → 0.8.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -65,8 +65,6 @@ Done!
65
65
 
66
66
  == Todo?
67
67
 
68
- * Marker clusterer customization
69
-
70
68
  * Integrate Markers with Label: http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerwithlabel/1.1.2/
71
69
 
72
70
  * Other options from here: http://code.google.com/p/google-maps-utility-library-v3/wiki/Libraries
@@ -27,7 +27,6 @@ window.onload = gmaps4rails_loadScript;
27
27
 
28
28
  </script>
29
29
  <% end %>
30
-
31
- <div id="<%= options["map_options"].nil? || options['map_options']['container_id'].nil? ? "map_container" : options['map_options']['container_id'] %>">
32
- <div id="<%= options["map_options"].nil? || options['map_options']['id'].nil? ? "gmaps4rails_map" : options['map_options']['id'] %>"></div>
30
+ <div id="<%= options['map_options'].try(:[],'container_id').nil? ? "map_container" : options['map_options']['container_id'] %>">
31
+ <div id="<%= options['map_options'].try(:[],'id').nil? ? "gmaps4rails_map" : options['map_options']['id'] %>"></div>
33
32
  </div>
@@ -13,8 +13,8 @@ module Gmaps4rails
13
13
  class DirectionInvalidQuery < StandardError; end
14
14
 
15
15
  def Gmaps4rails.create_json(object)
16
- unless object[object.gmaps4rails_options[:lat_column]].blank? && object[object.gmaps4rails_options[:lng_column]].blank?
17
- "{#{Gmaps4rails.description(object)}#{Gmaps4rails.title(object)}#{Gmaps4rails.sidebar(object)}\"longitude\": \"#{object[object.gmaps4rails_options[:lng_column]]}\", \"latitude\": \"#{object[object.gmaps4rails_options[:lat_column]]}\"#{Gmaps4rails.picture(object)}},\n"
16
+ unless object.send(object.gmaps4rails_options[:lat_column]).blank? && object.send(object.gmaps4rails_options[:lng_column]).blank?
17
+ "{#{Gmaps4rails.description(object)}#{Gmaps4rails.title(object)}#{Gmaps4rails.sidebar(object)}\"longitude\": \"#{object.send(object.gmaps4rails_options[:lng_column])}\", \"latitude\": \"#{object.send(object.gmaps4rails_options[:lat_column])}\"#{Gmaps4rails.picture(object)}},\n"
18
18
  end
19
19
  end
20
20
 
@@ -146,8 +146,8 @@ module Gmaps4rails
146
146
  logger.warn(e)
147
147
  #TODO add customization here?
148
148
  else #if no exception
149
- self[gmaps4rails_options[:lng_column]] = coordinates.first[:lng]
150
- self[gmaps4rails_options[:lat_column]] = coordinates.first[:lat]
149
+ self.send(gmaps4rails_options[:lng_column]+"=", coordinates.first[:lng]) if self.respond_to?(gmaps4rails_options[:lng_column]+"=")
150
+ self.send(gmaps4rails_options[:lat_column]+"=", coordinates.first[:lat]) if self.respond_to?(gmaps4rails_options[:lat_column]+"=")
151
151
  unless gmaps4rails_options[:normalized_address].nil?
152
152
  self.send(gmaps4rails_options[:normalized_address].to_s+"=", coordinates.first[:matched_address])
153
153
  end
@@ -1,4 +1,5 @@
1
1
  class UsersController < ApplicationController
2
+
2
3
  def index
3
4
  @users = User.all
4
5
  @json = User.all.to_gmaps4rails
@@ -1,10 +1,12 @@
1
1
  class User < ActiveRecord::Base
2
+
2
3
  acts_as_gmappable
3
4
 
4
5
  def gmaps4rails_address
5
6
  sec_address
6
7
  end
7
- #
8
+
9
+ #
8
10
  # def gmaps4rails_infowindow
9
11
  # "My Beautiful Name: #{name}"
10
12
  # end
@@ -22,14 +24,11 @@ class User < ActiveRecord::Base
22
24
  # end
23
25
  #
24
26
  # def gmaps4rails_sidebar
25
- # "sidebar content"
26
- # end
27
- # def gmaps4rails_sidebar
28
27
  # "<b>#{name}</b>"
29
28
  # end
30
29
  #
31
- # def gmaps4rails_infowindow
32
- # "je suis l'infowindow de #{name}"
33
- # end
30
+ # def gmaps4rails_infowindow
31
+ # "je suis l'infowindow de #{name}"
32
+ # end
34
33
 
35
34
  end
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: 53
4
+ hash: 51
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 5
10
- version: 0.8.5
9
+ - 6
10
+ version: 0.8.6
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-05-16 00:00:00 +02:00
19
+ date: 2011-05-22 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency