Move some javascript functions out of global scope

This commit is contained in:
Tom Hughes 2015-02-24 00:19:08 +00:00
parent 8568c93703
commit bd2e999756
10 changed files with 60 additions and 65 deletions

View file

@ -26,7 +26,7 @@ $(document).ready(function () {
}
if ($("#map").hasClass("set_location")) {
var marker = L.marker([0, 0], {icon: getUserIcon()});
var marker = L.marker([0, 0], {icon: OSM.getUserIcon()});
if (OSM.home) {
marker.setLatLng([OSM.home.lat, OSM.home.lon]);
@ -51,7 +51,7 @@ $(document).ready(function () {
$("[data-user]").each(function () {
var user = $(this).data('user');
if (user.lon && user.lat) {
L.marker([user.lat, user.lon], {icon: getUserIcon(user.icon)}).addTo(map)
L.marker([user.lat, user.lon], {icon: OSM.getUserIcon(user.icon)}).addTo(map)
.bindPopup(user.description);
}
});