aboutsummaryrefslogtreecommitdiff
path: root/node_modules
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-06-01 13:48:20 -0700
committerJose Antonio Marquez2012-06-01 13:48:20 -0700
commitf34752a034c7bf9060c7a286975df51f4e1a1e04 (patch)
tree83d6be6bc564b305c2f2204cc9f74727148dab60 /node_modules
parent86837d69186bc4d1d6f54fc893c523de0972a0b9 (diff)
downloadninja-f34752a034c7bf9060c7a286975df51f4e1a1e04.tar.gz
Map fixes
Diffstat (limited to 'node_modules')
-rw-r--r--node_modules/montage-google/map.reel/map.js22
1 files changed, 15 insertions, 7 deletions
diff --git a/node_modules/montage-google/map.reel/map.js b/node_modules/montage-google/map.reel/map.js
index 879a80d4..4e3a6d70 100644
--- a/node_modules/montage-google/map.reel/map.js
+++ b/node_modules/montage-google/map.reel/map.js
@@ -21,10 +21,10 @@ var Map = exports.Map = Montage.create(Component, /** @lends module:"montage/ui/
21 value: function() { 21 value: function() {
22 var self = this; 22 var self = this;
23 23
24 this._latLng = this.defaultLatLng;
25 window.initialize = function initialize() { 24 window.initialize = function initialize() {
26 self._mapLoaded = true; 25 self._mapLoaded = true;
27 self._geoCoder = new google.maps.Geocoder(); 26 self._geoCoder = new google.maps.Geocoder();
27 self.center = self._center;
28 self.needsDraw = true; 28 self.needsDraw = true;
29 }; 29 };
30 } 30 }
@@ -115,7 +115,7 @@ var Map = exports.Map = Montage.create(Component, /** @lends module:"montage/ui/
115 set: function(value) { 115 set: function(value) {
116 if(value) { 116 if(value) {
117 this._category = value; 117 this._category = value;
118 if (this._mapLoaded && this.latLng) { 118 if (this._map && this.latLng) {
119 this._getPlaces(this._category); 119 this._getPlaces(this._category);
120 this.needsDraw = true; 120 this.needsDraw = true;
121 } 121 }
@@ -139,7 +139,7 @@ var Map = exports.Map = Montage.create(Component, /** @lends module:"montage/ui/
139 139
140 140
141 zoomValue: { 141 zoomValue: {
142 value: 8 142 value: 13
143 }, 143 },
144 144
145 __places: {value: null}, 145 __places: {value: null},
@@ -249,9 +249,17 @@ var Map = exports.Map = Montage.create(Component, /** @lends module:"montage/ui/
249 draw: { 249 draw: {
250 enumerable: false, 250 enumerable: false,
251 value: function () { 251 value: function () {
252
253 if(this._mapLoaded) { 252 if(this._mapLoaded) {
254 var latLng = this.latLng || this.defaultLatLng; 253 var latLng = this.latLng;
254
255 if (!latLng) {
256 if (this._center) {
257 return;
258 } else {
259 latLng = this.defaultLatLng;
260 }
261 }
262
255 if(!this._map) { 263 if(!this._map) {
256 var map; 264 var map;
257 var myOptions = { 265 var myOptions = {
@@ -266,7 +274,7 @@ var Map = exports.Map = Montage.create(Component, /** @lends module:"montage/ui/
266 } 274 }
267 275
268 var map = this._map; 276 var map = this._map;
269 map.setZoom(10); 277 //map.setZoom(10);
270 var latLng = new window.google.maps.LatLng(latLng.lat, latLng.lng); 278 var latLng = new window.google.maps.LatLng(latLng.lat, latLng.lng);
271 map.setCenter(latLng); 279 map.setCenter(latLng);
272 var marker = new google.maps.Marker({ 280 var marker = new google.maps.Marker({
@@ -276,7 +284,7 @@ var Map = exports.Map = Montage.create(Component, /** @lends module:"montage/ui/
276 284
277 var places = this._places; 285 var places = this._places;
278 if(places && places.length > 0) { 286 if(places && places.length > 0) {
279 map.setZoom(13); 287 //map.setZoom(13);
280 this._removeAllMarkers(); 288 this._removeAllMarkers();
281 for (var i = 0; i < places.length; i++) { 289 for (var i = 0; i < places.length; i++) {
282 this._createMarker(places[i]); 290 this._createMarker(places[i]);