overlord 0.1.7 → 0.1.8
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.
- data/VERSION +1 -1
- data/app/helpers/overlord_google_helper.rb +12 -8
- data/app/views/google/_map.html.erb +3 -3
- data/lib/overlord/google_base.rb +1 -1
- data/overlord.gemspec +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
@@ -126,17 +126,21 @@ module OverlordGoogleHelper
|
|
126
126
|
end
|
127
127
|
|
128
128
|
# Generate a google map that includes the location of each item in
|
129
|
-
#
|
130
|
-
#
|
131
|
-
# mapped_objects:
|
129
|
+
#
|
130
|
+
# center_on: An object that defines a lat and lng attribute that will be used to center the map
|
131
|
+
# mapped_objects: An array of object each of which must define a lat and lng attribute.
|
132
132
|
# content_id: Name of the div that will hold the widget google generates.
|
133
133
|
# If this method is called more than once on a given page then you will need to
|
134
134
|
# specify different content_ids for each call.
|
135
|
-
# options: A hash containing
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
135
|
+
# options: A hash containing optional values to pass to the Google widget.
|
136
|
+
# For example:
|
137
|
+
# :zoom => 10 # Values from 1-20 that indicate how far to zoom into the map. Smaller values zoom further out.
|
138
|
+
# :map_control => 'LargeMapControl' # LargeMapControl or SmallMapControl depending on what size of map you want to display
|
139
|
+
def google_map(center_on,
|
140
|
+
mapped_objects,
|
141
|
+
content_id = 'map_content',
|
142
|
+
options = {})
|
143
|
+
render :partial => 'google/map', :locals => { :center_on => center_on, :mapped_objects => mapped_objects, :content_id => content_id, :options => options }
|
140
144
|
end
|
141
145
|
|
142
146
|
# Given a feed attempts to assign an appropriate class
|
@@ -6,8 +6,8 @@
|
|
6
6
|
google.setOnLoadCallback(function() {
|
7
7
|
if (google.maps.BrowserIsCompatible()) {
|
8
8
|
var map = new google.maps.Map2(document.getElementById("<%=content_id%>"));
|
9
|
-
map.setCenter(new google.maps.LatLng(
|
10
|
-
map.addControl(new google.maps
|
9
|
+
map.setCenter(new google.maps.LatLng(<%=center_on.lat%>, <%=center_on.lng%>), <%= options[:zoom] || 13 %>);
|
10
|
+
map.addControl(new google.maps.<%=options[:MapControl] || 'LargeMapControl'%>());
|
11
11
|
map.addControl(new google.maps.MapTypeControl());
|
12
12
|
|
13
13
|
// Create a base icon for all of our markers that specifies the
|
@@ -50,7 +50,7 @@ google.setOnLoadCallback(function() {
|
|
50
50
|
}
|
51
51
|
}
|
52
52
|
});
|
53
|
+
jQuery(window).unload( function () { GUnload(); } );
|
53
54
|
</script>
|
54
55
|
|
55
|
-
onunload="google.maps.Unload()"
|
56
56
|
<div id="<%=content_id%>" style="width: 500px; height: 300px"></div>
|
data/lib/overlord/google_base.rb
CHANGED
@@ -33,7 +33,7 @@ module Overlord
|
|
33
33
|
# options: Options to be sent
|
34
34
|
# :query - query
|
35
35
|
# :headers - headers
|
36
|
-
def self.get(uri, options)
|
36
|
+
def self.get(uri, options = {})
|
37
37
|
header_params = { "UserAgent" => "Ruby/#{RUBY_VERSION}" }
|
38
38
|
ref = self.referer || GlobalConfig.request_referer rescue nil
|
39
39
|
header_params["Referer"] = ref if ref
|
data/overlord.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{overlord}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.8"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Justin Ball", "Joel Duffin"]
|
12
|
-
s.date = %q{
|
12
|
+
s.date = %q{2010-01-14}
|
13
13
|
s.description = %q{Code to interact with the google ajax apis on the server and the client.}
|
14
14
|
s.email = %q{justin@tatemae.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: overlord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Ball
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date:
|
13
|
+
date: 2010-01-14 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|