From: John Firebaugh Date: Fri, 9 Nov 2012 23:57:31 +0000 (-0800) Subject: Move popup anchor definition to icon X-Git-Tag: live~5743^2~13 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/9bd48640adae8a713e9bd95a7383c41a7cf4adb3?hp=f913b7d8a551dafbf5b0f478fe3731ad60aaef9d Move popup anchor definition to icon --- diff --git a/app/assets/javascripts/map.js.erb b/app/assets/javascripts/map.js.erb index 6d15f1fdb..e30e073ba 100644 --- a/app/assets/javascripts/map.js.erb +++ b/app/assets/javascripts/map.js.erb @@ -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] }); } diff --git a/app/assets/javascripts/user.js b/app/assets/javascripts/user.js index 4e1c7d0c3..25456d04e 100644 --- a/app/assets/javascripts/user.js +++ b/app/assets/javascripts/user.js @@ -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); } }); }