mapbox-gl-directions icon indicating copy to clipboard operation
mapbox-gl-directions copied to clipboard

Coordinates doesn't appear in inputs after control was removed and re-added

Open sberdashkevich opened this issue 7 years ago • 3 comments

Hi. After control was removed and re-added, and I click on map, waypoint appears, but input staying unchanged.

Steps to Trigger Behavior

  1. Remove controls via map.removeControl(directions)
  2. Add control via map.addControl(directions, 'top-left');
  3. Click on map to set waypoint

Demonstration Builded master branch- commit 07ebea2 inputs

Expected Behavior After waypoint is set, his coordinates appears in origin or destination input.

Actual Behavior Inputs doesn't change.

P.S. As my customer wanted to have that feature as soos as possible, I managed to fix it (https://github.com/sberdashkevich/mapbox-gl-directions/commit/ef7cbd60c9421f695ef42cc4e3d4617c6a813dcc). But I have never worked with redux before, so I think that my fix is not very good, and I'm still testing it.

sberdashkevich avatar Aug 10 '18 13:08 sberdashkevich

+1

jonathonwpowell avatar Dec 19 '19 01:12 jonathonwpowell

+1

jcardus avatar Jun 01 '21 20:06 jcardus

Me too, does not work even recreating the map with new, or control with new! ex:

function createMap(){
    let map = new mapboxgl.Map({...})
    map.on('load', () => {
        map.addControl(new MapboxDirections({...}))
    })
}

if i call this function after a while, everything mount and render, but the problem remains.

SamukaDEV avatar Jan 03 '23 20:01 SamukaDEV