On centre la carte sur l'élément cliqué
This commit is contained in:
parent
533d52a24e
commit
5797dc98bb
@ -64,7 +64,10 @@
|
||||
{% for place in object_list %}
|
||||
markerArray.push(L.marker([{{ place.location }}]).bindPopup('<a href="{% url 'view_place' place.pk %}">{{ place.name }}</a><br />{% if place.address %}{{ place.address }}, {% endif %}{{ place.city }}'));
|
||||
window.mMapping[{{ place.id }}] = markerArray[markerArray.length - 1];
|
||||
window.jQuery('a#open-map-{{ place.id }}').click(function(){ window.mMapping[{{ place.id }}].openPopup();});
|
||||
window.jQuery('a#open-map-{{ place.id }}').click(function(){
|
||||
window.mMapping[{{ place.id }}].openPopup();
|
||||
map.panTo(window.mMapping[{{ place.id }}].getLatLng());
|
||||
});
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
var group = L.featureGroup(window.markerArray).addTo(map);
|
||||
|
Loading…
Reference in New Issue
Block a user