MMM-Globe ownImagePath



  • Hi there
    I have MMM-Globe in my modules, but not sure how to get it to set it up in the config.
    Im unsure about whether I have to find my own Image Path here? and if so, how do I find it?
    or maybe I’m looking at this wrong? as in, what actual parts from Globe.js do I copy over to config.js?

    Do I set my preferred style, and choose relevant link from those supplied below it?

    {
    	module: 'MMM-Globe',
    	position: 'bottom_center',
    	config: {
    		style: 'geoColor',
    		imageSize: 600,
    		ownImagePath:'',
    		updateInterval: 10*60*1000
    	}
    },
    
    },
    
    	start: function () {
    		self = this;
    		this.url = '';
    		this.imageUrls = {
    			'natColor': 'http://rammb.cira.colostate.edu/ramsdis/online/images/latest/himawari-8/full_disk_ahi_natural_color.jpg',
    			'geoColor': 'http://rammb.cira.colostate.edu/ramsdis/online/images/latest/himawari-8/full_disk_ahi_true_color.jpg',
    			'airMass': 'http://rammb.cira.colostate.edu/ramsdis/online/images/latest/himawari-8/full_disk_ahi_rgb_airmass.jpg',
    			'fullBand': 'http://rammb.cira.colostate.edu/ramsdis/online/images/latest/himawari-8/himawari-8_band_03_sector_02.gif',
    			'europeDiscNat': 'http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGBNatColour_LowResolution.jpg',
    			'europeDiscSnow': 'http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGBSolarDay_CentralEurope.jpg',
    			'centralAmericaDiscNat': 'http://goes.gsfc.nasa.gov/goescolor/goeseast/overview2/color_med/latestfull.jpg'
    
    		}
    		this.hiResImageUrls = {
    			'natColor': 'http://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/full_disk_ahi_natural_color.jpg',
    			'geoColor': 'http://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/full_disk_ahi_true_color.jpg',
    			'airMass': 'http://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/full_disk_ahi_rgb_airmass.jpg',
    			'fullBand': 'http://rammb.cira.colostate.edu/ramsdis/online/images/latest/himawari-8/himawari-8_band_03_sector_02.gif',
    			'europeDiscNat': 'http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGBNatColour_LowResolution.jpg',
    			'europePartSnow': 'http://oiswww.eumetsat.org/IPPS/html/latestImages/EUMETSAT_MSG_RGBSolarDay_CentralEurope.jpg',
    			'centralAmericaDiscNat': 'http://goes.gsfc.nasa.gov/goescolor/goeseast/overview2/color_lrg/latestfull.jpg'
    		}
    		console.log(this.imageUrls[this.config.style]);
    		if (this.config.ownImagePath != '') {
    			this.url = this.config.ownImagePath;
    		} else {
    			if (this.config.imageSize > 800) {
    				this.url = this.hiResImageUrls[this.config.style];
    			} else {
    				this.url = this.imageUrls[this.config.style];
    			}
    			setInterval(function () {
    				self.updateDom(1000);
    				console.log('update')
    			}, this.config.updateInterval);
    		}
    	},
    
    	getStyles: function () {
    		return ["MMM-Globe.css"]
    	},
    
    	// Override dom generator.
    
    	getDom: function () {
    		var wrapper = document.createElement("div");
    		if (this.config.style == "europeDiscNat") {
    			wrapper.style.height = 0.98 * this.config.imageSize - 1 + "px";
    			wrapper.style.overflow = "hidden";
    		}
    
    
    		var image = document.createElement("img");
    		if (this.config.ownImagePath != '') {
    			image.src = this.url;
    		} else if (this.config.style == "centralAmericaDiscNat"){
    			image.src = this.url + '?' + new Date().getTime();
    			image.className = 'MMM-Globe-image-centralAmericaDiscNat';
    		} else {
    			image.src = this.url + '?' + new Date().getTime();
    			image.className = 'MMM-Globe-image';
    		}
    
    		image.width = this.config.imageSize.toString();
    		image.height = this.config.imageSize.toString();
    
    		wrapper.appendChild(image);
    		return wrapper;
    	}
    });
    

    Tvmia



  • something like this? only this wont work, so know i need more info there?

    {
    	module: 'MMM-Globe',
    	position: 'bottom_center',
    	config: {
    		style: 'geoColor',
    		imageSize: 600,
    		ownImagePath:  'geoColor': 'http://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/full_disk_ahi_true_color.jpg',
    		updateInterval: 10*60*1000 ,
    	}
    },
    
    


  • Ok, incase this may be of help to someone setting up the Globe… my mistake was thinking I had to enter a preferred url link, from the options below it in the Cofig.js file, into the ownImagePath… That is only if you want to use an external source.

    If you just place the following into your Config.js folder, and add any one of the following into the Style field, until you get the one you like.

    natColor
    geoColor
    airMass
    fullBand
    europeDiscNat
    europeDiscSnow
    centralAmericaDiscNat

    {
        module: 'MMM-Globe',
        position: '*ENTER WHERE YOU WANT YOUR GLOBE POSITIONED HERE*',
        config: {
            style: 'ENTER YOUR STYLE HERE',
            imageSize: *ENTER WHAT SIZE YOU WANT YOUR GLOBE TO BE,*
            ownImagePath:'',
            updateInterval: 10*60*1000
        }
    },
    

Log in to reply
 

Looks like your connection to MagicMirror Forum was lost, please wait while we try to reconnect.