socmap_adf 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
| @@ -39,6 +39,9 @@ class ADF.Minimap.Views.Main extends ADF.MVC.Views.Base | |
| 39 39 |  | 
| 40 40 | 
             
              getMap: () ->
         | 
| 41 41 | 
             
                @model
         | 
| 42 | 
            +
                
         | 
| 43 | 
            +
              getGMap: () ->
         | 
| 44 | 
            +
                @model.getGMap()
         | 
| 42 45 |  | 
| 43 46 | 
             
              setCenter: (latLng) ->
         | 
| 44 47 | 
             
                @model.setCenter(latLng)
         | 
| @@ -52,9 +55,6 @@ class ADF.Minimap.Views.Main extends ADF.MVC.Views.Base | |
| 52 55 | 
             
                pos = new google.maps.LatLng(lat, lng)
         | 
| 53 56 | 
             
                @model.setCenter(pos)
         | 
| 54 57 |  | 
| 55 | 
            -
              getGMap: () ->
         | 
| 56 | 
            -
                @model.getGMap()
         | 
| 57 | 
            -
                
         | 
| 58 58 | 
             
              fitBounds: (bounds_array, centerWithOffset) ->
         | 
| 59 59 | 
             
                if bounds_array
         | 
| 60 60 | 
             
                  bounds = new google.maps.LatLngBounds()
         | 
| @@ -0,0 +1,77 @@ | |
| 1 | 
            +
            class ADF.OverlayPush.Views.FlashNew extends ADF.GMap.Views.OverlayView 
         | 
| 2 | 
            +
              
         | 
| 3 | 
            +
              hidden: false
         | 
| 4 | 
            +
              draggable: true
         | 
| 5 | 
            +
              clickEvent: null
         | 
| 6 | 
            +
              
         | 
| 7 | 
            +
              opened: false
         | 
| 8 | 
            +
              clickable: false
         | 
| 9 | 
            +
              hoverable: true
         | 
| 10 | 
            +
              calibration: [0, -16, -20, 0]
         | 
| 11 | 
            +
              mouseout: true
         | 
| 12 | 
            +
              
         | 
| 13 | 
            +
              constructor: (options) ->
         | 
| 14 | 
            +
                super(options)
         | 
| 15 | 
            +
                @clickableArea = if options.area then options.area else @map.getGMap()
         | 
| 16 | 
            +
                @initOverlay()
         | 
| 17 | 
            +
             | 
| 18 | 
            +
              initOverlay: () ->
         | 
| 19 | 
            +
                if not @overlay 
         | 
| 20 | 
            +
                  if @point && @point.lat() > 0 && @point.lng() > 0
         | 
| 21 | 
            +
                    @pushOverlay()
         | 
| 22 | 
            +
                  else
         | 
| 23 | 
            +
                    @bindMap()
         | 
| 24 | 
            +
                else
         | 
| 25 | 
            +
                  @overlay.view = @
         | 
| 26 | 
            +
                  @redraw()
         | 
| 27 | 
            +
             | 
| 28 | 
            +
              bindMap: () ->
         | 
| 29 | 
            +
                @clickEvent = google.maps.event.addListener @clickableArea, 'click', @onClicked unless @clickEvent?
         | 
| 30 | 
            +
                
         | 
| 31 | 
            +
              unbindMap: () ->
         | 
| 32 | 
            +
                google.maps.event.removeListener(@clickEvent) if @clickEvent?
         | 
| 33 | 
            +
                @clickEvent = null
         | 
| 34 | 
            +
                
         | 
| 35 | 
            +
              onClicked: (e) =>
         | 
| 36 | 
            +
                @point = e.latLng
         | 
| 37 | 
            +
                @unbindMap()
         | 
| 38 | 
            +
                @pushOverlay()
         | 
| 39 | 
            +
                
         | 
| 40 | 
            +
              onMarkerMouseOver: () =>
         | 
| 41 | 
            +
                @openOverlayOnHover()
         | 
| 42 | 
            +
             | 
| 43 | 
            +
              onMarkerMouseOut: () =>
         | 
| 44 | 
            +
                @hideOverlayAfterTime() if @mouseout
         | 
| 45 | 
            +
             | 
| 46 | 
            +
              openOverlayOnHover: () =>
         | 
| 47 | 
            +
                @map.hideAllOverlays()
         | 
| 48 | 
            +
                @opened = true
         | 
| 49 | 
            +
                @calculatePosition()
         | 
| 50 | 
            +
                @show()
         | 
