Last active
December 15, 2015 17:39
-
-
Save wfendler/5297997 to your computer and use it in GitHub Desktop.
Don't know how to add the data I get inside of the $list.find('li').each() and add it to the ExploreMap.locations object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Explore Map | |
*/ | |
define([ | |
'jquery' | |
], function( | |
$ | |
) { | |
'use strict'; | |
var ExploreMap = function(map, list) { | |
this.map = map; | |
this.$list = list; | |
this.locations = {}; | |
this.enableUI(); | |
return this; | |
}; | |
ExploreMap.prototype.enableUI = function() { | |
var $list = this.$list; | |
// Build Location Data | |
$list.find('li').each(function() { | |
console.log(this); | |
var locName = $(this).find('.js-location-name'); | |
var data = $(this).data(); | |
var isRustica = data.isRustica; | |
var coordinates = data.latlng; | |
ExploreMap.locations[locName] = locName; | |
ExploreMap.locations[locName].isRustica = isRustica; | |
ExploreMap.locations[locName].latLng = coordinates; | |
}); | |
return this; | |
}; | |
return ExploreMap; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment