agentsoz / ees-ui

Emeregency Evacuation Simulator (EES) - Web Client
3 stars 2 forks source link

Allow vehicles to be configured for the evacuation scenario using a drawn box #7

Closed dhixsingh closed 9 months ago

dhixsingh commented 5 years ago

This goes some way towards drawing a box on the map: https://www.mapbox.com/mapbox-gl-js/example/using-box-queryrenderedfeatures/.

We probably want the ability to enter data in a popup here just like in #6.

ayoung012 commented 5 years ago

Store coordinate in vuex store

ayoung012 commented 5 years ago

Using mapbox-gl-draw removes mobile tap functionality across mapbox: https://github.com/mapbox/mapbox-gl-draw/issues/617

Temporary workaround outlined here: https://github.com/cityofaustin/dockless/issues/48

ayoung012 commented 5 years ago

@dhixsingh In its current state, this works fine on devices with a mouse pointer. Some work is required in order to support mobile devices:

As per the workaround, draw controls can only be active on a mobile device while actually intending to draw. This can be done by adding draw controls when ready to select a population area, and removing the draw controls when the shape is finished being drawn.

Unfortunately this removes any features drawn with mapbox draw. I can address this by adding a polygon layer manually with the same coordinates to replace the mapbox-draw artifact.

This would solve our issue. However I would first like to make sure mobile support is considered a priority and worth spending effort on.

dhixsingh commented 5 years ago

Let's put mobile support aside for the moment then @ayoung012. Would you mind adding a separate ticket for mobile support and list the related todo items in there.

dhixsingh commented 5 years ago

Checked it out (using Safari). Some things to fix/adjust:

  1. We need some feedback that the user is in "box drawing" mode, by (a) changing the shape of the mouse pointer to something appropriate like a crosshair, and (b) changing it back once the drawing is complete. Also (c) maybe use the ESC key to cancel any active operation (in this case the draw).
  2. The box is not visible after the draw is complete. It should be visible, selectable and editable in terms of number of vehicles.
  3. It doesn't seem possible to draw more than one box.
ayoung012 commented 5 years ago

Workflow to be similar to previous version.