| 51 | 
            +
             | 
| 52 | 
            +
              hideOverlayIfNeeded: () =>
         | 
| 53 | 
            +
                @hide() if !@opened
         | 
| 54 | 
            +
             | 
| 55 | 
            +
              hideOverlayAfterTime: () =>
         | 
| 56 | 
            +
                @opened = false
         | 
| 57 | 
            +
                setTimeout(@hideOverlayIfNeeded, 1000)
         | 
| 58 | 
            +
             | 
| 59 | 
            +
              onRenderCompleted: () =>
         | 
| 60 | 
            +
                if @hoverable && @mouseout
         | 
| 61 | 
            +
                  $(@el).hover(@openOverlayOnHover, @hideOverlayAfterTime)
         | 
| 62 | 
            +
             | 
| 63 | 
            +
              calculatePosition: () ->
         | 
| 64 | 
            +
                arr = @getPositionArray()
         | 
| 65 | 
            +
                @setPosition(arr[0], arr[1])
         | 
| 66 | 
            +
             | 
| 67 | 
            +
              getPositionArray: () ->
         | 
| 68 | 
            +
                halfWidth = @map.getMapElement().width() / 2
         | 
| 69 | 
            +
                halfHeight = @map.getMapElement().height() / 2
         | 
| 70 | 
            +
                divPixel = @overlay.getDivPixel()
         | 
| 71 | 
            +
                w = @getWidth() / 2
         | 
| 72 | 
            +
                h = @getHeight()
         | 
| 73 | 
            +
             | 
| 74 | 
            +
                return [h + @calibration[0], w + @calibration[3]] if divPixel.x <= halfWidth && divPixel.y < halfHeight
         | 
| 75 | 
            +
                return [h + @calibration[0], -w + @calibration[1]] if divPixel.x > halfWidth && divPixel.y < halfHeight
         | 
| 76 | 
            +
                return [@calibration[2], w + @calibration[3]] if divPixel.x <= halfWidth && divPixel.y >= halfHeight
         | 
| 77 | 
            +
                return [@calibration[2], -w + @calibration[1]] if divPixel.x > halfWidth && divPixel.y >= halfHeight
         | 
    
        data/lib/socmap_adf/version.rb
    CHANGED
    
    
    
        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 | 
            +
              version: 0.0.6
         | 
| 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 | 
            +
            date: 2012-10-18 00:00:00.000000000 Z
         | 
| 15 15 | 
             
            dependencies:
         | 
| 16 16 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 17 17 | 
             
              name: rails
         | 
| @@ -147,6 +147,7 @@ files: | |
| 147 147 | 
             
            - lib/assets/javascripts/socmap_adf/modules/overlay/views/polygon_label.js.coffee
         | 
| 148 148 | 
             
            - lib/assets/javascripts/socmap_adf/modules/overlay_push/init.js.coffee
         | 
| 149 149 | 
             
            - lib/assets/javascripts/socmap_adf/modules/overlay_push/templates/colibration.jst.eco
         | 
| 150 | 
            +
            - lib/assets/javascripts/socmap_adf/modules/overlay_push/views/flash_new.js.coffee
         | 
| 150 151 | 
             
            - lib/assets/javascripts/socmap_adf/modules/overlay_push/views/new.js.coffee
         | 
| 151 152 | 
             
            - lib/assets/javascripts/socmap_adf/modules/popup/init.js.coffee
         | 
| 152 153 | 
             
            - lib/assets/javascripts/socmap_adf/modules/popup/templates/base.jst.eco
         | 
| @@ -199,7 +200,7 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 199 200 | 
             
                  version: '0'
         | 
| 200 201 | 
             
                  segments:
         | 
| 201 202 | 
             
                  - 0
         | 
| 202 | 
            -
                  hash:  | 
| 203 | 
            +
                  hash: -1446775132721988935
         | 
| 203 204 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 204 205 | 
             
              none: false
         | 
| 205 206 | 
             
              requirements:
         | 
| @@ -208,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 208 209 | 
             
                  version: '0'
         | 
| 209 210 | 
             
                  segments:
         | 
| 210 211 | 
             
                  - 0
         | 
| 211 | 
            -
                  hash:  | 
| 212 | 
            +
                  hash: -1446775132721988935
         | 
| 212 213 | 
             
            requirements: []
         | 
| 213 214 | 
             
            rubyforge_project: socmap_adf
         | 
| 214 215 | 
             
            rubygems_version: 1.8.24
         |