-
Notifications
You must be signed in to change notification settings - Fork 89
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
Can I get state names and put in map? #31
Comments
I am also looking for same feature. Have you accomplished this @LenaHovhannisyan ? |
@gabidavila, please look into this feature aswell. Please allow to show statenames. |
This I need to look a bit further, because I don't want to show state abbreviations if the map is too small. I need to think this trhough |
I found another library but it does not complete what I want. |
@LenaHovhannisyan but there no proper documentation for this. can you show me the map image how it is looking ? |
@gabidavila I am able to show the state label names on the map for large state. For smaller states i need to use the element to create a line and show the state name. I haven't done yet. |
@gabidavila this looks great. Did you published these changes? |
@ymihir Can you share your code to get the state names with line elements? |
@a2441918 unfortunately i didn't used this package. I took another approach |
@LenaHovhannisyan , have you published your solution by any chance? |
I implemented this in my fork https://github.com/jlev/react-usa-map |
@jlev - I'm interested in building upon your fork. Would you mind making a PR? @gabidavila - To handle your use case, the ReadMe could recommend people use a dropdown menu (ex: hide map via css depending on screen with) for smaller devices. This is how we've implemented before. |
@ACPK I forked from the NCSAAthleticRecruiting version, so my branch has other changes on it including support for onMouseOver events. But, if you're interested in applying just the changes for the labels, look at jlev@1d21a2e Basically involved nesting each state in an SVG group, and then adding a text anchor child with a local offset. It did require some react effects to get the state dimensions after rendering, so it now requires version 16. |
Any update on this? |
@Pixele9 I haven't been building with this library for awhile, but the fork I pointed to has functionality for state names, text offsets and onMouseOver events. It doesn't look like @gabidavila is actively maintaining this project any more. Luckily with open source, you can fork and build exactly what you want. |
Thanks @jlev! It it on NPM or how would you recommend to use your fork? |
Yeah, it's on NPM. I bumped the version number to 1.5.4 It looks like there is also a functional typescript version at https://github.com/makahn64/react-usa-map-fc which has received more active development. |
@Pixele9 Seems like your babel setup may not be correct. |
I've been trying to check babel config but it's still not working. Could it be your package react version? I'm using react v17.0.2 |
Hi @jlev! I just found the problem I had in production and fixed it by exporting as default from your module exports like this: |
Like this https://images-na.ssl-images-amazon.com/images/I/81r8Hxz5lQL._SL1500_.jpg
The text was updated successfully, but these errors were encountered: