gmaps4rails 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc
CHANGED
@@ -12,7 +12,7 @@ See screencasts here: http://www.youtube.com/user/TheApneadiving
|
|
12
12
|
|
13
13
|
== When Gmaps4rails finally means Global Maps for Rails
|
14
14
|
|
15
|
-
I
|
15
|
+
I've added support for other map providers:
|
16
16
|
|
17
17
|
* openlayers
|
18
18
|
|
@@ -22,7 +22,7 @@ I now want to extend the gem, so it would support other map providers. I intend
|
|
22
22
|
|
23
23
|
See: https://github.com/apneadiving/Google-Maps-for-Rails/wiki/Map-Apis
|
24
24
|
|
25
|
-
Any help would be appreciated.
|
25
|
+
Any help would be appreciated to complete this work.
|
26
26
|
|
27
27
|
|
28
28
|
== Requirements
|
@@ -34,18 +34,21 @@ Any help would be appreciated.
|
|
34
34
|
== Basic configuration
|
35
35
|
In your model, add:
|
36
36
|
|
37
|
-
acts_as_gmappable
|
38
37
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
38
|
+
acts_as_gmappable
|
39
|
+
|
40
|
+
def gmaps4rails_address
|
41
|
+
#describe how to retrieve the address from your model, if you use directly a db column, you can dry your code, see wiki
|
42
|
+
"#{self.street}, #{self.city}, #{self.country}"
|
43
|
+
end
|
43
44
|
|
44
45
|
Create a migration and add the following fields to your table (here users):
|
45
46
|
|
46
|
-
|
47
|
-
|
48
|
-
|
47
|
+
|
48
|
+
add_column :users, :latitude, :float #you can change the name, see wiki
|
49
|
+
add_column :users, :longitude, :float #you can change the name, see wiki
|
50
|
+
add_column :users, :gmaps, :boolean #not mandatory, see wiki
|
51
|
+
|
49
52
|
|
50
53
|
== How to?
|
51
54
|
=== QuickStart!
|
@@ -21,7 +21,7 @@ if enable_css == true %>
|
|
21
21
|
<%= javascript_include_tag 'gmaps4rails.bing.js' %>
|
22
22
|
<% else %>
|
23
23
|
<%= javascript_include_tag 'gmaps4rails.googlemaps.js' %>
|
24
|
-
<script type="text/javascript" src='http://maps.google.com/maps/api/js?sensor=false&libraries=geometry'></script>
|
24
|
+
<script type="text/javascript" src='http://maps.google.com/maps/api/js?sensor=false&libraries=geometry'></script>
|
25
25
|
<script type="text/javascript" src='http://google-maps-utility-library-v3.googlecode.com/svn/tags/infobox/1.1.5/src/infobox.js'></script>
|
26
26
|
<script type="text/javascript" src='http://google-maps-utility-library-v3.googlecode.com/svn/tags/markerclusterer/1.0/src/markerclusterer_compiled.js'></script>
|
27
27
|
<% end %>
|
@@ -41,7 +41,7 @@ window.onload = gmaps4rails_init;
|
|
41
41
|
<% case options['map_options'].try(:[], 'provider') %>
|
42
42
|
<% when "mapquest" %>
|
43
43
|
<div id="mapQuest" style="width:750px; height:475px;">
|
44
|
-
<!--
|
44
|
+
<!-- TODO: change this style dynamically -->
|
45
45
|
</div>
|
46
46
|
<% when "bing" %>
|
47
47
|
<div id="<%= options['map_options'].try(:[],'container_id').nil? ? "map_container" : options['map_options']['container_id'] %>" >
|
@@ -7,6 +7,10 @@ module Gmaps4rails
|
|
7
7
|
|
8
8
|
def copy_locale
|
9
9
|
copy_file '../../../public/javascripts/gmaps4rails.js', 'public/javascripts/gmaps4rails.js'
|
10
|
+
copy_file '../../../public/javascripts/gmaps4rails.js', 'public/javascripts/gmaps4rails.googlemaps.js'
|
11
|
+
copy_file '../../../public/javascripts/gmaps4rails.js', 'public/javascripts/gmaps4rails.bing.js'
|
12
|
+
copy_file '../../../public/javascripts/gmaps4rails.js', 'public/javascripts/gmaps4rails.openlayers.js'
|
13
|
+
copy_file '../../../public/javascripts/gmaps4rails.js', 'public/javascripts/gmaps4rails.mapquest.js'
|
10
14
|
copy_file '../../../public/stylesheets/gmaps4rails.css', 'public/stylesheets/gmaps4rails.css'
|
11
15
|
copy_file '../../../public/images/marker.png', 'public/images/marker.png'
|
12
16
|
end
|
@@ -6,18 +6,18 @@ class User < ActiveRecord::Base
|
|
6
6
|
sec_address
|
7
7
|
end
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
9
|
+
|
10
|
+
def gmaps4rails_marker_picture
|
11
|
+
{
|
12
|
+
"picture" => "http://www.blankdots.com/img/github-32x32.png",
|
13
|
+
"width" => "32",
|
14
|
+
"height" => "32",
|
15
|
+
"shadow_picture" => "https://secure.gravatar.com/avatar/808bec1c640143bd7091888d9edfb2f2.png",
|
16
|
+
"shadow_height" => 40,
|
17
|
+
"shadow_width" => 50,
|
18
|
+
"shadow_anchor" => [10, -30]
|
19
|
+
}
|
20
|
+
end
|
21
21
|
|
22
22
|
#
|
23
23
|
# def gmaps4rails_title
|
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: 53
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 10
|
9
|
-
-
|
10
|
-
version: 0.10.
|
9
|
+
- 1
|
10
|
+
version: 0.10.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-07-
|
19
|
+
date: 2011-07-20 00:00:00 +02:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|