maptastic 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc
CHANGED
@@ -29,7 +29,7 @@ To include the required javascripts put these two lines in your application.html
|
|
29
29
|
<%= maptastic_provider_tag %>
|
30
30
|
<%= javascript_include_tag 'maptastic' %>
|
31
31
|
|
32
|
-
To finalize the installation please set your
|
32
|
+
To finalize the installation please set your defaults in <tt>config/initializers/maptastic.rb</tt>
|
33
33
|
|
34
34
|
== Configuration
|
35
35
|
|
@@ -37,7 +37,7 @@ To configure maptastic to your needs edit the <tt>config/initializers/maptastic.
|
|
37
37
|
|
38
38
|
== Usage
|
39
39
|
|
40
|
-
Read the API documentation at http://
|
40
|
+
Read the API documentation at http://benedikt.github.com/maptastic/doc
|
41
41
|
|
42
42
|
Examples (without markers):
|
43
43
|
|
data/lib/maptastic.rb
CHANGED
@@ -2,12 +2,6 @@ require 'maptastic/railtie'
|
|
2
2
|
|
3
3
|
module Maptastic
|
4
4
|
|
5
|
-
##
|
6
|
-
# :singleton-method: api_key
|
7
|
-
# Stores the application's Google Maps API key.
|
8
|
-
mattr_accessor :api_key
|
9
|
-
@@api_key = ""
|
10
|
-
|
11
5
|
##
|
12
6
|
# :singleton-method: longitude_attribute
|
13
7
|
# Gets the attribute name used to get the longitude of an object
|
data/lib/maptastic/version.rb
CHANGED
@@ -7,8 +7,25 @@ module Maptastic
|
|
7
7
|
#
|
8
8
|
# Available options:
|
9
9
|
#
|
10
|
-
#
|
10
|
+
# - :zoom -- Map zoom level
|
11
|
+
# - :controls -- Show UI controls (true / false)
|
12
|
+
# - :dragging -- Toggle dragging (true / false)
|
13
|
+
# - :zooming -- Toggle zooming (true / false)
|
14
|
+
# - :center -- Coordinate to center the map around
|
11
15
|
#
|
16
|
+
# Examples (without markers):
|
17
|
+
#
|
18
|
+
# <%= maptastic :center => [37.4419, -122.1419] %>
|
19
|
+
# <%= maptastic :center => @poi %> # @poi.latitude and @poi.longitude are used
|
20
|
+
#
|
21
|
+
# Examples (with markers):
|
22
|
+
#
|
23
|
+
# <%= maptastic @poi %> # Simple marker without info window
|
24
|
+
# <%= maptastic @pois do |poi| %>
|
25
|
+
# Generates a marker with info window (bubble). Uses @poi.latitude and @poi.longitude
|
26
|
+
# to position the marker.
|
27
|
+
# <%= poi.name %>
|
28
|
+
# <% end %>
|
12
29
|
def maptastic(*args, &block)
|
13
30
|
options = args.extract_options!
|
14
31
|
|
@@ -27,6 +44,8 @@ module Maptastic
|
|
27
44
|
content_tag(:div, marker_html_for(markers, &block), options)
|
28
45
|
end
|
29
46
|
|
47
|
+
##
|
48
|
+
# Includes the Google Maps API tag.
|
30
49
|
def maptastic_provider_tag
|
31
50
|
provider_url = "http://maps.google.com/maps/api/js?v=3".tap do |u|
|
32
51
|
u << "&sensor=" + (Maptastic.sensor ? "true" : "false")
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: maptastic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Benedikt Deicke
|