gmaps4rails 2.0.5 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/gmaps4rails/version.rb +1 -1
- data/spec/javascripts/google/builders/marker_spec.js +2 -2
- data/vendor/assets/javascripts/gmaps/google/builders/marker.coffee +10 -6
- data/vendor/assets/javascripts/gmaps/google/objects/marker.coffee +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c5258e3e4ac28ce4aee9b51391b51941f70107ab
|
4
|
+
data.tar.gz: f3226ab987085968259cd22c0667c4121e254ae7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e5d0937d72dfab9bb75e534d8facc9df45e731df75b29129a65baff56af69f98c9ac04c5fb3a079ca40c3b6a0281db8cb335bc92bd6587deec1d3b502c44b57
|
7
|
+
data.tar.gz: 3d61f999c92e529e8ae4fe3ec53da86fd0ffc67854e256f178e13e0c42df29aa2ea458b78dca2135383ae6333fccbee78356c6e79b985ec126665e88ac72b80b
|
data/Gemfile.lock
CHANGED
data/lib/gmaps4rails/version.rb
CHANGED
@@ -42,8 +42,8 @@ describe("Gmaps.Google.Builders.Marker", function() {
|
|
42
42
|
called_lat = primitives.latLng.mostRecentCall.args[0];
|
43
43
|
called_lng = primitives.latLng.mostRecentCall.args[1];
|
44
44
|
|
45
|
-
expect(called_lat).toBeWithinOf(args.lat, 0.
|
46
|
-
expect(called_lng).toBeWithinOf(args.lng, 0.
|
45
|
+
expect(called_lat).toBeWithinOf(args.lat, 0.00011);
|
46
|
+
expect(called_lng).toBeWithinOf(args.lng, 0.00011);
|
47
47
|
});
|
48
48
|
});
|
49
49
|
|
@@ -26,19 +26,18 @@ class @Gmaps.Google.Builders.Marker extends Gmaps.Objects.BaseBuilder
|
|
26
26
|
constructor: (@args, @provider_options = {}, @internal_options = {})->
|
27
27
|
@before_init()
|
28
28
|
@create_marker()
|
29
|
-
@
|
29
|
+
@create_infowindow_on_click()
|
30
30
|
@after_init()
|
31
31
|
|
32
32
|
build: ->
|
33
|
-
new(@model_class())(@serviceObject
|
33
|
+
@object = new(@model_class())(@serviceObject)
|
34
34
|
|
35
35
|
create_marker: ->
|
36
36
|
@serviceObject = new(@primitives().marker)(@marker_options())
|
37
37
|
|
38
38
|
create_infowindow: ->
|
39
39
|
return null unless _.isString @args.infowindow
|
40
|
-
|
41
|
-
@bind_infowindow()
|
40
|
+
new(@primitives().infowindow)({content: @args.infowindow })
|
42
41
|
|
43
42
|
marker_options: ->
|
44
43
|
coords = @_randomized_coordinates()
|
@@ -49,13 +48,18 @@ class @Gmaps.Google.Builders.Marker extends Gmaps.Objects.BaseBuilder
|
|
49
48
|
shadow: @_get_picture('shadow')
|
50
49
|
_.extend @provider_options, base_options
|
51
50
|
|
52
|
-
|
51
|
+
create_infowindow_on_click: ->
|
53
52
|
@addListener 'click', @infowindow_binding
|
54
53
|
|
55
54
|
infowindow_binding: =>
|
56
|
-
@panTo()
|
57
55
|
@constructor.CURRENT_INFOWINDOW.close() if @_should_close_infowindow()
|
56
|
+
@panTo()
|
57
|
+
@infowindow ?= @create_infowindow()
|
58
|
+
|
59
|
+
return unless @infowindow?
|
60
|
+
|
58
61
|
@infowindow.open( @getServiceObject().getMap(), @getServiceObject())
|
62
|
+
@object.infowindow ?= @infowindow
|
59
63
|
@constructor.CURRENT_INFOWINDOW = @infowindow
|
60
64
|
|
61
65
|
panTo: ->
|
@@ -2,7 +2,8 @@ class @Gmaps.Google.Objects.Marker extends Gmaps.Base
|
|
2
2
|
|
3
3
|
@include Gmaps.Google.Objects.Common
|
4
4
|
|
5
|
-
|
5
|
+
# @infowindow is set later, once marker is clicked
|
6
|
+
constructor: (@serviceObject)->
|
6
7
|
|
7
8
|
updateBounds: (bounds)->
|
8
9
|
bounds.extend(@getServiceObject().position)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gmaps4rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Roth
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-11-
|
12
|
+
date: 2013-11-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|