website/src/MapPage/map.js
/**
     * updates the location of the main marker and updates the generated image periodically
     * @param {int[]} point - the point of the marker
     */
updates the location of the main marker and updates the generated image periodically
@param {int[]} point - the point of the marker
updates the location of the main marker and updates the generated image periodically @param { int [] } point - the point of the marker
function updatePOI(point) {
        Plotly.restyle(divName, { 'x': [[point[0]]], 'y': [[point[1]]] }, 1).catch(function(e) {});
        let roundedX = Math.round(1000.0*point[0])/1000.0;
        let roundedY = Math.round(1000.0*point[1])/1000.0;
        stateHolder.setState({
            cursorPoint: [roundedX,roundedY]
        });
        Plotly.relayout(divName, { 'shapes': getLinesToNeighborsOnPlot(point) });
        const distancesAndIds = getNearestNeighborsOnPlot(point).map(nn =>
            [calculateDistance(nn.slice(0, 2), point), paintingIds[nn[2]]]);
        const ids = distancesAndIds.map(p => p[1]);
        const distances = distancesAndIds.map(p => p[0]);
        const millisSinceLastCall = Date.now() - lastTimeCalled;
        if (millisSinceLastCall > TIME_TILL_CALL) {
            lastTimeCalled = Date.now();
            interpolateAndSet(ids, distances)
        }
    }
function updatePOI ( point ) { Plotly . restyle ( divName , { 'x' : [ [ point [ 0 ] ] ] , 'y' : [ [ point [ 1 ] ] ] } , 1 ) . catch ( function ( e ) { } ) ; let roundedX = Math . round ( 1000.0 * point [ 0 ] ) / 1000.0 ; let roundedY = Math . round ( 1000.0 * point [ 1 ] ) / 1000.0 ; stateHolder . setState ( { cursorPoint : [ roundedX , roundedY ] } ) ; Plotly . relayout ( divName , { 'shapes' : getLinesToNeighborsOnPlot ( point ) } ) ; const distancesAndIds = getNearestNeighborsOnPlot ( point ) . map ( nn => [ calculateDistance ( nn . slice ( 0 , 2 ) , point ) , paintingIds [ nn [ 2 ] ] ] ) ; const ids = distancesAndIds . map ( p => p [ 1 ] ) ; const distances = distancesAndIds . map ( p => p [ 0 ] ) ; const millisSinceLastCall = Date . now ( ) - lastTimeCalled ; if ( millisSinceLastCall > TIME_TILL_CALL ) { lastTimeCalled = Date . now ( ) ; interpolateAndSet ( ids , distances ) } }
updates the location of the main marker and updates the generated image periodically
 @param {int[]} point - the point of the marker
updates the location of the main marker and updates the generated image periodically @param { int [] } point - the point of the marker