Skip to content

Commit faaa475

Browse files
author
Anshpreet
committed
fixed 2 test issues
1 parent a043904 commit faaa475

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mapml/layers/MapLayer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ export var MapMLLayer = L.Layer.extend({
304304

305305
_validProjection : function(map){
306306
let noLayer = false;
307-
if(this._extent._mapExtents){
307+
if(this._extent && this._extent._mapExtents){
308308
for(let i = 0; i < this._extent._mapExtents.length; i++){
309309
if(this._extent._mapExtents[i]._templateVars){
310310
for(let template of this._extent._mapExtents[i]._templateVars)
@@ -1400,6 +1400,7 @@ export var MapMLLayer = L.Layer.extend({
14001400
// a layer must share a projection with the map so that all the layers can
14011401
// be overlayed in one coordinate space. WGS84 is a 'wildcard', sort of.
14021402
getProjection: function () {
1403+
if(!this._extent) { return; }
14031404
let extent = this._extent._mapExtents ? this._extent._mapExtents[0] : this._extent; // the projections for each extent eould be the same (as) validated in _validProjection, so can use mapExtents[0]
14041405
if(!extent) return FALLBACK_PROJECTION;
14051406
switch (extent.tagName.toUpperCase()) {

0 commit comments

Comments
 (0)