Commit fd483377 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '1416-google-maps-with-no-background' into 'devel_15.1.x'

google maps without background had some issues

See merge request !1258
parents 2b38765d a8ae6bbd
Pipeline #34567 failed with stage
in 16 minutes and 29 seconds
......@@ -9,6 +9,8 @@ minerva (15.1.1) stable; urgency=medium
example P0C2L1) could crash caching (#1377)
* Bug fix: removing non-existing project results in warning not an error
message (#1367)
* Bug fix: opening map in google maps without background resulted in
unexpected error (#1416)
-- Piotr Gawron <piotr.gawron@uni.lu> Thu, 23 Nov 2020 15:00:00 +0200
......
......@@ -136,7 +136,11 @@ GoogleMapsApiCanvas.prototype.setupBackgroundOverlays = function (backgroundOver
var mapType = new google.maps.ImageMapType(typeOptions);
this.getGoogleMap().mapTypes.set(overlay.id.toString(), mapType);
}
this.getGoogleMap().setMapTypeId(backgroundOverlays[0].id.toString());
if (backgroundOverlays[0] !== undefined) {
this.getGoogleMap().setMapTypeId(backgroundOverlays[0].id.toString());
} else {
this.getGoogleMap().setMapTypeId('none');
}
};
/**
......
......@@ -58,6 +58,20 @@ describe('GoogleMapsApiCanvas', function () {
assert.ok(result);
});
it("no background overlays", function () {
var options = {
center: new Point(0, 0),
tileSize: 256,
width: 300,
height: 600,
minZoom: 2,
zoom: 5,
backgroundOverlays: []
};
var canvas = new GoogleMapsApiCanvas(testDiv, options);
assert.ok(canvas);
});
it("getTileUrl", function () {
var coordinates = {x: 0, y: 0};
var canvas = new GoogleMapsApiCanvas(testDiv, testOptions);
......
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