So, I am using a Django application where I am using the google maps API as well. So this is the instance...when I submit a form... I only want my form div to reload and NOT the div where my map lies.
So my code is...
<section class="middleSection p-2">
<div class="HideOpenMiddleCont justify-content-center" onclick="HideOpenMiddleCont()">
<div class="px-4 rounded-pill bg-warning" id="arrowCont">
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="currentColor" class="bi bi-arrow-down-short text-dark" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M8 4a.5.5 0 0 1 .5.5v5.793l2.146-2.147a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 1 1 .708-.708L7.5 10.293V4.5A.5.5 0 0 1 8 4z"/>
</svg>
</div>
</div>
{% if view == 'trip' %}
{% include "app/passenger/trip.html" %}
{% elif view == "upcomingRides" %}
{% include "app/passenger/upcomingRides.html" %}
{% elif view == "pastRides" %}
{% include "app/passenger/pastRides.html" %}
{% endif %}
<div class="optionBarPull" data-bs-toggle="offcanvas" href="#offcanvasExample" role="button" aria-controls="offcanvasExample">
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="currentColor" class="bi bi-arrow-right-circle-fill" viewBox="0 0 16 16">
<path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zM4.5 7.5a.5.5 0 0 0 0 1h5.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5H4.5z"/>
</svg>
</div>
</section>
<section class="rightSection" id="map">
<h3 class="font3 text-center p-2"><strong>Google Maps is here</strong></h3>
<h4 class="font3 text-center text-danger" id="googleMapsText"></h4>
<h5 class="font3 text-center text-muted">Please try refreshing the page if the maps doesnt display.</h5>
</section>
My form is in the <section class="middleSection p-2">
, which i want to reload once submitted but I want to keep the <section class="rightSection" id="map">
as it is.
How am I to deal with such a situation, because when I submit a form all my markers and circles get erased which is annoying...
Any help would be greatly appreciated thanks!