aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage/ui/map.reel/map.js
diff options
context:
space:
mode:
authorKishore Subramanian2012-03-19 14:14:29 -0700
committerKishore Subramanian2012-03-19 14:14:29 -0700
commitec58642a7b31165890eb5bef7d95ce59dd0c34a0 (patch)
tree32640021d0362314ee5898626a0721feca814154 /node_modules/montage/ui/map.reel/map.js
parent9d364be255900e9bde02c4b254d145ec41fc78fb (diff)
downloadninja-ec58642a7b31165890eb5bef7d95ce59dd0c34a0.tar.gz
Changes to Map and FeedReader
- Added traffic property to Map - Support for show/hide traffic in the example - Changed FeedReader to use only one DIV. No longer uses Repetition - Support multiple modes in the Feed reader - timed/animated
Diffstat (limited to 'node_modules/montage/ui/map.reel/map.js')
-rw-r--r--node_modules/montage/ui/map.reel/map.js29
1 files changed, 27 insertions, 2 deletions
diff --git a/node_modules/montage/ui/map.reel/map.js b/node_modules/montage/ui/map.reel/map.js
index 305ae181..42af218e 100644
--- a/node_modules/montage/ui/map.reel/map.js
+++ b/node_modules/montage/ui/map.reel/map.js
@@ -114,6 +114,21 @@ var Map = exports.Map = Montage.create(Component, /** @lends module:"montage/ui/
114 } 114 }
115 }, 115 },
116 116
117 trafficLayer: {value: null},
118 _traffic: {value: null},
119 traffic: {
120 get: function() {
121 return this._traffic;
122 },
123 set: function(value) {
124 if(value !== this._traffic) {
125 this._traffic = value;
126 this.needsDraw = true;
127 }
128 }
129 },
130
131
117 zoomValue: { 132 zoomValue: {
118 value: 8 133 value: 8
119 }, 134 },
@@ -239,7 +254,7 @@ var Map = exports.Map = Montage.create(Component, /** @lends module:"montage/ui/
239 this._map = new window.google.maps.Map(this.mapEl, myOptions); 254 this._map = new window.google.maps.Map(this.mapEl, myOptions);
240 } else { 255 } else {
241 var map = this._map; 256 var map = this._map;
242 map.setZoom(12); 257 map.setZoom(10);
243 var latLng = new window.google.maps.LatLng(latLng.lat, latLng.lng); 258 var latLng = new window.google.maps.LatLng(latLng.lat, latLng.lng);
244 map.setCenter(latLng); 259 map.setCenter(latLng);
245 var marker = new google.maps.Marker({ 260 var marker = new google.maps.Marker({
@@ -249,11 +264,21 @@ var Map = exports.Map = Montage.create(Component, /** @lends module:"montage/ui/
249 264
250 var places = this._places; 265 var places = this._places;
251 if(places && places.length > 0) { 266 if(places && places.length > 0) {
267 map.setZoom(13);
252 this._removeAllMarkers(); 268 this._removeAllMarkers();
253 for (var i = 0; i < places.length; i++) { 269 for (var i = 0; i < places.length; i++) {
254 this._createMarker(places[i]); 270 this._createMarker(places[i]);
255 } 271 }
256 } 272 }
273
274 if(this.traffic === true) {
275 this.trafficLayer = new google.maps.TrafficLayer();
276 this.trafficLayer.setMap(map);
277 } else {
278 if(this.trafficLayer) {
279 this.trafficLayer.setMap(null);
280 }
281 }
257 } 282 }
258 283
259 } 284 }