diff --git a/samples/maps/geo-map/display-custom-imagery/src/index.tsx b/samples/maps/geo-map/display-custom-imagery/src/index.tsx index 4cead34a9e..eab75dfb84 100644 --- a/samples/maps/geo-map/display-custom-imagery/src/index.tsx +++ b/samples/maps/geo-map/display-custom-imagery/src/index.tsx @@ -16,7 +16,12 @@ export default class MapDisplayCustomImagery extends React.Component { this.onMapRef = this.onMapRef.bind(this); } - public onMapRef(geoMap: IgrGeographicMap) { + public onMapRef(geoMap: IgrGeographicMap | null) { + + if (!geoMap) { + return; + } + // website hosting imagery tiles const imageryProvider = "https://api.mapbox.com/styles/v1/mapbox/streets-v11"; // most imagery tiles are provided using deep-zoom format, where 256 is tile size and Z iz zoom level, X is row tile and Y is column tile