gmaps4rails 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +9 -4
- data/app/controllers/gmaps4rails/gmaps_controller.rb +18 -18
- data/app/views/gmaps4rails/_gmaps4rails.html.erb +1 -1
- data/config/routes.rb +5 -5
- data/lib/acts_as_gmappable/base.rb +1 -1
- data/lib/hash.rb +4 -4
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -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 &
|
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
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
data/config/routes.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
Rails.application.routes.draw do
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
end
|
1
|
+
# Rails.application.routes.draw do
|
2
|
+
#
|
3
|
+
# resources :gmaps, :only => [ :index ], :controller => "gmaps4rails/gmaps"
|
4
|
+
#
|
5
|
+
# end
|
data/lib/hash.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
class Hash
|
2
2
|
def to_gmaps4rails(init = false)
|
3
|
-
#the variable 'options'
|
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
|
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:
|
4
|
+
hash: 5
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
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-
|
19
|
+
date: 2011-03-18 00:00:00 +01:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|