Closed UO270115 closed 3 years ago
I really do not get the question. All the things that you are saying make sense. It would be convenient to have a system to put a name to locations so we can identify them later. For instance, is you go to a restaurant you may want to put a name to that location. For the other locations (the ones that we do not give a name/tag) I think it would enough to plot them in a map and be able to select them there (to delete one for instance).
Hi @pglez82 , I have implemented the creation of tags successfully. I want to show those tags as markers in a map. The problem is that the view renders twice as the other components; the first time the markers array is empty and the second has the correct information, but unfortunately the markers never arrived and I do not know why. The troubled code is here. I will be very thankful if you can tell me some tip or whatever because I have been working on this all week and with different approaches.
This optional feauture is "completed" as we can create tags, list them and search between the list. I would like to include the map because I think with it the implementation will be awesome but if finally I am not able to do it I will remove it.
Hi. Something is strange about how you update the state. I changed to this code in the componentDidMount function:
this.setState({markers: this.state.markers.concat([aux])})
Using this, I get the function withGoogleMap
called after the markers arrive. Still nothing shows in the map but maybe you can work it out.
By the way, do you know that you can debug in react? (https://code.visualstudio.com/docs/nodejs/reactjs-tutorial#_debugging-react). It is quite useful for this kind of things.
Let me know if you can make it work with this hints. If not, I will take a look at it on Monday.
Pablo
Did you solve it?
Yes, I have successfully solved it yesterday and I have know do it something similar with the nearby friends map. Both are working now.
One optional feature talks about that the application may be possible to tag locations to facilitate their search. From this idea I understand two different things: give the user a possibility of creating a tag when clicking a position of the map and when this location is saved in the history it is saved as the tag name (appart from the needed coordinates), or something similar; or give the user the possibility to give a name to the different locations in the history.
In a different view ( called Tags, it is just an idea) be able to search within the locations history the ones with that tag name to allow the user find quickly and in a more comfortable way which day and time he/she was in that position.