-
-
Notifications
You must be signed in to change notification settings - Fork 36
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
How to create a map from an existing database #25
Comments
can you describe where you are stuck, cause as far as I can see, it is
|
Finally code working can you find a way to work this code in an optimum way.
|
could be rewritten to let mycontrylist = [{counry: 'India',count:10},{counry:'South Korea',count:15},{counry:'Vietnam',count:8}];
const lookup = new Map(mycontrylist.map((d) => [d.counry, d.count]));
const display_list = countries.map((element) => {
return {
feature: element,
value: lookup.get(element.properties.name) || 0,
};
}); |
sgratzl
added
the
answered
The question has been answered but is in a waiting state
label
Jul 17, 2020
Thank you for your help Mr Samuel Gratzl. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a JSON data loaded from the server
data looks like this:
[array]
- country name
- count (value )
How do I display this into the map with other counties (not included in the array) value to be zero and countries present in the array with the count value?
The text was updated successfully, but these errors were encountered: