Merge pull request #1446 from MrKartoshka/map_fix
Fix init fit to bounds
This commit is contained in:
commit
7952f8d5b3
@ -539,10 +539,14 @@ export default class TbMapWidgetV2 {
|
||||
}
|
||||
}
|
||||
if (locationsChanged && tbMap.initBounds) {
|
||||
tbMap.initBounds = !datasources.every(
|
||||
let dataReceived = datasources.every(
|
||||
function (ds) {
|
||||
return ds.dataReceived === true;
|
||||
});
|
||||
let dataValid = dataReceived && dataMap.dsDataMap.every(function (ds) {
|
||||
return !(!ds[tbMap.locationSettings.latKeyName] && !ds[tbMap.locationSettings.lngKeyName]);
|
||||
});
|
||||
tbMap.initBounds = !dataValid;
|
||||
tbMap.map.fitBounds(bounds);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user