Commit 3e102eab authored by Tejesh's avatar Tejesh 🖖

check validity of bounds before fitbound

parent 9ba67cc3
Pipeline #81256 failed with stage
in 2 minutes and 11 seconds
......@@ -146,7 +146,7 @@ MapViewer.prototype.cacheData = function (layerName, url) {
return self.gData[url]
}()
case 'object':
this.gData[hashCode(JSON.stringify(url))] = url
// this.gData[hashCode(JSON.stringify(url))] = url
// TODO: Reload all layers that use this data
// This part will make mapviewer data reactive
return async function () {
......@@ -569,7 +569,8 @@ MapViewer.prototype.zoomHandler = function (layerName, minZoom, maxZoom) {
*/
MapViewer.prototype.fitToLayer = function (layerName, options = this.options.fitbounds) {
var layer = typeof (layerName) == 'string' ? this.gLayers[layerName] : layerName
this.map.fitBounds(layer.getBounds(), options)
if (layer.getBounds().isValid())
this.map.fitBounds(layer.getBounds(), options)
}
function dataOrURL(conf) {
......
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