cloud_kicker 0.0.0.pre1 → 0.0.2
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/CHANGELOG.mdown +4 -0
- data/README.rdoc +4 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/cloud_kicker.gemspec +5 -4
- data/lib/critical_juncture/cloud_kicker.rb +4 -3
- data/lib/critical_juncture/control_elements.rb +2 -2
- data/lib/critical_juncture/map.rb +24 -24
- data/lib/critical_juncture/map/map_bookmarking.rb +1 -1
- data/lib/critical_juncture/map/map_events.rb +4 -4
- data/lib/critical_juncture/markers/ajax_markers.rb +3 -3
- data/lib/critical_juncture/markers/marker.rb +1 -0
- metadata +9 -11
data/CHANGELOG.mdown
ADDED
data/README.rdoc
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
Rails abstraction layer for creating maps using the Cloudmade web framework.
|
4
4
|
|
5
|
+
== Usage
|
6
|
+
|
7
|
+
This gem is still in progress and not all features have been implemented. Still relies on code that is part of the All Your Cells website (allyourcells.com : code at github.com/trifecta/allyourcells). Particularly the marker tips are reliant on js template code. All this is in the process of being moved into this gem.
|
8
|
+
|
5
9
|
== Note on Patches/Pull Requests
|
6
10
|
|
7
11
|
* Fork the project.
|
data/Rakefile
CHANGED
@@ -11,7 +11,7 @@ begin
|
|
11
11
|
color schemes, ajax markers and customizable marker info windows quick and easy.
|
12
12
|
EOF
|
13
13
|
gem.email = "govpulse@gmail.com"
|
14
|
-
gem.homepage = "http://github.com/
|
14
|
+
gem.homepage = "http://github.com/criticaljuncture/cloud_kicker"
|
15
15
|
gem.authors = ["Bob Burbach"]
|
16
16
|
gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
17
17
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
data/cloud_kicker.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{cloud_kicker}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.2"
|
9
9
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new("
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Bob Burbach"]
|
12
|
-
s.date = %q{2010-03-
|
12
|
+
s.date = %q{2010-03-30}
|
13
13
|
s.description = %q{ Rails abstraction layer for creating maps using the Cloudmade web framework. Makes creating maps with custom
|
14
14
|
color schemes, ajax markers and customizable marker info windows quick and easy.
|
15
15
|
}
|
@@ -21,6 +21,7 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.files = [
|
22
22
|
".document",
|
23
23
|
".gitignore",
|
24
|
+
"CHANGELOG.mdown",
|
24
25
|
"LICENSE",
|
25
26
|
"README.rdoc",
|
26
27
|
"Rakefile",
|
@@ -38,7 +39,7 @@ Gem::Specification.new do |s|
|
|
38
39
|
"test/helper.rb",
|
39
40
|
"test/test_cloud_kicker.rb"
|
40
41
|
]
|
41
|
-
s.homepage = %q{http://github.com/
|
42
|
+
s.homepage = %q{http://github.com/criticaljuncture/cloud_kicker}
|
42
43
|
s.rdoc_options = ["--charset=UTF-8"]
|
43
44
|
s.require_paths = ["lib"]
|
44
45
|
s.rubygems_version = %q{1.3.6}
|
@@ -1,5 +1,4 @@
|
|
1
|
-
require '
|
2
|
-
require 'control_elements'
|
1
|
+
require File.join(File.dirname(__FILE__), 'control_elements.rb')
|
3
2
|
|
4
3
|
Dir["#{File.join(File.dirname(__FILE__), 'map', '*.rb')}"].each do |filename|
|
5
4
|
require filename
|
@@ -7,4 +6,6 @@ end
|
|
7
6
|
|
8
7
|
Dir["#{File.join(File.dirname(__FILE__), 'markers', '*.rb')}"].each do |filename|
|
9
8
|
require filename
|
10
|
-
end
|
9
|
+
end
|
10
|
+
|
11
|
+
require File.join(File.dirname(__FILE__), 'map.rb')
|
@@ -32,8 +32,8 @@ module Cloudkicker
|
|
32
32
|
|
33
33
|
js = <<-JS
|
34
34
|
// create a new control position and add padding
|
35
|
-
var
|
36
|
-
map.addControl(new #{control_type},
|
35
|
+
var controlPosition = new CM.ControlPosition(#{control_position}, new CM.Size(#{padding_x}, #{padding_y}));
|
36
|
+
map.addControl(new #{control_type}, controlPosition);
|
37
37
|
JS
|
38
38
|
|
39
39
|
return js
|
@@ -4,25 +4,10 @@ module Cloudkicker
|
|
4
4
|
include Cloudkicker::MapLocation
|
5
5
|
include Cloudkicker::MapBookmarking
|
6
6
|
include Cloudkicker::MapEvents
|
7
|
+
include Cloudkicker::AjaxMarkers
|
7
8
|
|
8
9
|
def initialize(options={})
|
9
10
|
configure
|
10
|
-
map:
|
11
|
-
lat:
|
12
|
-
long:
|
13
|
-
map_control:
|
14
|
-
map_control_type:
|
15
|
-
zoom:
|
16
|
-
style_id:
|
17
|
-
bounds:
|
18
|
-
bound_zoom:
|
19
|
-
enable_bookmarking:
|
20
|
-
ajax_markers:
|
21
|
-
ajax_url:
|
22
|
-
markers:
|
23
|
-
scroll_wheel_zoom_enabled:
|
24
|
-
|
25
|
-
|
26
11
|
|
27
12
|
@lat = options.delete(:lat) || @ck_config['map']['lat']
|
28
13
|
@long = options.delete(:long) || @ck_config['map']['long']
|
@@ -40,19 +25,30 @@ module Cloudkicker
|
|
40
25
|
@ajax_markers = options.delete(:ajax_markers) || @ck_config['map']['markers']['ajax']['enabled']
|
41
26
|
@ajax_url = options.delete(:ajax_url) || @ck_config['map']['markers']['ajax']['url']
|
42
27
|
@markers = []
|
43
|
-
@
|
28
|
+
@scroll_wheel_zoom_enabled = options.delete(:scroll_wheel_zoom_enabled) || @ck_config['map']['scroll_wheel_zoom']['enabled']
|
44
29
|
end
|
45
30
|
|
46
31
|
def configure
|
47
|
-
app_root
|
48
|
-
@ck_config
|
32
|
+
app_root = RAILS_ROOT if defined?(RAILS_ROOT)
|
33
|
+
@ck_config = YAML.load( File.open("#{app_root}/config/cloud_kicker.yml", 'r') )
|
49
34
|
end
|
50
35
|
|
51
36
|
def to_js(map_id='map')
|
52
37
|
js = []
|
38
|
+
# get the cloudmade map js
|
53
39
|
js << <<-JS
|
54
40
|
<script type=\"text/javascript\" src=\"#{CLOUDMADE_SRC}\"></script>
|
55
|
-
|
41
|
+
JS
|
42
|
+
|
43
|
+
js << '<script type="text/javascript">'
|
44
|
+
|
45
|
+
js << <<-JS
|
46
|
+
// set up the array of added markers for use later
|
47
|
+
var addedMarkers = [];
|
48
|
+
JS
|
49
|
+
|
50
|
+
# create the script that will create and manage the map
|
51
|
+
js << <<-JS
|
56
52
|
$(document).ready(function() {
|
57
53
|
|
58
54
|
// create a new cloudmade tile object with our api key and the map style we want
|
@@ -64,7 +60,7 @@ module Cloudkicker
|
|
64
60
|
// set up options here like turning on or off certain map features or setting the map center
|
65
61
|
JS
|
66
62
|
|
67
|
-
|
63
|
+
unless @scroll_wheel_zoom_enabled
|
68
64
|
js << <<-JS
|
69
65
|
map.disableScrollWheelZoom();
|
70
66
|
JS
|
@@ -74,10 +70,14 @@ module Cloudkicker
|
|
74
70
|
js << add_map_control(@map_control_type)
|
75
71
|
end
|
76
72
|
|
73
|
+
# add listenters for events
|
74
|
+
js << add_events(:ajax_markers => @ajax_markers,
|
75
|
+
:enable_bookmarking => @enable_bookmarking)
|
76
|
+
|
77
|
+
# set center of map properly
|
78
|
+
# (must come after any listeners for map load - setting the center is what triggers the event it)
|
77
79
|
js << set_map_center(@lat, @long, @zoom, @bounds, @bound_points, @bound_zoom)
|
78
80
|
|
79
|
-
js << add_map_events(:ajax_markers => @ajax_markers,
|
80
|
-
:enable_bookmarking => @enable_bookmarking)
|
81
81
|
|
82
82
|
unless @ajax_markers
|
83
83
|
@markers.each do |marker|
|
@@ -87,7 +87,7 @@ module Cloudkicker
|
|
87
87
|
|
88
88
|
js << '}); //end $(document).ready'
|
89
89
|
|
90
|
-
|
90
|
+
# add the functions we'll need (for events, etc)
|
91
91
|
if @ajax_markers
|
92
92
|
js << add_ajax_marker_functions(@ajax_url)
|
93
93
|
end
|
@@ -5,6 +5,7 @@ module Cloudkicker
|
|
5
5
|
ajax_markers = options.delete(:ajax_markers)
|
6
6
|
enable_bookmarking = options.delete(:enable_bookmarking)
|
7
7
|
|
8
|
+
js = []
|
8
9
|
js << <<-JS
|
9
10
|
/*************************/
|
10
11
|
/* add events to the map */
|
@@ -17,7 +18,7 @@ module Cloudkicker
|
|
17
18
|
|
18
19
|
js << map_drag_event(enable_bookmarking)
|
19
20
|
|
20
|
-
return js
|
21
|
+
return js.join('\n')
|
21
22
|
end
|
22
23
|
|
23
24
|
|
@@ -38,8 +39,7 @@ module Cloudkicker
|
|
38
39
|
|
39
40
|
js << <<-JS
|
40
41
|
// we get markers dynamically from the server
|
41
|
-
//
|
42
|
-
var added_markers = [];
|
42
|
+
// first turn on the loading indicator
|
43
43
|
$('.mapMarkerLoader img').show();
|
44
44
|
|
45
45
|
// show the map marker loading indicator and get the markers for the area shown in
|
@@ -62,7 +62,7 @@ module Cloudkicker
|
|
62
62
|
});
|
63
63
|
JS
|
64
64
|
|
65
|
-
return js
|
65
|
+
return js.join('\n')
|
66
66
|
end
|
67
67
|
|
68
68
|
end
|
@@ -11,10 +11,10 @@ module Cloudkicker
|
|
11
11
|
def add_marker_function
|
12
12
|
<<-JS
|
13
13
|
function add_markers(markers) {
|
14
|
-
$.each(
|
14
|
+
$.each(addedMarkers, function(i, added_marker){
|
15
15
|
map.removeOverlay(added_marker);
|
16
16
|
});
|
17
|
-
|
17
|
+
addedMarkers = [];
|
18
18
|
|
19
19
|
$.each(markers, function(i, marker){
|
20
20
|
var myMarkerLatLng = new CM.LatLng(marker.lat,marker.lng);
|
@@ -49,7 +49,7 @@ module Cloudkicker
|
|
49
49
|
});
|
50
50
|
|
51
51
|
|
52
|
-
|
52
|
+
addedMarkers.push(myMarker);
|
53
53
|
map.addOverlay(myMarker);
|
54
54
|
});
|
55
55
|
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloud_kicker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
4
|
+
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
|
10
|
-
version: 0.0.0.pre1
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Bob Burbach
|
@@ -15,7 +14,7 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-03-
|
17
|
+
date: 2010-03-30 00:00:00 -07:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
@@ -42,6 +41,7 @@ extra_rdoc_files:
|
|
42
41
|
files:
|
43
42
|
- .document
|
44
43
|
- .gitignore
|
44
|
+
- CHANGELOG.mdown
|
45
45
|
- LICENSE
|
46
46
|
- README.rdoc
|
47
47
|
- Rakefile
|
@@ -59,7 +59,7 @@ files:
|
|
59
59
|
- test/helper.rb
|
60
60
|
- test/test_cloud_kicker.rb
|
61
61
|
has_rdoc: true
|
62
|
-
homepage: http://github.com/
|
62
|
+
homepage: http://github.com/criticaljuncture/cloud_kicker
|
63
63
|
licenses: []
|
64
64
|
|
65
65
|
post_install_message:
|
@@ -76,13 +76,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
76
76
|
version: "0"
|
77
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- - "
|
79
|
+
- - ">="
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
segments:
|
82
|
-
-
|
83
|
-
|
84
|
-
- 1
|
85
|
-
version: 1.3.1
|
82
|
+
- 0
|
83
|
+
version: "0"
|
86
84
|
requirements: []
|
87
85
|
|
88
86
|
rubyforge_project:
|