Skip to content

Origin and Destination input boxes stay opened when setOrigin/setDestination are called twice. #327

@andrewQwer

Description

@andrewQwer

Hi.

When setOrigin or setDestination are called 2 or more times input boxes stay opened, suggesting to select a location. I would like to behave as if it was initially set.

Example is here:
https://jsfiddle.net/etfg3d46/2/

Screenshot:

Image
map.on('load', function() { 
  map.addControl(directionsControl, 'top-left');
  directionsControl.setDestination("Philadelphia");
  directionsControl.setOrigin("New York");    


  setTimeout(() => {
    directionsControl.setDestination("Chicago, Illinois, United States");
  }, 2500);
  setTimeout(() => {
    directionsControl.setOrigin("Washington");
  }, 5000);
});

It doesn't happen when I pass coordinates, but I would like to see place names instead of numbers in input boxes.

Any workarounds to keep it closed?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions