Move popup anchor definition to icon
This commit is contained in:
parent
f913b7d8a5
commit
9bd48640ad
2 changed files with 3 additions and 2 deletions
|
@ -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]
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue