diff options
author | Logan Hunt <loganhunt@simponic.xyz> | 2022-04-01 12:58:55 -0600 |
---|---|---|
committer | Logan Hunt <loganhunt@simponic.xyz> | 2022-04-01 12:58:55 -0600 |
commit | f62854ebaa689c4bf434f213f1f610a1779f8696 (patch) | |
tree | 4b469fd926395204ced946561abe665027707158 | |
parent | 42cf50ee7521bd751f4d0f0798276e548bb83fee (diff) | |
download | locchat-f62854ebaa689c4bf434f213f1f610a1779f8696.tar.gz locchat-f62854ebaa689c4bf434f213f1f610a1779f8696.zip |
Fix some bugs
-rw-r--r-- | client/components/map/chat_room_geoman.jsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/client/components/map/chat_room_geoman.jsx b/client/components/map/chat_room_geoman.jsx index 9f7ab6a..c4655ee 100644 --- a/client/components/map/chat_room_geoman.jsx +++ b/client/components/map/chat_room_geoman.jsx @@ -70,6 +70,10 @@ export const Geoman = ({ user, userPos, joinRoom }) => { dontRedirect = false; }, 500); }); + marker.bindPopup(chatRoom.name || `Chat Room ${chatRoom.id}`); + marker.on('mouseover', (e) => { + e.target.openPopup(); + }); if (chatRoom.isEditable) { [circle, marker].map((x) => { x.on('pm:edit', (e) => { @@ -78,6 +82,7 @@ export const Geoman = ({ user, userPos, joinRoom }) => { circle.setLatLng(coords); api.put(`/chat_rooms/${chatRoom.id}`, { ...chatRoom, + radius: circle.getRadius(), latitude: coords.lat, longitude: coords.lng, }); @@ -93,11 +98,6 @@ export const Geoman = ({ user, userPos, joinRoom }) => { circle.on('pm:drag', (e) => { marker.setLatLng(e.target.getLatLng()); }); - marker.bindPopup(chatRoom.name || `Chat Room ${chatRoom.id}`); - marker.on('mouseover', (e) => { - console.log(chatRoom); - e.target.openPopup(); - }); marker.on('pm:drag', (e) => { circle.setLatLng(e.target.getLatLng()); }); |