gmaps4rails 0.9.1 → 0.10.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,2 @@
1
1
  module ApplicationHelper
2
-
3
2
  end
@@ -1,19 +1,24 @@
1
1
  class User < ActiveRecord::Base
2
2
 
3
3
  acts_as_gmappable
4
-
4
+
5
5
  def gmaps4rails_address
6
6
  sec_address
7
7
  end
8
-
8
+
9
+ #
9
10
  # def gmaps4rails_marker_picture
10
11
  # {
11
12
  # "picture" => "http://www.blankdots.com/img/github-32x32.png",
12
13
  # "width" => "32",
13
14
  # "height" => "32",
14
- # "marker_anchor" => [10,20]
15
+ # "shadow_picture" => "https://secure.gravatar.com/avatar/808bec1c640143bd7091888d9edfb2f2.png",
16
+ # "shadow_height" => 40,
17
+ # "shadow_width" => 50,
18
+ # "shadow_anchor" => [10, -30]
15
19
  # }
16
20
  # end
21
+
17
22
  #
18
23
  # def gmaps4rails_title
19
24
  # "Sweet Title"
@@ -23,8 +28,8 @@ class User < ActiveRecord::Base
23
28
  # "<b>#{name}</b>"
24
29
  # end
25
30
  #
26
- # def gmaps4rails_infowindow
27
- # "je suis l'infowindow de #{name}"
28
- # end
31
+ # def gmaps4rails_infowindow
32
+ # "<div style='width:500px; background-color:#b0c4de;'><b>je suis l'infowindow de <h1>#{name}</h1></b> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</div>"
33
+ # end
29
34
 
30
35
  end
@@ -87,8 +87,8 @@ describe "Hash extension" do
87
87
  @options = {
88
88
  "map_options" => { "type" => "SATELLITE", "center_longitude" => 180, "zoom" => 3, "auto_adjust" => true},
89
89
  "markers" => { "data" => '[{ "description": "", "title": "", "longitude": "5.9311119", "latitude": "43.1251606", "picture": "", "width": "", "height": "" } ,{ "description": "", "title": "", "longitude": "2.3509871", "latitude": "48.8566667", "picture": "", "width": "", "height": "" } ]',
90
- "options" => { "do_clustering" => false, "list_container" => "makers_list" }
91
- },
90
+ "options" => { "do_clustering" => false, "list_container" => "makers_list" }
91
+ },
92
92
  "polylines" => { "data" => '[[
93
93
  {"longitude": -122.214897, "latitude": 37.772323},
94
94
  {"longitude": -157.821856, "latitude": 21.291982},
@@ -108,7 +108,7 @@ describe "Hash extension" do
108
108
  {"longitude": -122.214897, "latitude": 37.772323, "radius": 1000000},
109
109
  {"longitude": 122.214897, "latitude": 37.772323, "radius": 1000000, "strokeColor": "#FF0000"}
110
110
  ]',
