Skip to content

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

@BilelJegham

Description

@BilelJegham

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions