gmpoint 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -57,3 +57,10 @@ This is gem for help to point on google map. You can marker your address and sea
57
57
  Example:
58
58
  <%= show_map_helper :users, {width: 400, height: 200, searchbox_width: 300} %>
59
59
 
60
+ #### You can set latitude and longitude default for your place
61
+
62
+ <%= show_map_helper :users, {latitude: 1.3028, longitude: 103.35, allow: 'show', searchbox: 'none', width: 400, height: 200, searchbox_width: 300} %>
63
+
64
+ #### You can set zoom for map
65
+
66
+ <%= show_map_helper :users, {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.4
1
+ 0.0.5
@@ -2,6 +2,7 @@
2
2
  # All this logic will automatically be available in application.js.
3
3
  # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
4
4
  window.initJsMap = ->
5
+ window.geopoint_search_map($("#gmpoint_location_address"))
5
6
  $("#geopoint_search_box_container input").keypress (e) ->
6
7
  if e.keyCode == 13 # enter
7
8
  window.geopoint_search_map($(@))
@@ -10,13 +10,13 @@ module Gmpoint::GmpointHelper
10
10
  @address = object.location_address
11
11
  @latitude = object.location_latitude
12
12
  @longitude = object.location_longitude
13
- opts = {allow: 'show', searchbox: 'show', width: 800, height: 400, latitude: 1.3667, longitude: 103.75, zoom: 13, style: "border: 1px solid #green;", searchbox_width: 400}.merge(opts)
13
+ 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
14
  [
15
15
  content_tag(:div, :id => "geopoint_search_box_container", style: "width: #{opts[:searchbox_width]}px; margin: 0 auto; margin-bottom: 10px; display: #{opts[:searchbox]}") do
16
16
  tag(:input, type: :text, placeholder: 'Search', id: "gmpoint_#{model_name}_search_box", style: "width: #{opts[:searchbox_width]}px; border:1px solid #{:color};")
17
17
  end,
18
18
  content_tag(:div, '', id: "map_canvas", style: "width: #{opts[:width]}px; height: #{opts[:height]}px; #{opts[:style]}"),
19
- content_tag(:div, '', class: "data-location", data: {model: model_name, latitude: opts[:latitude] , longitude: opts[:longitude] , zoom: opts[:zoom]}),
19
+ content_tag(:div, '', class: "data-location", data: {model: model_name, address:opts[:address], latitude: opts[:latitude] , longitude: opts[:longitude], zoom: opts[:zoom]}),
20
20
  tag(:input, type: :hidden, value: "#{opts[:allow]}", name: "allow", id: "gmpoint_map_allow"),
21
21
  tag(:input, type: :hidden, value: "#{@latitude}", name: "#{model_name}[location_latitude]", id: "gmpoint_location_latitude"),
22
22
  tag(:input, type: :hidden, value: "#{@longitude}", name: "#{model_name}[location_longitude]", id: "gmpoint_location_longitude"),
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "gmpoint"
8
- s.version = "0.0.4"
8
+ s.version = "0.0.5"
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"]
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
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -150,7 +150,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
150
150
  version: '0'
151
151
  segments:
152
152
  - 0
153
- hash: -1134795745359954278
153
+ hash: 3518780868621753732
154
154
  required_rubygems_version: !ruby/object:Gem::Requirement
155
155
  none: false
156
156
  requirements: