socmap_adf 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/.DS_Store CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # 0.0.8
2
+
3
+ ### Features & Enhancements
4
+ * Overlay push module is depricated now and will be removed on version 1.0.0
5
+ * Add Overlay push logic to Overlay module
6
+ * Flash overlay on drag hide all overlays
7
+
8
+ # 0.0.6
9
+
10
+ ### Bug fixes
11
+ * MiniMap getGmap error fixed.
12
+
1
13
  # 0.0.3
2
14
 
3
15
  ### Bug fixes
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2012 YOURNAME
1
+ Copyright 2012 Arturs Braucs @ Creative Mobile
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/lib/.DS_Store CHANGED
Binary file
data/lib/assets/.DS_Store CHANGED
Binary file
Binary file
@@ -95,6 +95,9 @@ class ADF.GMap.Views.Overlay extends google.maps.OverlayView
95
95
  @show()
96
96
  @draw()
97
97
  @view.onMarkerMoved(@view.point)
98
+
99
+ @markerDragEvent = google.maps.event.addListener @marker, 'drag', (e) =>
100
+ @view.onMarkerDrag()
98
101
 
99
102
  @markerClickEvent = google.maps.event.addDomListener @marker, 'click', (e) =>
100
103
  if @view.clickable
@@ -133,6 +136,7 @@ class ADF.GMap.Views.Overlay extends google.maps.OverlayView
133
136
  google.maps.event.clearListeners(@getMarker(), "click")
134
137
  google.maps.event.clearListeners(@getMarker(), "mouseover")
135
138
  google.maps.event.clearListeners(@getMarker(), "mouseout")
139
+ google.maps.event.removeListener(@markerDragEvent)
136
140
 
137
141
  # = Show or Hide overlay
138
142
  show: ( animation = false ) ->
@@ -71,8 +71,9 @@ class ADF.GMap.Views.OverlayView extends ADF.MVC.Views.Base
71
71
  @data
72
72
 
73
73
  pushOverlay: () ->
74
- @overlay = new ADF.GMap.Views.Overlay(@map.getGMap(), @)
75
- @map.addOverlay(@overlay)
74
+ if @map && @point
75
+ @overlay = new ADF.GMap.Views.Overlay(@map.getGMap(), @)
76
+ @map.addOverlay(@overlay)
76
77
 
77
78
  getMapElement: () ->
78
79
  @map.getMapElement()
@@ -142,4 +143,5 @@ class ADF.GMap.Views.OverlayView extends ADF.MVC.Views.Base
142
143
  onMarkerMouseOut: () ->
143
144
  onOverlayShowed: () ->
144
145
  onMarkerMoved: (point) ->
146
+ onMarkerDrag: () ->
145
147
  unbindMap: () ->
@@ -8,7 +8,6 @@ class ADF.Overlay.Views.FlashOverlay extends ADF.GMap.Views.OverlayView
8
8
 
9
9
  constructor: (options) ->
10
10
  super(options)
11
- @clickable = false
12
11
  @pushOverlay()
13
12
 
14
13
  onMarkerMouseOver: () =>
@@ -34,6 +33,9 @@ class ADF.Overlay.Views.FlashOverlay extends ADF.GMap.Views.OverlayView
34
33
  if @hoverable && @mouseout
35
34
  $(@el).hover(@openOverlayOnHover, @hideOverlayAfterTime)
36
35
 
36
+ onMarkerDrag: () ->
37
+ @map.hideAllOverlays()
38
+
37
39
  calculatePosition: () ->
38
40
  arr = @getPositionArray()
39
41
  @setPosition(arr[0], arr[1])
@@ -0,0 +1,40 @@
1
+ ADF.Overlay.Views.New ||= {}
2
+
3
+ class ADF.Overlay.Views.New.FlashOverlay extends ADF.Overlay.Views.FlashOverlay
4
+
5
+ hidden: false
6
+ draggable: true
7
+ clickEvent: null
8
+
9
+ opened: false
10
+ clickable: false
11
+ hoverable: true
12
+ calibration: [0, -16, -20, 0]
13
+ mouseout: true
14
+
15
+ constructor: (options) ->
16
+ super(options)
17
+ @clickableArea = if options.area then options.area else @map.getGMap()
18
+ @initOverlay()
19
+
20
+ initOverlay: () ->
21
+ if not @overlay
22
+ if @point && @point.lat() > 0 && @point.lng() > 0
23
+ @pushOverlay()
24
+ else
25
+ @bindMap()
26
+ else
27
+ @overlay.view = @
28
+ @redraw()
29
+
30
+ bindMap: () ->
31
+ @clickEvent = google.maps.event.addListener @clickableArea, 'click', @onClicked unless @clickEvent?
32
+
33
+ unbindMap: () ->
34
+ google.maps.event.removeListener(@clickEvent) if @clickEvent?
35
+ @clickEvent = null
36
+
37
+ onClicked: (e) =>
38
+ @point = e.latLng
39
+ @unbindMap()
40
+ @pushOverlay()
@@ -0,0 +1,34 @@
1
+ ADF.Overlay.Views.New ||= {}
2
+
3
+ class ADF.Overlay.Views.New.Default extends ADF.GMap.Views.OverlayView
4
+
5
+ hidden: false
6
+ draggable: true
7
+ clickEvent: null
8
+
9
+ constructor: (options) ->
10
+ super(options)
11
+ @clickableArea = if options.area then options.area else @map.getGMap()
12
+ @initOverlay()
13
+
14
+ initOverlay: () ->
15
+ if not @overlay
16
+ if @point && @point.lat() > 0 && @point.lng() > 0
17
+ @pushOverlay()
18
+ else
19
+ @bindMap()
20
+ else
21
+ @overlay.view = @
22
+ @redraw()
23
+
24
+ bindMap: () ->
25
+ @clickEvent = google.maps.event.addListener @clickableArea, 'click', @onClicked unless @clickEvent?
26
+
27
+ unbindMap: () ->
28
+ google.maps.event.removeListener(@clickEvent) if @clickEvent?
29
+ @clickEvent = null
30
+
31
+ onClicked: (e) =>
32
+ @point = e.latLng
33
+ @unbindMap()
34
+ @pushOverlay()
@@ -14,4 +14,4 @@ class ADF.Map.Views.PolygonLabel extends ADF.Overlay.Views.Overlay
14
14
  @top = 45
15
15
  @initResize()
16
16
  @redraw()
17
- return this
17
+ @
@@ -1,3 +1,4 @@
1
+ # DEPRICATED
1
2
  # Default requires for ADF modules
2
3
  #= require_self
3
4
  #= require_tree ./views
@@ -1,3 +1,3 @@
1
1
  module SocmapAdf
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
data/socmap_adf.gemspec CHANGED
@@ -19,8 +19,6 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ["lib"]
20
20
 
21
21
  s.rubyforge_project = "socmap_adf"
22
-
23
22
  s.add_dependency "rails"
24
-
25
23
  s.add_development_dependency "sqlite3"
26
24
  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.6
4
+ version: 0.0.7
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-18 00:00:00.000000000 Z
14
+ date: 2012-10-19 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -143,8 +143,11 @@ files:
143
143
  - lib/assets/javascripts/socmap_adf/modules/overlay/views/.DS_Store
144
144
  - lib/assets/javascripts/socmap_adf/modules/overlay/views/flash_overlay.coffee
145
145
  - lib/assets/javascripts/socmap_adf/modules/overlay/views/main.js.coffee
146
+ - lib/assets/javascripts/socmap_adf/modules/overlay/views/new/flash_overlay.js.coffee
147
+ - lib/assets/javascripts/socmap_adf/modules/overlay/views/new/overlay.js.coffee
146
148
  - lib/assets/javascripts/socmap_adf/modules/overlay/views/overlay.js.coffee
147
149
  - lib/assets/javascripts/socmap_adf/modules/overlay/views/polygon_label.js.coffee
150
+ - lib/assets/javascripts/socmap_adf/modules/overlay_push/.DS_Store
148
151
  - lib/assets/javascripts/socmap_adf/modules/overlay_push/init.js.coffee
149
152
  - lib/assets/javascripts/socmap_adf/modules/overlay_push/templates/colibration.jst.eco
150
153
  - lib/assets/javascripts/socmap_adf/modules/overlay_push/views/flash_new.js.coffee
@@ -200,7 +203,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
200
203
  version: '0'
201
204
  segments:
202
205
  - 0
203
- hash: -1446775132721988935
206
+ hash: 4199976749007262182
204
207
  required_rubygems_version: !ruby/object:Gem::Requirement
205
208
  none: false
206
209
  requirements:
@@ -209,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
212
  version: '0'
210
213
  segments:
211
214
  - 0
212
- hash: -1446775132721988935
215
+ hash: 4199976749007262182
213
216
  requirements: []
214
217
  rubyforge_project: socmap_adf
215
218
  rubygems_version: 1.8.24