Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] New modes like country mode (states mode, continent mode, ...) #188

Closed
BilelJegham opened this issue Jun 6, 2021 · 2 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@BilelJegham
Copy link
Member

BilelJegham commented Jun 6, 2021

Is your feature request related to a problem? Please describe.
GeoGuess has country mode. It should be great to have other game modes like states picker, continent picker.

Describe the solution you'd like

  1. Allow users to create a new mode

    1. Define areas on the map with GeoJSON
      Examples :
  1. add function set data random pos
    Ex:
export function getCountryCodeNameFromLatLng(latLng, errorFunction) {
   return axios
       .get(
           `https://nominatim.openstreetmap.org/reverse?lat=${latLng.lat()}&lon=${latLng.lng()}&zoom=5&addressdetails=1&format=json&extratags=1`
       )
       .then(({status, data}) => {
           if (status === 200 && data) {
               if(data.extratags['ISO3166-1:alpha2'])
                   return data.extratags['ISO3166-1:alpha2'];
               return data.address['country_code'].toUpperCase();
           }
       })
       .catch(() => {
           errorFunction();
           return undefined;
       });
}
  1. Add function isPositionIsTrue
/**
* Return is area select is the right
* @param {object} propertyAreaSelect geojson feature property of the area select
* @param {LatLng} randomPos
* @return {boolean} true if is the right area
*/
function isPositionIsTrue(propertyAreaSelect, randomPos)
propertyAreaSelect  =  {"code":"93","nom":"Provence-Alpes-Côte d'Azur"}

Additional context
In the futures, we will save official modes on https://github.com/GeoGuess/GeoGuess-Maps

@BilelJegham BilelJegham added the enhancement New feature or request label Jun 6, 2021
@BilelJegham BilelJegham self-assigned this Jun 13, 2021
BilelJegham added a commit that referenced this issue Jun 13, 2021
@BilelJegham
Copy link
Member Author

When the user launches the game, test if box map played = box mode recommendation.

Exemple: Don't play world if area picker asset for french states ;)

BilelJegham added a commit that referenced this issue Jun 30, 2021
* feat(#188): init AreaPicker

* feat: init France Région Mode

* feat: add mode continent

* feat: filter area mode

* Home Card

* refacto: init store settting

* feat: HomeCard Area

* fix: lint

* feat: JSON areas modes

* fixs

* fix: analytics ignore if not activated

* askip ça marche

* add: time attack

* fix: home sliders

* fixs: timeAtack Countdown ,...

* test

* fix: tests

* fix: warning deep

* fix: ci

* add: tests

* fix: url room openDIalog

* fix: lock

* feat: add tests

* feat: history Area

* fix: lint

* Delete TODO
@BilelJegham
Copy link
Member Author

Implement in #194

Documentation available here : https://geoguess.games/guide/dev/areas.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant