django dynamique map

hi
i have model detail with x, y numerique coordinate
i would like to set map in template localisation of X, Y in with detail in page HTML

how to that
helps please and thanks

Check out this talk on using Leaflet.js with Django by Paulo Melchiorre: https://www.paulox.net/2019/01/21/pyroma-2019/#pyroma-2019

1 Like

its a great work
i m looking for that
but its most complicated
where i can found example simple to inspire me
thanks

That is a “simple” example. What you are looking to do is not trivial and does require some work and effort to understand.

thanks
i success to include map leaflet in my template
i am seeking for split my page in two section
one left for map (screen all), other right for data description
i have boostrap4
i put css of map and div map id
when i add id=“map” in div the map come horizontal not vertical

#map { width: 100%; height: 820px; }
<div class="container">

  <div class="row">

    <div class="col-md-6">

      <!-- Your first column here -->

      {% leaflet_map "main" callback="map_init" %} 

      <script type="text/javascript">
       ....     
    </div>

    <div class="col-md-6">

      <!-- Your second column here -->

      <h2>Details</h2>

       

          ....

          <button type="button" class="btn btn-primary" data-toggle="modal" data- 
           target="#modalAn">Analyses</button>
                                                                 

          <button type="button" class="btn btn-primary" data-toggle="modal"

            onclick="window.open('');">Data</button>



    </div>    

  </div>

</div>

That’s going to be a Leaflet / JavaScript / CSS / Bootstrap issue, not a Django issue. You might find someone here who can help you, but you’re more likely to get more help in a Leaflet-related forum.

1 Like