Design comparison
Solution retrospective
update: fixed the map error and now it works fine, thanks to @mikeanthony23 for telling me about the error and how to fix it. Any feedback would be great. how is the HTML, CSS, and js code quality? Are there any bad practices?
Community feedback
- @mikeanthony23Posted over 3 years ago
I'm getting this map error ( Error: Map container is already initialized.) if you try to search another IP. You can fix it by creating it dynamically as we click the search button :) hope this helps.
0@Anwar11234Posted over 3 years ago@mikeanthony23 Thanks for telling me about that error I didn't realize it was there. but I don't understand the fix you're talking about
0@mikeanthony23Posted over 3 years ago@Anwar11234 I also got stuck in this error while doing this challenge. This error happens when we try to re-render the map. You can try to fix it by looking at the map usage in leaflet docs. But you can also simply fix it by removing your <div id="map"></div> in the html file and replace it with a container.
Example :
<div class="map-container"></div> // should be emptySo every time you try to call your method to display your map you can create the map by doing this : mapContainer.innerHTML =
<div id='map'></div>
.I hope everything is clear now. I'm sorry for my english :D
0@Anwar11234Posted over 3 years ago@mikeanthony23 There's nothing wrong with your English my friend. Still not understanding the fix yet but I will work on it and I'll look into your code. If you like, you can send me a pull request on changes that can be made.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord