thomaspeugeot / tkv

10 000
MIT License
0 stars 0 forks source link

provide Haïti to France mapping #11

Closed thomaspeugeot closed 5 years ago

thomaspeugeot commented 6 years ago

Currently, only France is reactive to user input. Haïti is not.

Situation : Select bottom part of the interface (Haïti part). Zoom in on Haïti land. Click on any location in Haïti.

Problem : Nothing happens (in fact, the closest territory in France is computed)

Expected behavior : The territory in Haïti is computed and its border is drawn. The twin territory is drawn in France.

thomaspeugeot commented 6 years ago

To implement this enhancement, it is necessary to compute what is the closest country, France or Haïti.

The ClosestBodyInOriginalPosition function already works for one country (package translation). The function return the closest body and the distance

thomaspeugeot commented 6 years ago

To implement this enhancement, one needs to understand the control flow when the user click on the map

Start from $scope.$on('leafletDirectiveMap.click' in tkv-client.js

which calls translateLatLngInSourceCountryToLatLngInTargetCountry on the server side (runtime_server) which calls the function with the same name in the handler package