Skip to content

Commit cb39818

Browse files
mdd-improve-azure-samples3 (#1052)
* mdd-improve-azure-samples3 mdd-improve-azure-samples3 * Update index.ts
1 parent e8b3e1f commit cb39818

File tree

1 file changed

+17
-6
lines changed
  • samples/maps/geo-map/display-azure-imagery/src

1 file changed

+17
-6
lines changed

samples/maps/geo-map/display-azure-imagery/src/index.ts

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import {
1212
IgcAzureMapsImagery,
1313
IgcGeographicMapComponent,
1414
IgcGeographicMapModule,
15-
IgcGeographicTileSeriesComponent,
16-
IgcTileSeriesComponent
15+
IgcGeographicTileSeriesComponent
1716
} from 'igniteui-webcomponents-maps';
1817
import 'igniteui-webcomponents/themes/light/bootstrap.css';
1918
import { MapRegion, MapUtils } from './MapUtils';
@@ -159,16 +158,28 @@ export class MapDisplayImageryAzureTiles {
159158
style === AzureMapsImageryStyle.Road ||
160159
style === AzureMapsImageryStyle.DarkGrey
161160
) {
162-
this.map.series.clear();
161+
this.imagerySeries.tileImagery = tileSource;//no additional background
162+
}
163+
else if (
164+
style === AzureMapsImageryStyle.TrafficDelayOverlay ||
165+
style === AzureMapsImageryStyle.TrafficAbsoluteOverlay ||
166+
style === AzureMapsImageryStyle.TrafficReducedOverlay ||
167+
style === AzureMapsImageryStyle.TrafficRelativeOverlay ||
168+
style === AzureMapsImageryStyle.WeatherInfraredOverlay ||
169+
style === AzureMapsImageryStyle.WeatherRadarOverlay
170+
) {
171+
const bgImagery = new IgcAzureMapsImagery();
172+
bgImagery.imageryStyle = AzureMapsImageryStyle.DarkGrey;
173+
bgImagery.apiKey = this.apiKey ?? '';
163174
this.imagerySeries.tileImagery = tileSource;
164-
this.map.series.add(this.imagerySeries);
175+
this.map.backgroundContent = bgImagery; //background dark grey
165176
}
166177
else {
167178
const bgImagery = new IgcAzureMapsImagery();
168-
bgImagery.imageryStyle = AzureMapsImageryStyle.Road;
179+
bgImagery.imageryStyle = AzureMapsImageryStyle.Satellite;
169180
bgImagery.apiKey = this.apiKey ?? '';
170181
this.imagerySeries.tileImagery = tileSource;
171-
this.map.backgroundContent = bgImagery;
182+
this.map.backgroundContent = bgImagery; //background satellite
172183
}
173184
}
174185
}

0 commit comments

Comments
 (0)