socmap_adf 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -405,8 +405,8 @@ MarkerLabel_.prototype.setMandatoryStyles = function () {
405
405
  */
406
406
  MarkerLabel_.prototype.setAnchor = function () {
407
407
  var anchor = this.marker_.get("labelAnchor");
408
- this.labelDiv_.style.marginLeft = -anchor.x + "px";
409
- this.labelDiv_.style.marginTop = -anchor.y + "px";
408
+ this.labelDiv_.style.marginLeft = -(this.labelDiv_.offsetWidth / 2) + "px";
409
+ this.labelDiv_.style.marginTop = -anchor.y + 2 + "px";
410
410
  this.eventDiv_.style.marginLeft = -anchor.x + "px";
411
411
  this.eventDiv_.style.marginTop = -anchor.y + "px";
412
412
  };
@@ -33,16 +33,19 @@ class ADF.GMap.Views.Overlay extends google.maps.OverlayView
33
33
  @options.shadow = @view.shadow if @view.shadow
34
34
  @options.shape = @view.shape if @view.shape
35
35
 
36
- @options.cursor = "hand"
36
+
37
+ @options.cursor = "default"
38
+
37
39
  if @view.draggable
38
40
  @options.cursor = "move"
39
41
  if @clickable
40
- @options.cursor = "pointer"
41
-
42
+ @options.cursor = "hand"
43
+
42
44
  if @view.label != null
43
45
  @options.labelContent = @view.label
44
46
  @options.labelClass = @view.labelClass
45
47
  @options.labelAnchor = new google.maps.Point(60, 0)
48
+ @options.handCursor = @options.cursor
46
49
  @marker = new MarkerWithLabel @options
47
50
  else
48
51
  @marker = new google.maps.Marker @options
@@ -1,9 +1,10 @@
1
1
  class ADF.Overlay.Views.FlashOverlay extends ADF.GMap.Views.OverlayView
2
2
 
3
3
  opened: false
4
+ clickable: false
4
5
  hoverable: true
5
- top: -60
6
- left: 0
6
+ calibration: [0, -16, -20, 0]
7
+ mouseout: true
7
8
 
8
9
  constructor: (options) ->
9
10
  super(options)
@@ -14,7 +15,7 @@ class ADF.Overlay.Views.FlashOverlay extends ADF.GMap.Views.OverlayView
14
15
  @openOverlayOnHover()
15
16
 
16
17
  onMarkerMouseOut: () =>
17
- @hideOverlayAfterTime()
18
+ @hideOverlayAfterTime() if @mouseout
18
19
 
19
20
  openOverlayOnHover: () =>
20
21
  @map.hideAllOverlays()
@@ -30,7 +31,8 @@ class ADF.Overlay.Views.FlashOverlay extends ADF.GMap.Views.OverlayView
30
31
  setTimeout(@hideOverlayIfNeeded, 1000)
31
32
 
32
33
  onRenderCompleted: () =>
33
- $(@el).hover(@openOverlayOnHover, @hideOverlayAfterTime)
34
+ if @hoverable && @mouseout
35
+ $(@el).hover(@openOverlayOnHover, @hideOverlayAfterTime)
34
36
 
35
37
  calculatePosition: () ->
36
38
  arr = @getPositionArray()
@@ -43,7 +45,7 @@ class ADF.Overlay.Views.FlashOverlay extends ADF.GMap.Views.OverlayView
43
45
  w = @getWidth() / 2
44
46
  h = @getHeight()
45
47
 
46
- return [h, w] if divPixel.x <= halfWidth && divPixel.y < halfHeight
47
- return [h, -w] if divPixel.x > halfWidth && divPixel.y < halfHeight
48
- return [@top, w] if divPixel.x <= halfWidth && divPixel.y >= halfHeight
49
- return [@top, -w] if divPixel.x > halfWidth && divPixel.y >= halfHeight
48
+ return [h + @calibration[0], w + @calibration[3]] if divPixel.x <= halfWidth && divPixel.y < halfHeight
49
+ return [h + @calibration[0], -w + @calibration[1]] if divPixel.x > halfWidth && divPixel.y < halfHeight
50
+ return [@calibration[2], w + @calibration[3]] if divPixel.x <= halfWidth && divPixel.y >= halfHeight
51
+ return [@calibration[2], -w + @calibration[1]] if divPixel.x > halfWidth && divPixel.y >= halfHeight
@@ -1,3 +1,3 @@
1
1
  module SocmapAdf
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: socmap_adf
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:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-10-14 00:00:00.000000000 Z
14
+ date: 2012-10-16 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -199,7 +199,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
199
199
  version: '0'
200
200
  segments:
201
201
  - 0
202
- hash: -4555781509594738467
202
+ hash: 822801186377206797
203
203
  required_rubygems_version: !ruby/object:Gem::Requirement
204
204
  none: false
205
205
  requirements:
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  version: '0'
209
209
  segments:
210
210
  - 0
211
- hash: -4555781509594738467
211
+ hash: 822801186377206797
212
212
  requirements: []
213
213
  rubyforge_project: socmap_adf
214
214
  rubygems_version: 1.8.24