gmpoint 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +10 -10
- data/VERSION +1 -1
- data/app/helpers/gmpoint/gmpoint_helper.rb +6 -4
- data/gmpoint.gemspec +3 -3
- metadata +4 -4
data/README.markdown
CHANGED
@@ -31,36 +31,36 @@ This is gem for help to point on google map. You can marker your address and sea
|
|
31
31
|
<%= show_map_helper your_model %>
|
32
32
|
|
33
33
|
Example:
|
34
|
-
<%= show_map_helper
|
34
|
+
<%= show_map_helper user %>
|
35
35
|
|
36
36
|
|
37
37
|
### You can set options for view
|
38
38
|
|
39
39
|
#### You can set "width" , "height" for map view
|
40
|
-
<%= show_map_helper
|
40
|
+
<%= show_map_helper user, {width: 400, height: 200} %>
|
41
41
|
|
42
42
|
#### You can set "searchbox_with" for search box
|
43
|
-
<%= show_map_helper
|
43
|
+
<%= show_map_helper user, {searchbox_width: 300} %>
|
44
44
|
|
45
45
|
#### You can show or hide your search box
|
46
|
-
<%= show_map_helper
|
46
|
+
<%= show_map_helper user, {searchbox: 'show', width: 400, height: 200, searchbox_width: 300} %>
|
47
47
|
|
48
48
|
and when you want to hide the search box
|
49
|
-
<%= show_map_helper
|
49
|
+
<%= show_map_helper user, {searchbox: 'none', width: 400, height: 200, searchbox_width: 300} %>
|
50
50
|
|
51
51
|
#### You can only set show or point to map using attribute "allow"
|
52
|
-
<%= show_map_helper
|
52
|
+
<%= show_map_helper user, {allow: 'show', searchbox: 'none', width: 400, height: 200, searchbox_width: 300} %>
|
53
53
|
|
54
54
|
and when you want to point
|
55
|
-
<%= show_map_helper
|
55
|
+
<%= show_map_helper user, {allow: 'point', searchbox: 'none', width: 400, height: 200, searchbox_width: 300} %>
|
56
56
|
|
57
57
|
Example:
|
58
|
-
<%= show_map_helper
|
58
|
+
<%= show_map_helper user, {width: 400, height: 200, searchbox_width: 300} %>
|
59
59
|
|
60
60
|
#### You can set latitude and longitude default for your place
|
61
61
|
|
62
|
-
<%= show_map_helper
|
62
|
+
<%= show_map_helper user, {latitude: 1.3028, longitude: 103.35, allow: 'show', searchbox: 'none', width: 400, height: 200, searchbox_width: 300} %>
|
63
63
|
|
64
64
|
#### You can set zoom for map
|
65
65
|
|
66
|
-
<%= show_map_helper
|
66
|
+
<%= show_map_helper user, {zoom: 10, latitude: 1.3028, longitude: 103.35, allow: 'show', searchbox: 'none', width: 400, height: 200, searchbox_width: 300} %>
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
@@ -1,18 +1,20 @@
|
|
1
1
|
module Gmpoint::GmpointHelper
|
2
2
|
|
3
3
|
def google_map_api_js(key="AIzaSyA344yCug0-GhjW3XJyZmkLWLN_qtA_ziM")
|
4
|
-
javascript_include_tag "https://maps.googleapis.com/maps/api/js?key=#{key}&sensor=
|
4
|
+
javascript_include_tag "https://maps.googleapis.com/maps/api/js?key=#{key}&sensor=false"
|
5
5
|
end
|
6
6
|
|
7
|
-
def show_map_helper(
|
7
|
+
def show_map_helper(model, opts={})
|
8
8
|
|
9
|
-
object = model_name.to_s.singularize.classify.constantize.find(params[:id])
|
9
|
+
# object = model_name.to_s.singularize.classify.constantize.find(params[:id])
|
10
|
+
object = model
|
11
|
+
model_name = model.class.to_s.singularize
|
10
12
|
@address = object.location_address
|
11
13
|
@latitude = object.location_latitude
|
12
14
|
@longitude = object.location_longitude
|
13
15
|
opts = {allow: 'show', searchbox: 'show', width: 800, height: 400, latitude: "#{@latitude}", longitude: "#{@longitude}", address: "#{@address}", zoom: 13, style: "border: 1px solid #green;", searchbox_width: 400}.merge(opts)
|
14
16
|
[
|
15
|
-
content_tag(:div, :id => "geopoint_search_box_container", style: "
|
17
|
+
content_tag(:div, :id => "geopoint_search_box_container", style: " display: #{opts[:searchbox]}") do
|
16
18
|
tag(:input, type: :text, placeholder: 'Search', id: "gmpoint_#{model_name}_search_box", style: "width: #{opts[:searchbox_width]}px; border:1px solid #{:color};")
|
17
19
|
end,
|
18
20
|
content_tag(:div, '', id: "map_canvas", style: "width: #{opts[:width]}px; height: #{opts[:height]}px; #{opts[:style]}"),
|
data/gmpoint.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "gmpoint"
|
8
|
-
s.version = "0.0
|
8
|
+
s.version = "0.1.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Peter Dang"]
|
12
|
-
s.date = "2013-
|
12
|
+
s.date = "2013-06-10"
|
13
13
|
s.description = "Help to point on Goolge Map Description"
|
14
14
|
s.email = "peter@rubify.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -41,7 +41,7 @@ Gem::Specification.new do |s|
|
|
41
41
|
s.homepage = "http://github.com/dangluan/gmpoint"
|
42
42
|
s.licenses = ["MIT"]
|
43
43
|
s.require_paths = ["lib"]
|
44
|
-
s.rubygems_version = "1.8.
|
44
|
+
s.rubygems_version = "1.8.23"
|
45
45
|
s.summary = "Help to point on Google Map"
|
46
46
|
|
47
47
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gmpoint
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-06-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: geocoder
|
@@ -150,7 +150,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
150
150
|
version: '0'
|
151
151
|
segments:
|
152
152
|
- 0
|
153
|
-
hash:
|
153
|
+
hash: -4211737238642563577
|
154
154
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
155
|
none: false
|
156
156
|
requirements:
|
@@ -159,7 +159,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
161
|
rubyforge_project:
|
162
|
-
rubygems_version: 1.8.
|
162
|
+
rubygems_version: 1.8.23
|
163
163
|
signing_key:
|
164
164
|
specification_version: 3
|
165
165
|
summary: Help to point on Google Map
|