sheltr/sheltr — Issue #7: Migrate functions from sheltr.map.js
Author: caseypt
Created: 2011-12-09 01:02:46+00:00
State: open

Functions to move, maybe:

orientUser - This function gets the user location from the browser. In the call back, the map is created and centered around the user. getLocations is also called using the lat/lng of the user location. I think this should be a stand-along function (or part of a sheltr.setup, if we want to go that route), which after it has the userslocation (either from the browser or via geocode), would call getLocations.

getLocations - This function gets the distance sorted list of shelters based of the user location. While the list is used on the map, it’s not exclusive to the map. I think this should be a stand-alone function which then passes the response to the shelter.locations or to a global object to store the returned data. I'm also thinking It could fall under sh.locations.js

selectMarkerIcon - This function decides which icon should be used for each location on the map and the list. Since this is used in both the map and the list, and is an attribute of a location (essentially), I think it should be moved to sh.locations.js