From d8bb1bf1537166753a53000e31ece8f99c7daaaa Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 26 Jun 2012 17:39:46 -0700 Subject: including the map icons inside the component and adding the empty category Signed-off-by: Valerio Virgillito --- node_modules/montage-google/map.reel/map.js | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'node_modules/montage-google/map.reel/map.js') diff --git a/node_modules/montage-google/map.reel/map.js b/node_modules/montage-google/map.reel/map.js index 4e3a6d70..1aeb97df 100644 --- a/node_modules/montage-google/map.reel/map.js +++ b/node_modules/montage-google/map.reel/map.js @@ -117,9 +117,12 @@ var Map = exports.Map = Montage.create(Component, /** @lends module:"montage/ui/ this._category = value; if (this._map && this.latLng) { this._getPlaces(this._category); - this.needsDraw = true; } + } else { + this._places = []; } + + this.needsDraw = true; } }, @@ -186,26 +189,30 @@ var Map = exports.Map = Montage.create(Component, /** @lends module:"montage/ui/ var icon, image; switch(this.category) { case 'restaurant': - icon = '48-fork-and-knife.png'; + icon = 'fork-and-knife.png'; break; case 'hospital': - icon = '10-medical.png'; + icon = 'medical.png'; break; case 'bar': - icon = '88-beer-mug.png'; + icon = 'beer-mug.png'; break; case 'grocery_or_supermarket': - icon = '80-shopping-cart.png'; + icon = 'shopping.png'; break; case 'museum': - icon = '41-picture-frame.png'; + icon = 'picture-frame.png'; break; case 'gas_station': - icon = '47-fuel.png'; + icon = 'fuel.png'; break; - }; + case 'cafe': + icon = 'cafe.png'; + break; + } + if(icon) { - image = new google.maps.MarkerImage('images/' + icon); + image = new google.maps.MarkerImage(this._montage_metadata.require.modules['map.reel/map'].directory + 'icons/' + icon); } var options = { map: map, @@ -289,6 +296,8 @@ var Map = exports.Map = Montage.create(Component, /** @lends module:"montage/ui/ for (var i = 0; i < places.length; i++) { this._createMarker(places[i]); } + } else { + this._removeAllMarkers(); } if(this.traffic === true) { -- cgit v1.2.3