I encountered a problem while trying to set a URL with multiple arguments. Here is the code snippet that I attempted, but it did not work as expected:
@Injectable()
export class MapService {
ign : string = 'https://wxs.ign.fr/secret/geoportail/wmts?';
ignEnd = '&tilematrixset=PM&tilematrix={z}&tilecol={x}&tilerow={y}';
ignSat = this.ign + 'layer=ORTHOIMAGERY.ORTHOPHOTOS';
this.ignSat = this.ignSat + '&tilematrixset=PM';
this.ignSat = this.ignSat + '&Service=WMTS';
this.ignSat = this.ignSat + '&Request=GetTile';
this.ignSat = this.ignSat + '&Version=1.0.0';
this.ignSat = this.ignSat + '&Format=image%2Fjpeg' + this.ignEnd;
private LAYER_IGN_SATELLITE = {
id: 'ignsatelite',
name: 'IGN Satellite',
enabled: false,
layer: tileLayer(this.ignSat, {
maxZoom: 20,
attribution: 'IGN'
})
};
...
constructor() {}
...
}
Upon running the code, I received the following error message:
Unexpected token. A constructor, method, accessor, or property was expected.ts(1068)
EDIT
In an attempt to troubleshoot, I tried the following fixes:
ignSat = ignSat + '&style=normal';
And also:
ignSat = this.ignSat.concat('&style=normal');
Lastly, I attempted:
this.ignSat = this.ignSat.concat('&style=normal');