111
- },
111
+ },
112
112
  "direction" => {
113
113
  "data" => { "from" => "toulon, france", "to" => "paris, france"} ,
114
114
  "options" => {"waypoints" => ["toulouse, france", "brest, france"], "travelMode" => "DRIVING", "display_panel" => true, "panel_id" => "instructions"}
@@ -40,14 +40,28 @@ describe Gmaps4rails::ActsAsGmappable do
40
40
  user.gmaps.should be_true
41
41
  end
42
42
 
43
- it "should render a valid json from an array of ojects" do
43
+ it "should render a valid json from an array of objects" do
44
44
  user #needed trigger the object from the let statement
45
45
  Factory(:user_paris)
46
- User.all.to_gmaps4rails.should == "[{\"longitude\": \"" + TOULON[:longitude].to_s + "\", \"latitude\": \"" + TOULON[:latitude].to_s + "\"},\n{\"longitude\": \"" + PARIS[:longitude].to_s + "\", \"latitude\": \"" + PARIS[:latitude].to_s + "\"}]"
46
+ User.all.to_gmaps4rails.should == "[{\"lng\": \"" + TOULON[:longitude].to_s + "\", \"lat\": \"" + TOULON[:latitude].to_s + "\"},\n{\"lng\": \"" + PARIS[:longitude].to_s + "\", \"lat\": \"" + PARIS[:latitude].to_s + "\"}]"
47
+ end
48
+
49
+ it "should accept additional block for an array of objects" do
50
+ user #needed trigger the object from the let statement
51
+ Factory(:user_paris)
52
+ User.all.to_gmaps4rails do |u|
53
+ "\"model\": \"" + u.class.to_s + "\""
54
+ end.should == "[{\"lng\": \"" + TOULON[:longitude].to_s + "\", \"lat\": \"" + TOULON[:latitude].to_s + "\", \"model\": \"User\"},\n{\"lng\": \"" + PARIS[:longitude].to_s + "\", \"lat\": \"" + PARIS[:latitude].to_s + "\", \"model\": \"User\"}]"
47
55
  end
48
56
 
57
+ it "should accept additional block for a single object" do
58
+ user.to_gmaps4rails do |u|
59
+ "\"model\": \"" + u.class.to_s + "\""
60
+ end.should == "[{\"lng\": \"" + TOULON[:longitude].to_s + "\", \"lat\": \"" + TOULON[:latitude].to_s + "\", \"model\": \"User\"}]"
61
+ end
62
+
49
63
  it "should render a valid json from a single object" do
50
- user.to_gmaps4rails.should == "[{\"longitude\": \"" + TOULON[:longitude].to_s + "\", \"latitude\": \"" + TOULON[:latitude].to_s + "\"}]"
64
+ user.to_gmaps4rails.should == "[{\"lng\": \"" + TOULON[:longitude].to_s + "\", \"lat\": \"" + TOULON[:latitude].to_s + "\"}]"
51
65
  end
52
66
 
53
67
  it "should not geocode again after address changes if checker is true" do
@@ -223,7 +237,7 @@ describe Gmaps4rails::ActsAsGmappable do
223
237
  "Sweet Title"
224
238
  end
225
239
  end
226
- user.to_gmaps4rails.should == "[{\"title\": \"Sweet Title\", \"longitude\": \"" + TOULON[:longitude].to_s + "\", \"latitude\": \"" + TOULON[:latitude].to_s + "\"}]"
240
+ user.to_gmaps4rails.should == "[{\"title\": \"Sweet Title\", \"lng\": \"" + TOULON[:longitude].to_s + "\", \"lat\": \"" + TOULON[:latitude].to_s + "\"}]"
227
241
  end
228
242
 
229
243
  it "should take into account the sidebar content provided in the model" do
@@ -234,7 +248,7 @@ describe Gmaps4rails::ActsAsGmappable do
234
248
  end
235
249
  user.to_gmaps4rails.should include "\"sidebar\": \"sidebar content\""
236
250
  end
237
-
251
+
238
252
  it "should take into account all additional data provided in the model" do
239
253
  user.instance_eval do
240
254
  def gmaps4rails_infowindow
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gmaps4rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
5
- prerelease: false
4
+ hash: -1876988240
5
+ prerelease: true
6
6
  segments:
7
7
  - 0
8
- - 9
9
- - 1
10
- version: 0.9.1
8
+ - 10
9
+ - 0
10
+ - pre1
11
+ version: 0.10.0.pre1
11
12
  platform: ruby
12
13
  authors:
13
14
  - Benjamin Roth
@@ -16,7 +17,7 @@ autorequire:
16
17
  bindir: bin
17
18
  cert_chain: []
18
19
 
19
- date: 2011-07-03 00:00:00 +02:00
20
+ date: 2011-07-15 00:00:00 +02:00
20
21
  default_executable:
21
22
  dependencies:
22
23
  - !ruby/object:Gem::Dependency
@@ -33,7 +34,7 @@ dependencies:
33
34
  version: "0"
34
35
  type: :runtime
35
36
  version_requirements: *id001
36
- description: "Enables easy display of items (taken from a Rails 3 model) on a Google Maps (JS API V3). 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."
37
+ 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."
37
38
  email:
38
39
  - apnea.diving.deep@gmail.com
39
40
  - david.ruyer@gmail.com
@@ -46,16 +47,20 @@ extra_rdoc_files:
46
47
  - README.rdoc
47
48
  files:
48
49
  - app/views/gmaps4rails/_gmaps4rails.html.erb
50
+ - lib/generators/gmaps4rails/install_generator.rb
51
+ - lib/generators/templates/README
49
52
  - lib/gmaps4rails.rb
50
53
  - lib/gmaps4rails/acts_as_gmappable.rb
51
54
  - lib/gmaps4rails/base.rb
52
55
  - lib/gmaps4rails/extensions/array.rb
53
56
  - lib/gmaps4rails/extensions/hash.rb
54
- - lib/gmaps4rails/generators/gmaps4rails/install_generator.rb
55
- - lib/gmaps4rails/generators/templates/README
56
57
  - lib/gmaps4rails/helper/gmaps4rails_helper.rb
57
58
  - public/images/marker.png
59
+ - public/javascripts/gmaps4rails.bing.js
60
+ - public/javascripts/gmaps4rails.googlemaps.js
58
61
  - public/javascripts/gmaps4rails.js
62
+ - public/javascripts/gmaps4rails.mapquest.js
63
+ - public/javascripts/gmaps4rails.openlayers.js
59
64
  - public/stylesheets/gmaps4rails.css
60
65
  - LICENSE.txt
61
66
  - README.rdoc
@@ -110,19 +115,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
115
  required_rubygems_version: !ruby/object:Gem::Requirement
111
116
  none: false
112
117
  requirements:
113
- - - ">="
118
+ - - ">"
114
119
  - !ruby/object:Gem::Version
115
- hash: 3
120
+ hash: 25
116
121
  segments:
117
- - 0
118
- version: "0"
122
+ - 1
123
+ - 3
124
+ - 1
125
+ version: 1.3.1
119
126
  requirements: []
120
127
 
121
128
  rubyforge_project:
122
129
  rubygems_version: 1.3.7
123
130
  signing_key:
124
131
  specification_version: 3
125
- summary: Enables easy display of items (taken from a Rails 3 model) on a Google Maps (JS API V3). Geocoding + Directions included.
132
+ 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.
126
133
  test_files:
127
134
  - test/dummy/app/controllers/application_controller.rb
128
135
  - test/dummy/app/controllers/users_controller.rb