bhm-google-maps 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bhm-google-maps}
8
- s.version = "0.2.1"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Darcy Laycock"]
12
- s.date = %q{2010-08-21}
12
+ s.date = %q{2010-08-24}
13
13
  s.description = %q{A set of helpers and javascript files that makes it trivial to implement google maps unobtrusively in an application.}
14
14
  s.email = %q{darcy.laycock@youthtree.org.au}
15
15
  s.extra_rdoc_files = [
@@ -39,13 +39,13 @@
39
39
  # automatically namespaces keys etc.
40
40
  mergeDataOptions = (element, options, keys, spacer) ->
41
41
  for key in keys
42
- options[key] = getData(element, key, spacer) if hasData element, key, spacer
42
+ options[key] = getData(element, key, spacer) if hasData(element, key, spacer)
43
43
 
44
44
  # Return the map options for a given element.
45
45
  mapOptionsForElement = (element) ->
46
46
  options = $.extend {}, map.defaultOptions
47
47
  # Set the mapTypeId if it's a function
48
- options.mapTypeId = options.mapTypeId() if $.isFunction options.mapTypeId
48
+ options.mapTypeId = options.mapTypeId() if $.isFunction(options.mapTypeId)
49
49
  mergeDataOptions element, options, mapOptionKeys
50
50
  options
51
51
 
@@ -60,13 +60,11 @@
60
60
  id = $e.attr "id"
61
61
  $e.attr "id", "#{map.autoIDPrefix}#{map.count++}" unless id?
62
62
  # Get the position of the current marker.
63
- if hasData $e, "latitude" and hasData $e, "longitude"
63
+ if hasData($e, "latitude") and hasData($e, "longitude")
64
64
  lat = Number getData($e, "latitude")
65
65
  lng = Number getData($e, "longitude")
66
- map.drawLatLng $e, e, lat, lng
67
66
  else
68
- address = getData $e, "address"
69
- # TODO: Map the address.
67
+ return
70
68
  point = new google.maps.LatLng lat, lng
71
69
  # Start setting up the map / create a map element.
72
70
  mapOptions = mapOptionsForElement $e
@@ -78,9 +76,9 @@
78
76
  markerOptions =
79
77
  position: point
80
78
  map: currentMap
81
-
82
79
  mergeDataOptions $e, markerOptions, markerOptionKeys, "marker-"
83
80
  marker = new google.maps.Marker markerOptions
81
+
84
82
  currentMap
85
83
 
86
84
  # On load, we'll install the maps.
@@ -51,18 +51,17 @@ this['GMap'] = (function($) {
51
51
  });
52
52
  };
53
53
  map.setupElement = function(e) {
54
- var $e, address, currentMap, id, lat, lng, mapOptions, marker, markerOptions, point;
54
+ var $e, currentMap, id, lat, lng, mapOptions, marker, markerOptions, point;
55
55
  $e = $(e);
56
56
  id = $e.attr("id");
57
57
  if (!((typeof id !== "undefined" && id !== null))) {
58
58
  $e.attr("id", ("" + (map.autoIDPrefix) + (map.count++)));
59
59
  }
60
- if (hasData($e, "latitude" && hasData($e, "longitude"))) {
60
+ if (hasData($e, "latitude") && hasData($e, "longitude")) {
61
61
  lat = Number(getData($e, "latitude"));
62
62
  lng = Number(getData($e, "longitude"));
63
- map.drawLatLng($e, e, lat, lng);
64
63
  } else {
65
- address = getData($e, "address");
64
+ return null;
66
65
  }
67
66
  point = new google.maps.LatLng(lat, lng);
68
67
  mapOptions = mapOptionsForElement($e);
@@ -23,7 +23,7 @@ module BHM
23
23
  params = @params.to_param
24
24
  params << "&"
25
25
  params << build_marker_params
26
- URL_TEMPLATE % params
26
+ (URL_TEMPLATE % params).html_safe
27
27
  end
28
28
 
29
29
  def self.for_address(address, opts = {})
@@ -1,5 +1,5 @@
1
1
  module BHM
2
2
  module GoogleMaps
3
- VERSION = "0.2.1".freeze
3
+ VERSION = "0.3.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bhm-google-maps
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 2
9
- - 1
10
- version: 0.2.1
8
+ - 3
9
+ - 0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Darcy Laycock
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-21 00:00:00 +08:00
18
+ date: 2010-08-24 00:00:00 +08:00
19
19
  default_executable:
20
20
  dependencies: []
21
21