Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Make a model with the coordinate of the marker and add. information to display the icon.
If your database allows - I recommend using the gis extension (Geo Django)
from django.contrib.gis.db import models
class Marker(models.Model):
point = models.PointField()
icon_url = models.CharField(...)
...
<script type="text/javascript">
var map;
DG.then(function () {
map = DG.map('map', {
center: [54.98, 82.89],
zoom: 13
});
{% for marker in markers %}
DG.marker([{{marker.point.x}}, {{marker.point.y}}]).addTo(map);
{% endfor %}
});
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question