Commit 3138ed62 authored by Corentin Mors's avatar Corentin Mors
Browse files

Handle user colors for positions on map

parent 620c06e2
......@@ -353,12 +353,23 @@ $(function() {
accuracyFeature.setGeometry(geolocation.getAccuracyGeometry());
});
// Get rid of legacy login system
const urlParams = new URLSearchParams(window.location.search);
username = urlParams.get('u');
socket.emit('add user', username);
$loginPage.fadeOut();
$chatPage.show();
$loginPage.off('click');
$currentInput = $inputMessage.focus();
var positionFeature = new Feature();
positionFeature.setStyle(new Style({
image: new CircleStyle({
radius: 6,
fill: new Fill({
color: '#3399CC'
color: getUsernameColor(username)
}),
stroke: new Stroke({
color: '#fff',
......@@ -368,16 +379,6 @@ $(function() {
}));
// Get rid of legacy login system
const urlParams = new URLSearchParams(window.location.search);
username = urlParams.get('u');
socket.emit('add user', username);
$loginPage.fadeOut();
$chatPage.show();
$loginPage.off('click');
$currentInput = $inputMessage.focus();
geolocation.on('change:position', function() {
map.getView().setCenter(geolocation.getPosition());
......@@ -405,7 +406,7 @@ $(function() {
image: new CircleStyle({
radius: 6,
fill: new Fill({
color: '#ec0a0a'
color: getUsernameColor(data.username)
}),
stroke: new Stroke({
color: '#fff',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment