socmap_adf 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ # 0.0.10
2
+
3
+ ### Features & Enhancements
4
+ * MiniMap add setMapTypeId with OSM support
5
+
6
+
1
7
  # 0.0.9
2
8
 
3
9
  ### Bug fixes
@@ -19,7 +19,12 @@ class ADF.Minimap.Models.Minimap extends Backbone.Model
19
19
  initGMap: (mapElement) ->
20
20
  @mapElement = mapElement
21
21
  @map = new google.maps.Map(document.getElementById(@mapElement), @attributes)
22
+ @loadOSM() if @get("mapTypeId") == "OSM"
22
23
  return @map
24
+
25
+ setMapTypeId: (mapTypeId) =>
26
+ @loadOSM() if mapTypeId == "OSM"
27
+ @map.setMapTypeId(mapTypeId)
23
28
 
24
29
  getGMap: () ->
25
30
  return @map
@@ -46,4 +51,13 @@ class ADF.Minimap.Models.Minimap extends Backbone.Model
46
51
  clearMap: () ->
47
52
  for overlay in @overlays
48
53
  overlay.setMap(null)
49
- @overlays = []
54
+ @overlays = []
55
+
56
+ loadOSM: () ->
57
+ @map.mapTypes.set("OSM", new google.maps.ImageMapType(
58
+ getTileUrl: (coord, zoom) =>
59
+ return "http://tile.openstreetmap.org/" + zoom + "/" + coord.x + "/" + coord.y + ".png"
60
+ tileSize: new google.maps.Size(256, 256)
61
+ name: "OpenStreetMap"
62
+ maxZoom: 18
63
+ ))
@@ -45,6 +45,9 @@ class ADF.Minimap.Views.Main extends ADF.MVC.Views.Base
45
45
 
46
46
  setCenter: (latLng) ->
47
47
  @model.setCenter(latLng)
48
+
49
+ setMapTypeId: (mapTypeId) ->
50
+ @model.setMapTypeId(mapTypeId)
48
51
 
49
52
  setCenterWithOffset: (position, offsetx, offsety) ->
50
53
  @model.setCenter(position)
@@ -1,3 +1,3 @@
1
1
  module SocmapAdf
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
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.9
4
+ version: 0.0.10
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-22 00:00:00.000000000 Z
14
+ date: 2012-10-23 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rails
@@ -203,7 +203,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
203
203
  version: '0'
204
204
  segments:
205
205
  - 0
206
- hash: -439147423357880215
206
+ hash: -302836586570035622
207
207
  required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  none: false
209
209
  requirements:
@@ -212,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
212
  version: '0'
213
213
  segments:
214
214
  - 0
215
- hash: -439147423357880215
215
+ hash: -302836586570035622
216
216
  requirements: []
217
217
  rubyforge_project: socmap_adf
218
218
  rubygems_version: 1.8.24