remove range circles when closing portal details

This commit is contained in:
Jon Atkins 2013-05-07 04:53:27 +01:00
parent 7248b17ea8
commit 0f1c22cdc1

View File

@ -95,9 +95,16 @@ window.setPortalIndicators = function(d) {
).addTo(map); ).addTo(map);
else else
portalAccessIndicator.setLatLng(coord); portalAccessIndicator.setLatLng(coord);
} }
window.clearPortalIndicators = function() {
if(portalRangeIndicator) map.removeLayer(portalRangeIndicator);
portalRangeIndicator = null;
if(portalAccessIndicator) map.removeLayer(portalAccessIndicator);
portalAccessIndicator = null;
}
// highlights portal with given GUID. Automatically clears highlights // highlights portal with given GUID. Automatically clears highlights
// on old selection. Returns false if the selected portal changed. // on old selection. Returns false if the selected portal changed.
// Returns true if its still the same portal that just needs an // Returns true if its still the same portal that just needs an
@ -123,4 +130,5 @@ window.unselectOldPortal = function() {
if(oldPortal) portalResetColor(oldPortal); if(oldPortal) portalResetColor(oldPortal);
selectedPortal = null; selectedPortal = null;
$('#portaldetails').html(''); $('#portaldetails').html('');
clearPortalIndicators();
} }