gmaps4rails 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,6 @@
1
1
  == Google Maps for Rails (gmaps4rails)
2
2
 
3
-
4
- Gmaps4rails is developped to simply create a Google Map (Gmaps):
3
+ Gmaps4rails is developped to simply create a Google Map:
5
4
 
6
5
  - directly from your model,
7
6
 
@@ -16,7 +15,7 @@ It's based on Ruby on Rails 3 Engines and uses Google Maps API V3.
16
15
  == Requirements
17
16
  - <%= yield :head %> (in your header)
18
17
  - <%= yield :scripts %> (in your footer)
19
- - config.serve_static_assets = true (in your production.rb), or copy/paste gmaps4rails.css & gmaps4rail.js files in your app.
18
+ - config.serve_static_assets = true (in your production.rb), or copy/paste gmaps4rails.css & gmaps4rails.js files in your app.
20
19
 
21
20
  == Basic configuration
22
21
  In your model, add:
@@ -63,6 +62,12 @@ Done!
63
62
 
64
63
  == Todo?
65
64
 
65
+ * Marker clusterer customization
66
+
67
+ * {Integrate Markers with Label} [http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerwithlabel/1.1.2/]
68
+
69
+ * {Other options from here} [http://code.google.com/p/google-maps-utility-library-v3/wiki/Libraries] ?
70
+
66
71
  Feel free ton contact us, you have your say.
67
72
 
68
73
  == Copyright
@@ -70,4 +75,4 @@ MIT license.
70
75
 
71
76
  Authors: Benjamin Roth, David Ruyer
72
77
 
73
- Contributor: Alex Vorobiev
78
+ Contributor: Alex Vorobiev
@@ -1,22 +1,22 @@
1
1
  module Gmaps4rails
2
2
  class GmapsController < ApplicationController
3
- unloadable
4
-
5
- def index
6
- @model = params["model"]
7
- @scope = params["scope"]
8
- @model = @model.constantize
9
-
10
- # The split returns the array [scope_name, arg1, arg2, ...]
11
- if @scope && !@scope.empty? && @model.gmaps4rails_trusted_scopes.include?(@scope.split(/\(| *, *|\)/)[0])
12
- object = eval("#{@model}.#{@scope}") # Cannot use send with lambda scope
13
- # because the arguments have to be separated
14
- @objects = object.to_gmaps4rails
15
- else
16
- @objects = @model.all.to_gmaps4rails
17
- end
18
-
19
- render :json => @objects
20
- end
3
+ # unloadable
4
+ #
5
+ # def index
6
+ # @model = params["model"]
7
+ # @scope = params["scope"]
8
+ # @model = @model.constantize
9
+ #
10
+ # # The split returns the array [scope_name, arg1, arg2, ...]
11
+ # if @scope && !@scope.empty? && @model.gmaps4rails_trusted_scopes.include?(@scope.split(/\(| *, *|\)/)[0])
12
+ # object = eval("#{@model}.#{@scope}") # Cannot use send with lambda scope
13
+ # # because the arguments have to be separated
14
+ # @objects = object.to_gmaps4rails
15
+ # else
16
+ # @objects = @model.all.to_gmaps4rails
17
+ # end
18
+ #
19
+ # render :json => @objects
20
+ # end
21
21
  end
22
22
  end
@@ -1,4 +1,4 @@
1
- <% #enable_css enables user to avoid this css to be loaded
1
+ <% #thanks to enable_css, user can avoid this css to be loaded
2
2
  if enable_css == true %>
3
3
  <% content_for :head do %>
4
4
  <%= stylesheet_link_tag 'gmaps4rails' %>
@@ -1,5 +1,5 @@
1
- Rails.application.routes.draw do
2
-
3
- resources :gmaps, :only => [ :index ], :controller => "gmaps4rails/gmaps"
4
-
5
- end
1
+ # Rails.application.routes.draw do
2
+ #
3
+ # resources :gmaps, :only => [ :index ], :controller => "gmaps4rails/gmaps"
4
+ #
5
+ # end
@@ -110,7 +110,7 @@ module Gmaps4rails
110
110
 
111
111
 
112
112
  def Gmaps4rails.filter(data)
113
- return data if data.is_a?(Numeric)
113
+ return data if data.is_a?(Numeric) || data.is_a?(TrueClass) || data.is_a?(FalseClass)
114
114
  "'#{data}'"
115
115
  end
116
116
 
@@ -1,6 +1,6 @@
1
1
  class Hash
2
2
  def to_gmaps4rails(init = false)
3
- #the variable 'options' has the following structure
3
+ #the variable 'options' must have the following structure
4
4
  #{
5
5
  # "map_options" => hash,
6
6
  # "markers" => { "data" => json, "options" => hash },
@@ -9,7 +9,7 @@ class Hash
9
9
  # "circles" => { "data" => json, "options" => hash },
10
10
  # "direction" => { "data" => hash, "options" => hash }
11
11
  #}
12
- # "map_options" and "direction" must be treated separately because there content is slightly different from the other
12
+ # "map_options" and "direction" must be treated separately because there content is slightly different from the others:
13
13
  # - "map_options" has no data
14
14
  # - "direction" has a hash as a data and waypoints options must be processed properly
15
15
  #
@@ -44,10 +44,10 @@ class Hash
44
44
  waypoints << { "location" => waypoint, "stopover" => true }.to_json
45
45
  end
46
46
  result << "Gmaps4Rails.direction_conf.waypoints = [#{waypoints * (",")}];"
47
- else #option_k != "waypoint" %>
47
+ else #option_k != "waypoint"
48
48
  result << "Gmaps4Rails.direction_conf.#{option_k} = #{Gmaps4rails.filter option_v};"
49
49
  end
50
- end #end .each %>
50
+ end #end .each
51
51
  result << "Gmaps4Rails.create_direction();"
52
52
  else #default behaviour in case condition
53
53
  result << "Gmaps4Rails.#{category} = #{content["data"]};"
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: 7
4
+ hash: 5
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 0
10
- version: 0.6.0
9
+ - 1
10
+ version: 0.6.1
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-03-17 00:00:00 +01:00
19
+ date: 2011-03-18 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency