ropenlayer 0.3.4 → 0.3.5
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/Gemfile.lock +1 -1
- data/History.txt +5 -0
- data/lib/ropenlayer/form_builder.rb +17 -6
- data/lib/ropenlayer/openlayer/map.rb +9 -7
- data/lib/ropenlayer/version.rb +1 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/History.txt
CHANGED
@@ -5,14 +5,15 @@ module Ropenlayer
|
|
5
5
|
self.object.ensure_mapper_model
|
6
6
|
self.object.ensure_localizable_model
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
return_tag = ''
|
9
|
+
|
10
10
|
|
11
|
+
dom_id_map = "ropenlayer_#{ @template.params[:action] }_#{ @template.params[:controller] }"
|
12
|
+
klass_config = self.object.class.ropenlayer_mapper_config.merge({:map_js_options => { :eventListeners => "{ 'moveend': #{ dom_id_map }EventHandler, 'zoomend': #{ dom_id_map }EventHandler }"}})
|
11
13
|
map = self.object.build_ropenlayer_map(dom_id_map, klass_config)
|
12
14
|
|
13
15
|
map_div_options.merge!(:id => dom_id_map)
|
14
16
|
|
15
|
-
return_tag = ''
|
16
17
|
|
17
18
|
[ :longitude , :latitude, :zoom ].each do |data|
|
18
19
|
id_hidden_value = "#{ self.object.class.name.underscore }_#{ klass_config[data] }"
|
@@ -20,9 +21,8 @@ module Ropenlayer
|
|
20
21
|
return_tag << hidden_field(klass_config[data], :id => id_hidden_value)
|
21
22
|
end
|
22
23
|
|
23
|
-
|
24
|
-
return_tag << "#{ @template.content_tag("div", '', map_div_options) } #{ @template.javascript_tag map.to_js }"
|
25
24
|
return_tag << localization_helper(map)
|
25
|
+
return_tag << "#{ @template.content_tag("div", '', map_div_options) } #{ @template.javascript_tag map.to_js }"
|
26
26
|
@template.raw return_tag
|
27
27
|
end
|
28
28
|
|
@@ -61,7 +61,18 @@ module Ropenlayer
|
|
61
61
|
|
62
62
|
private
|
63
63
|
def localization_helper(ropenlayer_object)
|
64
|
-
|
64
|
+
@template.javascript_tag "function #{ ropenlayer_object.div_id }EventHandler(event) {
|
65
|
+
a = #{ ropenlayer_object.js_id }.getCenter();
|
66
|
+
b = #{ ropenlayer_object.js_id }.getZoom();
|
67
|
+
|
68
|
+
long_dom = document.getElementById('#{ ropenlayer_object.form_localizations_fields[:longitude] }');
|
69
|
+
lat_dom = document.getElementById('#{ ropenlayer_object.form_localizations_fields[:latitude] }');
|
70
|
+
zoom_dom = document.getElementById('#{ ropenlayer_object.form_localizations_fields[:zoom] }');
|
71
|
+
|
72
|
+
long_dom.value = a['lon'];
|
73
|
+
lat_dom.value = a['lat'];
|
74
|
+
zoom_dom.value = b;
|
75
|
+
}"
|
65
76
|
end
|
66
77
|
|
67
78
|
|
@@ -120,14 +120,16 @@ module Ropenlayer
|
|
120
120
|
map_js_options ||= {}
|
121
121
|
propierties = {}
|
122
122
|
|
123
|
-
propierties[:div]
|
124
|
-
propierties[:controls]
|
123
|
+
propierties[:div] = "'#{ div_id }'"
|
124
|
+
propierties[:controls] = "[]"
|
125
125
|
|
126
|
-
propierties[:theme]
|
127
|
-
propierties[:projection]
|
128
|
-
propierties[:units]
|
129
|
-
propierties[:
|
130
|
-
|
126
|
+
propierties[:theme] = map_js_options[:theme] || "'/stylesheets/ropenlayer.css'"
|
127
|
+
propierties[:projection] = map_js_options[:projection] || "#{ Ropenlayer::Openlayer::Js.new_method("OpenLayers.Projection", :args => ["'EPSG:900913'"]) }"
|
128
|
+
propierties[:units] = map_js_options[:units] || "'m'"
|
129
|
+
propierties[:eventListeners] = map_js_options[:eventListeners] if map_js_options[:eventListeners]
|
130
|
+
|
131
|
+
propierties[:maxResolution] = map_js_options[:units] || "156543.0339"
|
132
|
+
propierties[:maxExtent] = map_js_options[:maxExtent] || "#{ Ropenlayer::Openlayer::Js.new_method("OpenLayers.Bounds", :args => ["-20037508", "-20037508", "20037508", "20037508.34"]) }"
|
131
133
|
propierties
|
132
134
|
end
|
133
135
|
|
data/lib/ropenlayer/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ropenlayer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 5
|
10
|
+
version: 0.3.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Gnoxys
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-05-
|
18
|
+
date: 2011-05-12 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|