Fix tabs and add comment about crazy equation

This commit is contained in:
Kevin 2013-03-02 21:51:12 -08:00
parent d4903c6ce7
commit 7c019e1eb8

View File

@ -546,6 +546,8 @@ window.renderField = function(ent) {
new L.LatLng(reg.vertexB.location.latE6/1E6, reg.vertexB.location.lngE6/1E6), new L.LatLng(reg.vertexB.location.latE6/1E6, reg.vertexB.location.lngE6/1E6),
new L.LatLng(reg.vertexC.location.latE6/1E6, reg.vertexC.location.lngE6/1E6) new L.LatLng(reg.vertexC.location.latE6/1E6, reg.vertexC.location.lngE6/1E6)
]; ];
// Curve fit equation to normalize zoom window area
var areaZoomRatio = calcTriArea(latlngs)/Math.exp(14.2714860198866-1.384987247*map.getZoom()) var areaZoomRatio = calcTriArea(latlngs)/Math.exp(14.2714860198866-1.384987247*map.getZoom())
// Do nothing if zoom did not change. We need to recheck the field if the // Do nothing if zoom did not change. We need to recheck the field if the
@ -554,12 +556,12 @@ window.renderField = function(ent) {
var old = findEntityInLeaflet(fieldsLayer, window.fields, ent[0]); var old = findEntityInLeaflet(fieldsLayer, window.fields, ent[0]);
if(old) { if(old) {
if(map.getZoom() == old.options.creationZoom) return; if(map.getZoom() == old.options.creationZoom) return;
var layerCount = 0; var layerCount = 0;
old.eachLayer(function(item) { old.eachLayer(function(item) {
layerCount++; layerCount++;
}); });
if(areaZoomRatio > FIELD_MU_DISPLAY_AREA_ZOOM_RATIO && layerCount == 2) return; if(areaZoomRatio > FIELD_MU_DISPLAY_AREA_ZOOM_RATIO && layerCount == 2) return;
if(areaZoomRatio <= FIELD_MU_DISPLAY_AREA_ZOOM_RATIO && layerCount == 1) return; if(areaZoomRatio <= FIELD_MU_DISPLAY_AREA_ZOOM_RATIO && layerCount == 1) return;
removeByGuid(ent[0]); removeByGuid(ent[0]);
} }