Move popup anchor definition to icon

This commit is contained in:
John Firebaugh 2012-11-09 15:57:31 -08:00
parent f913b7d8a5
commit 9bd48640ad
2 changed files with 3 additions and 2 deletions

View file

@ -116,7 +116,8 @@ function getUserIcon(url) {
return L.icon({
iconUrl: url || <%= asset_path('marker-red.png').to_json %>,
iconSize: [19, 25],
iconAnchor: [11, 26]
iconAnchor: [11, 26],
popupAnchor: [-1, -20]
});
}

View file

@ -33,7 +33,7 @@ $(document).ready(function () {
var user = $(this).data('user');
if (user.lon && user.lat) {
L.marker([user.lat, user.lon], {icon: getUserIcon(user.icon)}).addTo(map)
.bindPopup(user.description, {offset: L.point(-1, -20)});
.bindPopup(user.description);
}
});
}