@mikeanthony23
Posted
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.
@Anwar11234
Posted
@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
@mikeanthony23
Posted
@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
@Anwar11234
Posted
@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.