Commit 47b3898e authored by User expired's avatar User expired
Browse files

Fixed some minor js issues

parent 8e39505b
Upcoming version:
-----------------
- Fixed some minor js issues (Nikolaus Krismer)
- using own pouchdb caching implementation (fixes scoping issue) (Nikolaus Krismer)
- Upgrading PouchDB to latest version (Nikolaus Krismer)
- Implemented hierarchical isochrone analyses types (Nikolaus Krismer)
......
......@@ -218,6 +218,7 @@ define(['jquery', 'leaflet', 'util/loggingUtils', '@turf/inside', 'spin.js', 'is
markersInLayer = 0,
osmBBox = [dsBBoxMin.lat, dsBBoxMin.lng, dsBBoxMax.lat, dsBBoxMax.lng],
strBBox = osmBBox.join(','),
t = null,
useCoverageMask = config.useCoverageMask(),
url = null;
......@@ -249,6 +250,8 @@ define(['jquery', 'leaflet', 'util/loggingUtils', '@turf/inside', 'spin.js', 'is
// prepare and send ajax calls
for (i = 0; i < type.length; ++i) {
t = type[i];
url = osmUrl.replace(/(BBOX)/g, strBBox).replace(/(\(AMENITY\))/g, t);
fn = function(callIndex, callObject, data) {
markers = [],
markersInLayer = 0;
......@@ -306,8 +309,6 @@ define(['jquery', 'leaflet', 'util/loggingUtils', '@turf/inside', 'spin.js', 'is
logger.debug(' - data from OSM receievd for call #' + (callIndex + 1));
arrDeferred[callIndex].resolve(analyseLayer);
};
t = type[i];
url = osmUrl.replace(/(BBOX)/g, strBBox).replace(/(\(AMENITY\))/g, t);
logger.debug(' - from OSM (call #' + (i + 1) + '):', url);
$.getJSON(url, fn.bind(this, i, allTypes[t]));
......@@ -351,8 +352,8 @@ define(['jquery', 'leaflet', 'util/loggingUtils', '@turf/inside', 'spin.js', 'is
for (var faType in FA_MAPPING) {
types.push(faType);
}
for (var faType in TYPE_HIERARCHIES) {
types.push(faType);
for (var fahType in TYPE_HIERARCHIES) {
types.push(fahType);
}
types.sort();
......
......@@ -18,7 +18,7 @@ define(['jquery', 'leaflet', 'util/loggingUtils', 'isochrone/configuration', 'ma
var baseLayers = {},
cacheConfig = {
cacheMaxAge: TILE_CACHE_MAXAGE,
crossOrigin: true,
crossOrigin: true,
useCache: USE_TILE_CACHE
},
drawState = null,
......@@ -525,7 +525,7 @@ define(['jquery', 'leaflet', 'util/loggingUtils', 'isochrone/configuration', 'ma
layer.on('tilecachemiss', function(e) {
logger.debug('TileCache miss: ', e.url);
});
layer.on('tilecacheerror', function(ev) {
layer.on('tilecacheerror', function(e) {
logger.debug('TileCache error: ', e.tile, e.error);
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment