Merge pull request #12 from jugglingnutcase/hack-spots
Bind marker `popUp`s earlier
This commit is contained in:
commit
e529246e11
11
index.html
11
index.html
@ -94,6 +94,10 @@
|
|||||||
<p><strong><span class="red-text">{{numberOfSpots}}</span> hack spots strong!</p>
|
<p><strong><span class="red-text">{{numberOfSpots}}</span> hack spots strong!</p>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script id="popUps" type="text/html">
|
||||||
|
<h2>{{ name }}</h2>
|
||||||
|
</script>
|
||||||
|
|
||||||
<script id="selectedSpot" type="text/html">
|
<script id="selectedSpot" type="text/html">
|
||||||
{{#rows}}
|
{{#rows}}
|
||||||
<h4 class="fauxButton">SELECTED SPOT</h4>
|
<h4 class="fauxButton">SELECTED SPOT</h4>
|
||||||
@ -191,6 +195,10 @@
|
|||||||
// design the popups to have the content and
|
// design the popups to have the content and
|
||||||
// interactions that we want
|
// interactions that we want
|
||||||
function addPopups(map, markerLayer) {
|
function addPopups(map, markerLayer) {
|
||||||
|
markerLayer.eachLayer(function(marker) {
|
||||||
|
var popupContent = ich.popUps(marker.feature.opts)
|
||||||
|
marker.bindPopup(popupContent, {closeButton: false,})
|
||||||
|
})
|
||||||
markerLayer.on('click', function(e) {
|
markerLayer.on('click', function(e) {
|
||||||
// clear any selected rows
|
// clear any selected rows
|
||||||
$('.spotRow').removeClass("selectedRow")
|
$('.spotRow').removeClass("selectedRow")
|
||||||
@ -211,9 +219,6 @@
|
|||||||
})
|
})
|
||||||
$('#latestSpot').css("display", "none")
|
$('#latestSpot').css("display", "none")
|
||||||
$('#selectedSpot').html(selectedSpot).css("display", "inline")
|
$('#selectedSpot').html(selectedSpot).css("display", "inline")
|
||||||
var feature = e.layer.feature
|
|
||||||
var popupContent = '<h2>' + feature.opts.name + '</h2>'
|
|
||||||
e.layer.bindPopup(popupContent, {closeButton: false,})
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user